Skip to content

Commit eeff592

Browse files
authored
Merge pull request #286 from mpsonntag/1.4doc
Documentation updates for 1.4 release
2 parents 197279a + 685f502 commit eeff592

File tree

14 files changed

+559
-607
lines changed

14 files changed

+559
-607
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2011-2014, German Neuroinformatics Node (G-Node)
1+
Copyright (c) 2011-2018, German Neuroinformatics Node (G-Node)
22

33
All rights reserved.
44

README.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ available on `GitHub <https://github.com/G-Node/python-odml>`_. If you are not f
1717
with the version control system **git**, but still want to use it, have a look at the
1818
documentation available on the `git-scm website <https://git-scm.com/>`_.
1919

20+
21+
Breaking changes
22+
----------------
23+
24+
odML Version 1.4 introduced breaking format and API changes compared to the previous
25+
versions of odML. Files saved in the previous format versions can be converted to a 1.4
26+
compatible format using the version converter from the odml/tools package.
27+
28+
2029
Dependencies
2130
------------
2231

doc/base-classes.rst

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ Again each Property can have multiple Values.
1010

1111
The odml Module contains wrappers, that are shortcuts for creating the main objects::
1212

13-
>>> from odml import Document, Section, Property, Value
13+
>>> from odml import Document, Section, Property
1414
>>> Document(version=0.9, author="Kermit")
1515
<Doc 0.9 by Kermit (0 sections)>
1616

1717
Several modules exist to extend the implementation.
1818
The ones included in the library are those:
1919

20-
* :py:mod:`odml.tools.event` provides event capabilities, allowing to add change-listeners to objects
21-
* :py:mod:`odml.tools.nodes` provides a tree-interface used by the gui with functions like next() and position()
22-
2320
Document
2421
--------
2522
.. autoclass:: odml.doc.BaseDocument
@@ -40,11 +37,3 @@ Property
4037
:members:
4138
:inherited-members:
4239
:undoc-members:
43-
44-
Value
45-
-----
46-
.. autoclass:: odml.value.BaseValue
47-
:members:
48-
:inherited-members:
49-
:undoc-members:
50-

doc/conf.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import os
15+
import sys
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
1819
# documentation root, use os.path.abspath to make it absolute, like shown here.
1920
sys.path.insert(0, os.path.abspath('..'))
21+
22+
2023
class DocStringInheritor(type):
21-
'''A variation on
24+
"""A variation on
2225
http://groups.google.com/group/comp.lang.python/msg/26f7b4fcb4d66c95
2326
by Paul McGuire
24-
'''
27+
"""
2528
def __new__(meta, name, bases, clsdict):
2629
if not('__doc__' in clsdict and clsdict['__doc__']):
2730
for mro_cls in (mro_cls for base in bases for mro_cls in base.mro()):
@@ -38,8 +41,6 @@ def __new__(meta, name, bases, clsdict):
3841
attribute.__doc__=doc
3942
break
4043
return type.__new__(meta, name, bases, clsdict)
41-
#import odml.doc
42-
#odml.doc.BaseDocument = DocStringInheritor("BaseDocument", odml.doc.BaseDocument.__bases__, dict(odml.doc.BaseDocument.__dict__))
4344

4445
# -- General configuration -----------------------------------------------------
4546

@@ -61,7 +62,7 @@ def __new__(meta, name, bases, clsdict):
6162

6263
# General information about the project.
6364
project = u'python-odml'
64-
copyright = u'2011, Hagen Fritsch'
65+
copyright = u'2011-2018, German Neuroinformatics Node (G-Node); based on work by Hagen Fritsch'
6566

6667
# The version info for the project you're documenting, acts as replacement for
6768
# |version| and |release|, also used in various other places throughout the

doc/example_odMLs/THGTTG.odml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<?xml-stylesheet type="text/xsl" href="odmlTerms.xsl"?>
33
<?xml-stylesheet type="text/xsl" href="odml.xsl"?>
44
<odML version="1.1">
5+
<repository>http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml</repository>
56
<version>42</version>
67
<section>
78
<name>TheCrew</name>

doc/example_odMLs/ex_1.odml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<?xml-stylesheet type="text/xsl" href="odml.xsl"?>
44
<odML version="1.1">
55
<author>D. N. Adams</author>
6-
<repository>http://portal.g-node.org/odml/terminologies/v1.0/terminologies.xml</repository>
6+
<repository>http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml</repository>
77
<section>
88
<property>
99
<type>person</type>

doc/example_odMLs/ex_1.rdf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ odml:d98afe9b-3982-44bf-9373-12aaa4798628 a rdf:Bag ;
8383
"Tricia Marie McMillan",
8484
"Zaphod Beeblebrox" .
8585

86-
<https://g-node.org/projects/odml-rdf#7e0e07c7-7501-454e-88e7-cfa072db94c1> a <http://portal.g-node.org/odml/terminologies/v1.0/terminologies.xml> .
86+
<https://g-node.org/projects/odml-rdf#7e0e07c7-7501-454e-88e7-cfa072db94c1> a <http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml> .
8787

doc/example_odMLs/ex_2.odml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-stylesheet type="text/xsl" href="odmlTerms.xsl"?>
33
<?xml-stylesheet type="text/xsl" href="odml.xsl"?>
44
<odML version="1.1">
5-
<repository>http://portal.g-node.org/odml/terminologies/v1.0/terminologies.xml</repository>
5+
<repository>http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml</repository>
66
<section>
77
<definition>Information on the crew</definition>
88
<section>

doc/example_odMLs/thgttg.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,31 @@
77
@author: zehl
88
"""
99

10+
import datetime
11+
import os
12+
import odml
1013
import sys
14+
15+
1116
if len(sys.argv) != 2:
12-
print("You have to provide the absolute path to the odml-python module ",
13-
"your command line.")
14-
else:
15-
odml_pythonpath = sys.argv[-1]
16-
sys.path.append(odml_pythonpath)
17+
print("Please provide an existing directory for the example odml file.")
18+
quit()
1719

18-
import os
19-
import odml
20-
import datetime
20+
output_directory = sys.argv[-1]
21+
if not os.path.isdir(output_directory):
22+
print("Please provide an existing directory for the example odml file.")
23+
quit()
2124

25+
save_to = os.path.join(output_directory, "THGTTG.odml")
2226

23-
odmlrepo = 'http://portal.g-node.org/odml/terminologies/v1.0/terminologies.xml'
27+
28+
odmlrepo = 'http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml'
2429

2530
# CREATE A DOCUMENT
2631
doc = odml.Document(author="D. N. Adams",
2732
date=datetime.date(1979, 10, 12),
28-
version=42)
29-
# repository=odmlrepo)
33+
version=42,
34+
repository=odmlrepo)
3035

3136
# CREATE AND APPEND THE MAIN SECTIONs
3237
doc.append(odml.Section(name="TheCrew",
@@ -304,7 +309,5 @@
304309
dtype=odml.DType.string,
305310
definition="Manufacturer of robots"))
306311

307-
save_to = os.path.join(odml_pythonpath, "doc", "example_odMLs", "THGTTG.odml")
308-
309312
odml.save(doc, save_to)
310313

doc/mappings.rst

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)