Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #436: add wasInformedBy property to Activity #438

Merged
merged 6 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading