Upgrade to dev
core versions
#316
Open
+1,195
−1,130
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.
Description:
Along with the summary by Copilot, I can add that I have collected test functions that were split between different test files into a single file that represent tests for the given strategy.
Furthermore, for the tests, I have tried to keep the intent of storing output locally, while making use of pytest fixtures properly and have better test isolation. The latter is achieved by wrapping "raw" script test code in test functions.
Important changes
The settings strategy functions very slightly different due to the new way session objects are handled in a pipeline.
The way it works now is when a pipeline is executed, the
configuration
key in a configuration is updated with all fields that exist currently in the session object. The session object only exists on the side of the OTEAPI service (or locally as adict
when using the"python"
OTEClient
).So, to make this work as intended, the settings strategy still has a
settings
field, but it will result in adlite_settings
field in the session, and thereby adlite_settings
field in other strategies that rely on these settings.This new
dlite_settings
fields has been added to the newDliteConfiguration
model, which all strategy-specific configurations that relied on this feature are now based on (except the settings configuration, naturally).Otherwise, the strategy-specific configurations are based on
DliteResult
, which is a small model that just includes thecollection_id
field.Summary by Copilot
This pull request includes significant changes to the
oteapi_dlite
package, focusing on refactoring data models and strategies to improve consistency and functionality. The most important changes include the introduction of new data models, the replacement ofDLiteSessionUpdate
withDLiteResult
, and updates to various strategy classes to use these new models.Data Model Refactoring:
DLiteResult
andDLiteConfiguration
data models inoteapi_dlite/models.py
, which are now used across various strategies for returning values and configurations. (oteapi_dlite/models.py
- oteapi_dlite/models.pyR1-R35)Strategy Class Updates:
DLiteSessionUpdate
withDLiteResult
inDLiteConvertStrategy
,DLiteFilterStrategy
,DLiteGenerateStrategy
, andDLiteMappingStrategy
to standardize result handling. (oteapi_dlite/strategies/convert.py
- [1] [2] [3] [4];oteapi_dlite/strategies/filter.py
- [5] [6] [7] [8];oteapi_dlite/strategies/generate.py
- [9] [10] [11] [12] [13] [14] [15] [16];oteapi_dlite/strategies/mapping.py
- [17] [18] [19]Documentation Updates:
docs/api_reference/models.md
,docs/api_reference/models/.pages
, anddocs/api_reference/models/session.md
. (docs/api_reference/models.md
- [1];docs/api_reference/models/.pages
- [2];docs/api_reference/models/session.md
- [3]Code Cleanup:
DLiteSessionUpdate
class and its references from the codebase. (oteapi_dlite/models/session.py
- [1];oteapi_dlite/models/__init__.py
- [2]These changes enhance the consistency and maintainability of the
oteapi_dlite
package by standardizing data models and simplifying strategy implementations.Type of change:
Checklist for the reviewer:
This checklist should be used as a help for the reviewer.