From 4ec191f9a8cd0849bcb19df4eebbb43d03db759d Mon Sep 17 00:00:00 2001 From: Jake Beal Date: Sat, 7 Oct 2023 16:49:24 -0400 Subject: [PATCH 1/5] Resolve #436: add wasInformedBy property to Activity --- sbol3/constants.py | 1 + sbol3/provenance.py | 5 +++++ test/test_provenance.py | 1 + 3 files changed, 7 insertions(+) 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 From 859f7004e01dc7d2d377a71c245f1c4940159441 Mon Sep 17 00:00:00 2001 From: Jake Beal Date: Sat, 7 Oct 2023 17:19:40 -0400 Subject: [PATCH 2/5] Try changing to new readthedocs build --- .readthedocs.yaml | 12 ++++++++++++ docs/Makefile | 20 -------------------- 2 files changed, 12 insertions(+), 20 deletions(-) create mode 100644 .readthedocs.yaml delete mode 100644 docs/Makefile diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..d6bbb5a --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,12 @@ +# 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 diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d4bb2cb..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From 0afb96012ec8c2183f3b5ef5eafa06be0ad72dca Mon Sep 17 00:00:00 2001 From: Jake Beal Date: Sat, 7 Oct 2023 17:47:56 -0400 Subject: [PATCH 3/5] Try restoring docs Makefile --- docs/Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/Makefile diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From 790414df9b9aecffbf5f336f48ee62ccae657483 Mon Sep 17 00:00:00 2001 From: Jake Beal Date: Sat, 7 Oct 2023 17:52:08 -0400 Subject: [PATCH 4/5] readthedocs yaml needs to Include requirements --- .readthedocs.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d6bbb5a..71b1189 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,3 +10,8 @@ build: # 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 From acd15cb555dd8768e0cbce5e480e27b6ae722875 Mon Sep 17 00:00:00 2001 From: Jake Beal Date: Sat, 7 Oct 2023 17:54:32 -0400 Subject: [PATCH 5/5] Requirements was missing sphinx_rtd_theme --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) 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