Skip to content

Commit

Permalink
initial run of ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Oct 18, 2024
1 parent 89fd82d commit 9390bf2
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 20 deletions.
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@
"sphinx_copybutton",
# For the card element
"sphinx_design",
"sphinx_design",
"sphinx_design",
"sphinx.ext.autosummary",
"sphinx.ext.mathjax",
"sphinx.ext.githubpages",
"matplotlib.sphinxext.plot_directive",
"sphinx_copybutton",
"IPython.sphinxext.ipython_directive",
"IPython.sphinxext.ipython_console_highlighting",

# So we can write markdown files
"myst_parser",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ We will use the
Consequences
------------

CI workflows will change, even jobs providing the same feature as the older checks.
CI workflows will change, even jobs providing the same feature as the older checks.
2 changes: 1 addition & 1 deletion docs/images/document-generation-timeline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
"""

Expand Down
5 changes: 3 additions & 2 deletions src/event_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/event_model/documents/generate/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
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:
typeddict_to_schema(document, schema_dir)


if __name__ == "__main__":
main()
main()
2 changes: 1 addition & 1 deletion src/event_model/schemas/datum.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"resource"
],
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/datum_page.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
"resource"
],
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/event.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
"uid"
],
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/event_descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,4 @@
}
},
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/event_page.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@
"uid"
],
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
"uid"
],
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/run_start.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,4 @@
}
},
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/run_stop.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
}
},
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/stream_datum.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
"uid"
],
"additionalProperties": false
}
}
2 changes: 1 addition & 1 deletion src/event_model/schemas/stream_resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
"uri"
],
"additionalProperties": false
}
}

0 comments on commit 9390bf2

Please sign in to comment.