Skip to content
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

Support DLite #109

Merged
merged 17 commits into from
Mar 30, 2023
Merged

Support DLite #109

merged 17 commits into from
Mar 30, 2023

Conversation

CasperWA
Copy link
Collaborator

Closes #31

Implement support for DLite with a custom parse strategy and an extension of the existing resource strategy.
To use the resource strategy with DLite, simply add +dlite or +DLite to the accessService. One can also set configuration.use_dlite to True.

The custom parse strategy uses +dlite and +DLite instead of +json or +JSON in the mediaType.

Some simple tests have been added to ensure a DLite Collection object is created under the right circumstances.
A more in-depth test should be performed to check the parsed structure objects, however, the current tests are enough to test no errors occur during parsing and creation of DLite Instances for each OPTIMADE structure entry.

@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2023

Codecov Report

Merging #109 (26e7860) into main (3ccbca3) will increase coverage by 3.24%.
The diff coverage is 75.22%.

@@            Coverage Diff             @@
##             main     #109      +/-   ##
==========================================
+ Coverage   72.95%   76.19%   +3.24%     
==========================================
  Files          14       15       +1     
  Lines         514      605      +91     
==========================================
+ Hits          375      461      +86     
- Misses        139      144       +5     
Flag Coverage Δ
linux 76.19% <75.22%> (+3.24%) ⬆️
windows 82.50% <73.91%> (+0.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
oteapi_optimade/models/__init__.py 100.00% <ø> (ø)
oteapi_optimade/models/custom_types.py 77.29% <ø> (+4.47%) ⬆️
oteapi_optimade/strategies/filter.py 0.00% <ø> (ø)
oteapi_optimade/strategies/parse.py 72.05% <ø> (+9.20%) ⬆️
oteapi_optimade/utils.py 88.88% <ø> (+3.88%) ⬆️
oteapi_optimade/dlite/parse.py 72.09% <72.09%> (ø)
oteapi_optimade/strategies/resource.py 79.00% <80.95%> (+1.89%) ⬆️
oteapi_optimade/exceptions.py 100.00% <100.00%> (ø)
oteapi_optimade/models/config.py 90.90% <100.00%> (+0.43%) ⬆️
oteapi_optimade/models/strategies/__init__.py 100.00% <100.00%> (ø)
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jesper-friis
Copy link
Contributor

Trying to install oteapi-optimade results in the following dependency conflict

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
docker-compose 1.29.2 requires PyYAML<6,>=3.10, but you have pyyaml 6.0 which is incompatible.

Copy link

@quaat quaat left a comment

Choose a reason for hiding this comment

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

We should follow up on the comments regarding RFC2045. We should also consider registering the media types related to optimade. The procedures for registering media types can be found in [RFC6838], [RFC4289],
and [RFC6657].

oteapi_optimade/dlite/parse.py Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@CasperWA
Copy link
Collaborator Author

Trying to install oteapi-optimade results in the following dependency conflict

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
docker-compose 1.29.2 requires PyYAML<6,>=3.10, but you have pyyaml 6.0 which is incompatible.

docker-compose is not a dependency of this repository. As the CI jobs install the package and run fine, this seems to be a local problem for you. Please run in a closed environment when testing, e.g., a virtual environment or Docker.

@CasperWA CasperWA merged commit efbe464 into main Mar 30, 2023
@CasperWA CasperWA deleted the cwa/close-31-support-dlite branch March 30, 2023 20:05
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.

Implement support for DLite
4 participants