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 Species validators and error messages #561

Merged
merged 2 commits into from Oct 26, 2020
Merged

Fix Species validators and error messages #561

merged 2 commits into from Oct 26, 2020

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented Oct 19, 2020

Closes #559

  • No longer use length of dummy value
  • Added code path for missing/invalid chemical symbols and validation of concentration
  • Whitespace changes for legibility

@ml-evs ml-evs added priority/medium Issue or PR with a consensus of medium priority models For issues related to the pydantic models directly labels Oct 19, 2020
@ml-evs ml-evs changed the title Fix #599 by updating validators and error message Fix Species validators and error messages Oct 19, 2020
@codecov
Copy link

codecov bot commented Oct 19, 2020

Codecov Report

Merging #561 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #561   +/-   ##
=======================================
  Coverage   91.47%   91.48%           
=======================================
  Files          62       62           
  Lines        3110     3112    +2     
=======================================
+ Hits         2845     2847    +2     
  Misses        265      265           
Flag Coverage Δ
#project 91.48% <100.00%> (+<0.01%) ⬆️
#validator 63.52% <60.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
optimade/models/structures.py 95.13% <100.00%> (+0.05%) ⬆️

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 3f84589...a09896d. Read the comment docs.

shyamd
shyamd previously approved these changes Oct 26, 2020
- No longer use length of dummy value
- Specific error message if chemical symbols are missing
@ml-evs
Copy link
Member Author

ml-evs commented Oct 26, 2020

I made a minor tweak after review, switched from using pre=True to explicitly writing an error message for the case of missing/invalid chemical symbols. Going to take execute action and merge myself... A lot of this will be reworked in #560 anyway (although not for Species)

@ml-evs ml-evs merged commit e73dc81 into master Oct 26, 2020
@ml-evs ml-evs deleted the ml-evs/fix_#559 branch October 26, 2020 19:50
@ml-evs ml-evs added the bug Something isn't working label Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working models For issues related to the pydantic models directly priority/medium Issue or PR with a consensus of medium priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spurious validation errors in Structure->Species
2 participants