-
Notifications
You must be signed in to change notification settings - Fork 0
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
Entity factory and cleanup #21
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update the DataSource factory - should be a SOFT7Instance factory instead with proper validation of property metadata and more.
Add pytest and pytest-cov dependencies, along with a new `testing` installable extra.
Remove tests for the now re-written SOFT7EntityPropertyType (previously an Enum, now just a Literal collection with an associated mapping).
Satisfy mypy
Also, rename create_entity() to create_datasource(). Ensure the create_datasource() function returns an instantiated model.
This can now be used in both the SOFT7DataSource model as well as the new DataSourceDimensions model. Add `requests-mock` dependency. Consider using "python" backend for OTELib instead to avoid mocking requests. Remove all filterwarnings from pytest config.
New test using python otelib backend.
Added test for serializing
All the serialization tests (including JSON Schema) must be extended to ensure not just that it _can_ be serialized, but that the content is also what would be expected.
Implemented as a pydantic model_serializer in "wrap" mode. Temporarily changed the otelib dependency to point to a git branch on GitHub that implements migration to pydantic v2.
Make the namespace an AnyUrl.
Quick (but proper) solutions to ever so slightly decrease the number of uncovered lines.
Specifically, move all the "helper"/utility functionalities from `datasource_factory.py` to a new `soft7_instance.py` under pydantic_models.
Run hooks on all files, upgrading them accordingly.
Make factory functions importable from `s7.factories` as `create_*`, where * matches the name of any `*_factory.py` file in the folder.
Split ruff hook for core code base code and non-core.
Started to flesh out an OTEAPI function strategy plugin for converting between a parsed data source to a SOFT7 Entity instance.
Missing finalizing example in notebook.
There is a design issue here with nested entities that should be fixable in a more elegant way
Need to fix setting ClassVar on EntityInstance and the validator for the same.
Add a YAML parse strategy for OTEAPI.
See issue #395 in oteapi-core to follow up on when this ignore statement can be removed.
Focus on: - the entity_instance factory - the OTEAPI plugins - the pydantic models
These should be removed when supporting Python 3.10+. Pydantic does not support new-style type notation in Python 3.9.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
=======================================
Coverage ? 46.04%
=======================================
Files ? 11
Lines ? 682
Branches ? 0
=======================================
Hits ? 314
Misses ? 368
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Update pre-commit hooks
Update GH Actions. Update ruff rules.
Finalize update to Python 3.10
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #20 a lot of work has been done, but one of the crucial additions is the entity factory.
This PR essentially takes that addition and then also removes everything not actively used or that's very outdated from the repository.