Skip to content

Commit e3f5db6

Browse files
authored
Merge pull request #112 from lsetiawan/core_index
Add ODM2 Models Core Index
2 parents b40e76a + 62d985c commit e3f5db6

File tree

5 files changed

+83
-20
lines changed

5 files changed

+83
-20
lines changed

docs/source/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
'sphinx.ext.autodoc',
3535
'sphinx.ext.viewcode',
3636
'sphinx.ext.napoleon',
37+
'sphinx.ext.autosummary'
3738
]
3839

3940
# Add any paths that contain templates here, relative to this directory.
@@ -176,3 +177,6 @@
176177
author, 'ODM2PythonAPI', 'One line description of project.',
177178
'Miscellaneous'),
178179
]
180+
181+
182+
autosummary_generate = True

docs/source/index.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ A Python-based application programmer's interface for the `Observations Data Mod
99

1010
installing
1111
modules
12-
models
12+
odm2models
1313
credits
1414

1515
Indices and tables
1616
==================
1717

18+
.. toctree::
19+
:maxdepth: 2
20+
21+
models
22+
1823
* :ref:`genindex`
1924
* :ref:`modindex`
2025
* :ref:`search`

docs/source/models.rst

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1-
ODM2 Models
2-
===========
1+
ODM2 Models Index
2+
==================
33

4-
.. automodule:: odm2api.ODM2.models
5-
:members:
6-
:undoc-members:
7-
:show-inheritance:
4+
ODM2 is organized with a "core" schema and multiple "extension" schemas that
5+
extend the functionality of the core. The following sections cover some overarching concepts
6+
for ODM2 and then focus on specific entities within the ODM2 Core schema and ODM2's extension schemas.
7+
8+
ODM2Core Entities
9+
------------------
10+
11+
The following are entities in the `ODM2 Core Schema <http://odm2.github.io/ODM2/schemas/ODM2_Current/diagrams/ODM2Core.html>`__:
12+
13+
.. autosummary::
14+
15+
odm2api.ODM2.models.Actions
16+
odm2api.ODM2.models.DataSets
17+
odm2api.ODM2.models.FeatureActions
18+
odm2api.ODM2.models.Methods
19+
odm2api.ODM2.models.Organizations
20+
odm2api.ODM2.models.People
21+
odm2api.ODM2.models.ProcessingLevels
22+
odm2api.ODM2.models.RelatedActions
23+
odm2api.ODM2.models.Results
24+
odm2api.ODM2.models.SamplingFeatures
25+
odm2api.ODM2.models.TaxonomicClassifiers
26+
odm2api.ODM2.models.Units
27+
odm2api.ODM2.models.Variables

docs/source/odm2models.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ODM2 Models
2+
===========
3+
4+
.. automodule:: odm2api.ODM2.models
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

odm2api/ODM2/models.py

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,19 @@ class CVReferenceMaterialMedium(Base, CV):
154154
# Core
155155
# ################################################################################
156156
class People(Base):
157-
157+
"""
158+
Individuals that perform actions.
159+
"""
158160
PersonID = Column('personid', Integer, primary_key=True, nullable=False)
159161
PersonFirstName = Column('personfirstname', String(255), nullable=False)
160162
PersonMiddleName = Column('personmiddlename', String(255))
161163
PersonLastName = Column('personlastname', String(255), nullable=False)
162164

163165

164166
class Organizations(Base):
165-
167+
"""
168+
A group of people.
169+
"""
166170
OrganizationID = Column('organizationid', Integer, primary_key=True, nullable=False)
167171
OrganizationTypeCV = Column('organizationtypecv', ForeignKey(CVOrganizationType.Name), nullable=False,
168172
index=True)
@@ -194,7 +198,9 @@ class Affiliations(Base):
194198

195199

196200
class Methods(Base):
197-
201+
"""
202+
The procedure used to perform an action.
203+
"""
198204
MethodID = Column('methodid', Integer, primary_key=True, nullable=False)
199205
MethodTypeCV = Column('methodtypecv', ForeignKey(CVMethodType.Name), nullable=False, index=True)
200206
MethodCode = Column('methodcode', String(50), nullable=False)
@@ -208,7 +214,9 @@ class Methods(Base):
208214

209215

210216
class Actions(Base):
211-
217+
"""
218+
Actions are performed by people and may have a result.
219+
"""
212220
ActionID = Column('actionid', Integer, primary_key=True, nullable=False)
213221
ActionTypeCV = Column('actiontypecv', ForeignKey(CVActionType.Name), nullable=False, index=True)
214222
MethodID = Column('methodid', ForeignKey(Methods.MethodID), nullable=False)
@@ -236,7 +244,9 @@ class ActionBy(Base):
236244

237245

238246
class SamplingFeatures(Base):
239-
247+
"""
248+
Where or on what an action was performed.
249+
"""
240250
SamplingFeatureID = Column('samplingfeatureid', Integer, primary_key=True, nullable=False)
241251
SamplingFeatureUUID = Column('samplingfeatureuuid', String(36), nullable=False)
242252
SamplingFeatureTypeCV = Column('samplingfeaturetypecv', ForeignKey(CVSamplingFeatureType.Name),
@@ -262,7 +272,10 @@ class SamplingFeatures(Base):
262272

263273

264274
class FeatureActions(Base):
265-
275+
"""
276+
Provides flexible linkage between Actions and the SamplingFeatures
277+
on which or at which they were performed.
278+
"""
266279
FeatureActionID = Column('featureactionid', Integer, primary_key=True, nullable=False)
267280
SamplingFeatureID = Column('samplingfeatureid', ForeignKey(SamplingFeatures.SamplingFeatureID),
268281
nullable=False)
@@ -273,7 +286,9 @@ class FeatureActions(Base):
273286

274287

275288
class DataSets(Base):
276-
289+
"""
290+
Enables grouping of results into a larger dataset.
291+
"""
277292
DataSetID = Column('datasetid', Integer, primary_key=True, nullable=False)
278293

279294
# This has been changed to String to support multiple database uuid types
@@ -285,15 +300,19 @@ class DataSets(Base):
285300

286301

287302
class ProcessingLevels(Base):
288-
303+
"""
304+
Levels to which data have been quality controlled.
305+
"""
289306
ProcessingLevelID = Column('processinglevelid', Integer, primary_key=True, nullable=False)
290307
ProcessingLevelCode = Column('processinglevelcode', String(50), nullable=False)
291308
Definition = Column('definition', String(500))
292309
Explanation = Column('explanation', String(500))
293310

294311

295312
class RelatedActions(Base):
296-
313+
"""
314+
Enables specifying relationships among Actions (e.g., workflows, etc.)
315+
"""
297316
RelationID = Column('relationid', Integer, primary_key=True, nullable=False)
298317
ActionID = Column('actionid', ForeignKey(Actions.ActionID), nullable=False)
299318
RelationshipTypeCV = Column('relationshiptypecv', ForeignKey(CVRelationshipType.Name), nullable=False,
@@ -305,7 +324,9 @@ class RelatedActions(Base):
305324

306325

307326
class TaxonomicClassifiers(Base):
308-
327+
"""
328+
Terms for classifying results.
329+
"""
309330
TaxonomicClassifierID = Column('taxonomicclassifierid', Integer, primary_key=True, nullable=False)
310331
TaxonomicClassifierTypeCV = Column('taxonomicclassifiertypecv', ForeignKey(CVTaxonomicClassifierType.Name),
311332
nullable=False, index=True)
@@ -320,7 +341,9 @@ class TaxonomicClassifiers(Base):
320341

321342

322343
class Units(Base):
323-
344+
"""
345+
Units of measure.
346+
"""
324347
UnitsID = Column('unitsid', Integer, primary_key=True, nullable=False)
325348
UnitsTypeCV = Column('unitstypecv', ForeignKey(CVUnitsType.Name), nullable=False, index=True)
326349
UnitsAbbreviation = Column('unitsabbreviation', String(255), nullable=False)
@@ -329,7 +352,9 @@ class Units(Base):
329352

330353

331354
class Variables(Base):
332-
355+
"""
356+
What was observed.
357+
"""
333358
VariableID = Column('variableid', Integer, primary_key=True, nullable=False)
334359
VariableTypeCV = Column('variabletypecv', ForeignKey(CVVariableType.Name), nullable=False, index=True)
335360
VariableCode = Column('variablecode', String(50), nullable=False)
@@ -341,7 +366,9 @@ class Variables(Base):
341366

342367

343368
class Results(Base):
344-
369+
"""
370+
The result of an action.
371+
"""
345372
ResultID = Column('resultid', BigIntegerType, primary_key=True)
346373

347374
# This has been changed to String to support multiple database uuid types

0 commit comments

Comments
 (0)