Skip to content

Conversation

@CasperWA
Copy link
Collaborator

@CasperWA CasperWA commented Jul 3, 2024

Similar to #20, but targeting develop.

Finalization:

  • Create "negative" tests for the DataSource factory

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).
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.
@CasperWA
Copy link
Collaborator Author

CasperWA commented Jul 4, 2024

According to this run the updates provided by EMMC-ASBL/oteapi-core#496 indeed fixes the previous issue found for pytests with Python 3.12.

@CasperWA CasperWA marked this pull request as ready for review July 5, 2024 12:54
@CasperWA CasperWA requested review from Treesarj and quaat July 5, 2024 12:54
@CasperWA CasperWA mentioned this pull request Jul 5, 2024
4 tasks
@CasperWA CasperWA marked this pull request as draft July 5, 2024 14:07
CasperWA added 4 commits July 5, 2024 16:09
Cacheing currently happens in two places/levels:
- For the OTEAPI pipeline.
- For each of the attributes retrieved in a DataSource instance.
Treesarj
Treesarj previously approved these changes Jul 9, 2024
CasperWA and others added 8 commits July 9, 2024 14:04
Ensure Literal is importable for all supported Python versions
Finalize all "negative" tests as well for the function.
Reorganize code to utilize existing utility functions and functionality.
Update parse_input_entity() as well as tests.
Missing updating parse_input_configs() as well as tests.
@CasperWA CasperWA marked this pull request as ready for review July 10, 2024 21:02
Copy link
Collaborator

@Treesarj Treesarj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@CasperWA CasperWA merged commit 42cac30 into develop Jul 11, 2024
@CasperWA CasperWA deleted the cwa/develop/soft7-instance-factory branch July 11, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants