diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..71b1189 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Optionally declare the Python requirements required to build your docs +python: + install: + - requirements: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt index 44a988d..3935b1a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,2 @@ sphinx-autoapi +sphinx_rtd_theme diff --git a/sbol3/constants.py b/sbol3/constants.py index 39e5822..e73ec51 100644 --- a/sbol3/constants.py +++ b/sbol3/constants.py @@ -163,6 +163,7 @@ PROV_PLANS = PROV_NS + 'hadPlan' PROV_QUALIFIED_ASSOCIATION = PROV_NS + 'qualifiedAssociation' PROV_QUALIFIED_USAGE = PROV_NS + 'qualifiedUsage' +PROV_INFORMED_BY = PROV_NS + 'wasInformedBy' PROV_ROLES = PROV_NS + 'hadRole' PROV_STARTED_AT_TIME = PROV_NS + 'startedAtTime' PROV_ENDED_AT_TIME = PROV_NS + 'endedAtTime' diff --git a/sbol3/provenance.py b/sbol3/provenance.py index 95c1e16..daa3918 100644 --- a/sbol3/provenance.py +++ b/sbol3/provenance.py @@ -214,6 +214,7 @@ def __init__(self, identity: str, end_time: Union[str, datetime.datetime] = None, usage: List[Identified] = None, association: List[Identified] = None, + informed_by: List[Identified] = None, namespace: str = None, attachments: List[str] = None, name: str = None, description: str = None, @@ -239,6 +240,10 @@ def __init__(self, identity: str, 0, math.inf, initial_value=association, type_constraint=Association) + self.informed_by = OwnedObject(self, PROV_INFORMED_BY, + 0, math.inf, + initial_value=informed_by, + type_constraint=Activity) def accept(self, visitor: Any) -> Any: """Invokes `visit_activity` on `visitor` with `self` as the only diff --git a/test/test_provenance.py b/test/test_provenance.py index 4195db7..3bba0b3 100644 --- a/test/test_provenance.py +++ b/test/test_provenance.py @@ -24,6 +24,7 @@ def test_create(self): self.assertEqual(None, activity.end_time) self.assertEqual([], activity.usage) self.assertEqual([], activity.association) + self.assertEqual([], activity.informed_by) def test_list_wrapping(self): # Ensure that at least certain properties handle automatic list