Skip to content

Commit

Permalink
Merge pull request #438 from SynBioDex/436-informed-by
Browse files Browse the repository at this point in the history
Resolve #436: add wasInformedBy property to Activity
  • Loading branch information
tcmitchell authored Oct 16, 2023
2 parents 55b0013 + f1b8577 commit 1632e86
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sphinx-autoapi
sphinx_rtd_theme
1 change: 1 addition & 0 deletions sbol3/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 5 additions & 0 deletions sbol3/provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/test_provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1632e86

Please sign in to comment.