diff --git a/docs/conf.py b/docs/conf.py index 0da4ca5b4..88d3a5f65 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,7 +51,7 @@ "sphinx_copybutton", # For the card element "sphinx_design", - "sphinx_design", + "sphinx_design", "sphinx.ext.autosummary", "sphinx.ext.mathjax", "sphinx.ext.githubpages", @@ -59,7 +59,6 @@ "sphinx_copybutton", "IPython.sphinxext.ipython_directive", "IPython.sphinxext.ipython_console_highlighting", - # So we can write markdown files "myst_parser", ] diff --git a/docs/explanations/decisions/0002-switched-to-using-a-python-skeleton.rst b/docs/explanations/decisions/0002-switched-to-using-a-python-skeleton.rst index 996eb13f1..9ed49e9bd 100644 --- a/docs/explanations/decisions/0002-switched-to-using-a-python-skeleton.rst +++ b/docs/explanations/decisions/0002-switched-to-using-a-python-skeleton.rst @@ -29,4 +29,4 @@ We will use the Consequences ------------ -CI workflows will change, even jobs providing the same feature as the older checks. \ No newline at end of file +CI workflows will change, even jobs providing the same feature as the older checks. diff --git a/docs/images/document-generation-timeline.svg b/docs/images/document-generation-timeline.svg index fb06851c8..edfdb81e5 100755 --- a/docs/images/document-generation-timeline.svg +++ b/docs/images/document-generation-timeline.svg @@ -1 +1 @@ -Data_AcquisitionSoftware_Graphic_Rev0617Example 1: Simplest Possible RunExample 2: A Simple ScanRead motor positionand trigger and read detector(s)Triggerand readMove a motorMoveetc.Triggerand readMoveetc.etc.Read motor positionand trigger and read detector(s)Move a motorMonitor beamcurrentRecordnew valueetc.Recordnew valueMonitortemperatureExample 3: Asynchronously Monitor During a ScanRun Start: Metadata about this run, including everything we know in advance: time, type of experiment, sample info., etc.Event Descriptor: Metadata about the readings in the event (units, precision, etc.) and the relevant hardwareEvent: Readings and timestampsRun Stop: Additional metadata known at the end: what time it completed and its exit status (success, aborted, failed)Do nothing - this is the simplest possible experiment! \ No newline at end of file +Data_AcquisitionSoftware_Graphic_Rev0617Example 1: Simplest Possible RunExample 2: A Simple ScanRead motor positionand trigger and read detector(s)Triggerand readMove a motorMoveetc.Triggerand readMoveetc.etc.Read motor positionand trigger and read detector(s)Move a motorMonitor beamcurrentRecordnew valueetc.Recordnew valueMonitortemperatureExample 3: Asynchronously Monitor During a ScanRun Start: Metadata about this run, including everything we know in advance: time, type of experiment, sample info., etc.Event Descriptor: Metadata about the readings in the event (units, precision, etc.) and the relevant hardwareEvent: Readings and timestampsRun Stop: Additional metadata known at the end: what time it completed and its exit status (success, aborted, failed)Do nothing - this is the simplest possible experiment! diff --git a/pyproject.toml b/pyproject.toml index 775960d6e..ab143d783 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ ignore_missing_imports = true # Ignore missing stubs in imported modules # Run pytest with all our checkers, and don't spam us with massive tracebacks on error addopts = """ --tb=native -vv - --cov=event_model --cov-report term --cov-report xml:cov.xml + --cov=src/event_model --cov-report term --cov-report xml:cov.xml """ # https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings filterwarnings = "error" @@ -106,8 +106,8 @@ allowlist_externals = sphinx-autobuild commands = pre-commit: pre-commit run --all-files --show-diff-on-failure {posargs} - type-checking: mypy event_model {posargs} - tests: pytest --cov=event_model --cov-report term --cov-report xml:cov.xml {posargs} + type-checking: mypy src/event_model {posargs} + tests: pytest --cov=src/event_model --cov-report term --cov-report xml:cov.xml {posargs} docs: sphinx-{posargs:build -E --keep-going} -T docs build/html """ diff --git a/src/event_model/__init__.py b/src/event_model/__init__.py index 7392cc882..df8aa156f 100644 --- a/src/event_model/__init__.py +++ b/src/event_model/__init__.py @@ -2146,8 +2146,9 @@ def __call__( ) -> RunStop: if self.poison_pill: raise EventModelError( - "Already composed a RunStop document for run " - "{!r}.".format(self.start["uid"]) + "Already composed a RunStop document for run " "{!r}.".format( + self.start["uid"] + ) ) self.poison_pill.append(object()) if uid is None: diff --git a/src/event_model/documents/generate/__main__.py b/src/event_model/documents/generate/__main__.py index b3915d588..f457bec21 100644 --- a/src/event_model/documents/generate/__main__.py +++ b/src/event_model/documents/generate/__main__.py @@ -3,6 +3,7 @@ from event_model.documents import ALL_DOCUMENTS from event_model.documents.generate.typeddict_to_schema import typeddict_to_schema + def main(): schema_dir = Path(__file__).parent.parent.parent / "schemas" for document in ALL_DOCUMENTS: @@ -10,4 +11,4 @@ def main(): if __name__ == "__main__": - main() + main() diff --git a/src/event_model/schemas/datum.json b/src/event_model/schemas/datum.json index ac0a9999d..a85c6cf80 100644 --- a/src/event_model/schemas/datum.json +++ b/src/event_model/schemas/datum.json @@ -25,4 +25,4 @@ "resource" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/datum_page.json b/src/event_model/schemas/datum_page.json index 7d34f9882..768adb26f 100644 --- a/src/event_model/schemas/datum_page.json +++ b/src/event_model/schemas/datum_page.json @@ -37,4 +37,4 @@ "resource" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/event.json b/src/event_model/schemas/event.json index bc175b936..af2f6eff4 100644 --- a/src/event_model/schemas/event.json +++ b/src/event_model/schemas/event.json @@ -58,4 +58,4 @@ "uid" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/event_descriptor.json b/src/event_model/schemas/event_descriptor.json index 91968ef1f..e453536a6 100644 --- a/src/event_model/schemas/event_descriptor.json +++ b/src/event_model/schemas/event_descriptor.json @@ -278,4 +278,4 @@ } }, "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/event_page.json b/src/event_model/schemas/event_page.json index 7c9874275..0469c6074 100644 --- a/src/event_model/schemas/event_page.json +++ b/src/event_model/schemas/event_page.json @@ -81,4 +81,4 @@ "uid" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/resource.json b/src/event_model/schemas/resource.json index ccbb49249..1a3b6d9d1 100644 --- a/src/event_model/schemas/resource.json +++ b/src/event_model/schemas/resource.json @@ -51,4 +51,4 @@ "uid" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/run_start.json b/src/event_model/schemas/run_start.json index 852e44b14..d698d5cc7 100644 --- a/src/event_model/schemas/run_start.json +++ b/src/event_model/schemas/run_start.json @@ -357,4 +357,4 @@ } }, "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/run_stop.json b/src/event_model/schemas/run_stop.json index b0d644584..f401bcea3 100644 --- a/src/event_model/schemas/run_stop.json +++ b/src/event_model/schemas/run_stop.json @@ -63,4 +63,4 @@ } }, "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/stream_datum.json b/src/event_model/schemas/stream_datum.json index 75b53ed76..35204f6a6 100644 --- a/src/event_model/schemas/stream_datum.json +++ b/src/event_model/schemas/stream_datum.json @@ -58,4 +58,4 @@ "uid" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/src/event_model/schemas/stream_resource.json b/src/event_model/schemas/stream_resource.json index 3eb93b238..440768c30 100644 --- a/src/event_model/schemas/stream_resource.json +++ b/src/event_model/schemas/stream_resource.json @@ -42,4 +42,4 @@ "uri" ], "additionalProperties": false -} \ No newline at end of file +}