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

Build OPTIMADE fields according to supplied fields #189

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

CasperWA
Copy link
Collaborator

@CasperWA CasperWA commented Jan 9, 2021

Closes #188

The build_attributes mapper function now builds only the "desired" attributes, ensuring a new -m/--minimized-fields option for aiida-optimade init will work.
The new option builds OPTIMADE fields for all but cartesian_site_positions, species_at_sites and nsites.

Since the command will _always_ recalculate fields if already present,
this is more appropriate.
New `--minimized-fields` option for `aiida-optimade init`.
This will try to avoid calculating big-valued OPTIONAL fields.

To ensure this, all translator field methods have gotten a new
property `store` on whether the calculated field should be stored in the
`optimade` extra or not. This is to be able to calculate some fields
that depend on others (like `structure_features`), but still _only_
saving the value of `structure_features` and not the others.

Specifically for `structure_features` a post-treatment is needed to
ensure the correct features are set/unset.
Build attributes only with supplied "desired" fields.
This ensures the `-m/--minimized-fields` option for `aiida-optimade
init` works as intended.
@CasperWA CasperWA force-pushed the close_188_choose_optimade_fields branch from ecc9bf1 to 88e7654 Compare January 9, 2021 02:36
@codecov
Copy link

codecov bot commented Jan 9, 2021

Codecov Report

Merging #189 (88e7654) into develop (e13dac2) will increase coverage by 0.10%.
The diff coverage is 82.05%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #189      +/-   ##
===========================================
+ Coverage    90.51%   90.61%   +0.10%     
===========================================
  Files           30       30              
  Lines         1223     1268      +45     
===========================================
+ Hits          1107     1149      +42     
- Misses         116      119       +3     
Flag Coverage Δ
pytest 90.61% <82.05%> (+0.10%) ⬆️

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

Impacted Files Coverage Δ
aiida_optimade/cli/cmd_init.py 83.92% <50.00%> (-7.91%) ⬇️
aiida_optimade/cli/cmd_recalc.py 85.24% <50.00%> (ø)
aiida_optimade/mappers/structures.py 78.00% <65.00%> (-8.12%) ⬇️
aiida_optimade/entry_collections.py 92.82% <75.00%> (-0.93%) ⬇️
aiida_optimade/translators/entities.py 84.21% <80.00%> (-0.28%) ⬇️
aiida_optimade/translators/structures.py 89.57% <92.42%> (+5.05%) ⬆️
aiida_optimade/cli/__init__.py 100.00% <100.00%> (ø)
aiida_optimade/mappers/entries.py 96.96% <100.00%> (+0.09%) ⬆️
aiida_optimade/models/structures.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e13dac2...88e7654. Read the comment docs.

@unkcpz unkcpz self-requested a review April 27, 2022 09:20
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.

Choose which OPTIMADE fields to initialize
1 participant