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

Introduce 'aiida-optimade calc' CLI command #151

Merged
merged 2 commits into from
Nov 6, 2020

Conversation

CasperWA
Copy link
Collaborator

@CasperWA CasperWA commented Nov 6, 2020

Closes #150.

The 'calc' command takes in multiple field values, example:

aiida-optimade calc elements species

In this example the fields elements and species will be removed from all Nodes where it exists in the optimade Extra.
Then the _check_and_calculate_entities() method of the AiidaCollection class will be run with relevant fields set.
This will run the mapper, which will update only the missing fields for all the Nodes.

@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #151 into develop will decrease coverage by 0.54%.
The diff coverage is 81.81%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #151      +/-   ##
===========================================
- Coverage    90.69%   90.15%   -0.55%     
===========================================
  Files           27       28       +1     
  Lines         1010     1056      +46     
===========================================
+ Hits           916      952      +36     
- Misses          94      104      +10     
Flag Coverage Δ
pytest 90.15% <81.81%> (-0.55%) ⬇️

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

Impacted Files Coverage Δ
aiida_optimade/cli/cmd_run.py 70.96% <ø> (ø)
aiida_optimade/entry_collections.py 92.89% <ø> (ø)
aiida_optimade/cli/cmd_calc.py 78.72% <78.72%> (ø)
aiida_optimade/cli/__init__.py 100.00% <100.00%> (ø)
aiida_optimade/main.py 100.00% <100.00%> (ø)
aiida_optimade/mappers/structures.py 94.44% <100.00%> (-0.16%) ⬇️

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 f92ff78...6a2ee7d. Read the comment docs.

The 'calc' command takes in multiple field values, example:

  aiida-optimade calc elements species

In this example the fields `elements` and `species` will be removed from
all Nodes where it exists in the `optimade` Extra.
Then the `_check_and_calculate_entities()` method of the
`AiidaCollection` class will be run with relevant fields set.
This will run the mapper, which will update _only_ the missing fields
for all the Nodes.

Add tests for aiida-optimade calc.

Update some tests for aiida-optimade run according to the new uvicorn
handling of `log-level`.

Add deletion statements of Nodes in memory.
This seems to be an issue especially for the SQLAlchemy backend.
Be more verbose in pytest run.
@CasperWA CasperWA force-pushed the close_150_picky-recalculation branch from a1fb4ef to 6a2ee7d Compare November 6, 2020 03:30
@CasperWA CasperWA merged commit 7f8dd44 into develop Nov 6, 2020
@CasperWA CasperWA deleted the close_150_picky-recalculation branch November 6, 2020 03:41
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.

Recalculate specific fields only
1 participant