Skip to content

Commit 656f4d8

Browse files
committed
[doc/tutorial] Update create sec/prop chapter
1 parent 83ac178 commit 656f4d8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doc/tutorial.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -671,11 +671,11 @@ updated::
671671
>>> print(sec1.parent)
672672
<Doc 42 by D. N. Adams (1 sections)>
673673

674-
It is also possible to directly connect a Section directly to a parent object.
674+
It is also possible to connect a Section directly to a parent object.
675675
Let's try this with the next Section we create::
676676

677-
>>> sec2 = odml.Section(name="Arthur Philip Dent',
678-
definition="Information on Arthur Dent',
677+
>>> sec2 = odml.Section(name="Arthur Philip Dent",
678+
definition="Information on Arthur Dent",
679679
type="crew/person",
680680
parent=sec1)
681681

@@ -704,7 +704,7 @@ Note that again, only the name attribute is obligatory for creating a Property.
704704
The remaining attributes can be defined later on, or are automatically
705705
generated in the process.
706706

707-
If a value is defined, but the dtype not, as it is the case for our example
707+
If a value is defined, but the dtype is not, as it is the case for our example
708708
above, the dtype is deduced automatically::
709709

710710
>>> print(prop1.dtype)
@@ -732,7 +732,7 @@ the stored metadata:
732732
+-----------------------------------+---------------------------------------+
733733
| odml.DType.person or 'person' | 'Zaphod Beeblebrox' |
734734
+-----------------------------------+---------------------------------------+
735-
| odml.DType.text or 'text' | |
735+
| odml.DType.text or 'text' | 'any text containing \n linebreaks' |
736736
+-----------------------------------+---------------------------------------+
737737
| odml.DType.url or 'url' | "https://en.wikipedia.org/wiki/Earth" |
738738
+-----------------------------------+---------------------------------------+
@@ -761,12 +761,12 @@ Next, let us create a Property with multiple metadata entries::
761761
"Tricia Marie McMillan",
762762
"Ford Prefect"],
763763
dtype=odml.DType.person)
764-
764+
765765
As you learned before, in such a case, the metadata entries must be
766766
homogeneous! That means they have to be of the same dtype, unit, and
767767
uncertainty (here ``odml.DType.person``, None, and None, respectively).
768768

769-
To further build up our odML file, let us attach now this new Porperty to the
769+
To further build up our odML file, let us attach now this new Property to the
770770
previously created Section 'TheCrew'::
771771

772772
>>> MYodML['TheCrew'].append(prop2)
@@ -792,7 +792,7 @@ hierarchical structure of the odML file looks like.
792792
Let's have a look at the XML-representation of our small odML file we just
793793
generated::
794794

795-
>>> print unicode(odml.tools.xmlparser.XMLWriter(MYodML))
795+
>>> print(odml.tools.xmlparser.XMLWriter(MYodML))
796796
<odML version="1.1">
797797
<date>1979-10-12</date>
798798
<section>

0 commit comments

Comments
 (0)