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

Fix manual verification of elements_ratios #76

Merged

Conversation

CasperWA
Copy link
Member

@CasperWA CasperWA commented Nov 8, 2019

I had some issues regarding validation of elements_ratios and found out that an equal sign was all that was missing for the comparison against EPS.

Also, add the valid None or null as response with single datum (StructureResponseOne), if it cannot be found, in accordance with the OPTiMaDe spec.

Also, add the valid None as response with single datum
(StructureResponseOne).
@codecov
Copy link

codecov bot commented Nov 8, 2019

Codecov Report

Merging #76 into master will decrease coverage by 0.05%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
- Coverage   85.71%   85.66%   -0.06%     
==========================================
  Files          30       30              
  Lines        1323     1325       +2     
==========================================
+ Hits         1134     1135       +1     
- Misses        189      190       +1
Impacted Files Coverage Δ
optimade/models/structures.py 87.25% <ø> (ø) ⬆️
optimade/models/toplevel.py 100% <100%> (ø) ⬆️
optimade/server/entry_collections.py 81.96% <75%> (-0.54%) ⬇️

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 bb42c6e...534cb70. Read the comment docs.

Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

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

LGTM!

Can we make one extra change?

Now that the single entry endpoint can return None when there are no results, can we change the linked line below to if data_available > 1? This suppresses an error on my server when querying a non-existent structure.

https://github.com/CasperWA/optimade-python-tools/blob/9f2689ff3d67b0e8407c24b0cd3e49ae4116bde8/optimade/server/entry_collections.py#L109

@ml-evs
Copy link
Member

ml-evs commented Nov 8, 2019

LGTM!

Can we make one extra change?

Now that the single entry endpoint can return None when there are no results, can we change the linked line below to if data_available > 1? This suppresses an error on my server when querying a non-existent structure.

https://github.com/CasperWA/optimade-python-tools/blob/9f2689ff3d67b0e8407c24b0cd3e49ae4116bde8/optimade/server/entry_collections.py#L109

Couple of extra lines needed changing too so I did it myself.

ml-evs
ml-evs previously approved these changes Nov 8, 2019
Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

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

Check my changes and merge when you're happy

ml-evs
ml-evs previously approved these changes Nov 8, 2019
@CasperWA
Copy link
Member Author

CasperWA commented Nov 8, 2019

Thanks @ml-evs - and yeah, I have made several of those changes in my own server as well, simply forgot to add them here.
Please review and accept if you are all for it, then I'll merge :)

@CasperWA CasperWA requested a review from ml-evs November 8, 2019 16:27
@CasperWA CasperWA merged commit 5efec23 into Materials-Consortia:master Nov 8, 2019
@CasperWA CasperWA deleted the fix_structures_elements_ratios branch November 8, 2019 16:28
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.

None yet

2 participants