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

Fixed read_precognition() as per #135 and updated tests #136

Merged
merged 4 commits into from
Mar 14, 2022
Merged

Conversation

dennisbrookner
Copy link
Contributor

Accomplished all of the changes mentioned in #135 . Two outstanding thoughts:

  • Though I did clarify in the docs that .ii files are allowed, I didn't want to change the name of the hklfile argument for fear of breaking backwards compatibility. That said, I know this function hasn't really seen a lot of daylight, so I'm happy to be overruled there.
  • I added a ValueError for when a cell argument is provided but doesn't have length 6. Previously, the function checked for this length, but then just silently ignored an argument with the wrong length. I didn't add a test for this behavior, thinking that was overkill, but I could add that if desired.

Also, as best I can tell, this is the first "warning" in reciprocalspaceship. If some mechanism other than the built-in warnings module is preferable, let me know.

@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2022

Codecov Report

Merging #136 (ea26024) into main (aca17c9) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #136   +/-   ##
=======================================
  Coverage   98.67%   98.67%           
=======================================
  Files          41       41           
  Lines        1583     1590    +7     
=======================================
+ Hits         1562     1569    +7     
  Misses         21       21           
Flag Coverage Δ
unittests 98.67% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
reciprocalspaceship/io/precognition.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 aca17c9...ea26024. Read the comment docs.

@kmdalton
Copy link
Member

Jack will reply later, but imo type checks should live in the cellify decorator which is called by the setter.

@dennisbrookner
Copy link
Contributor Author

Jack will reply later, but imo type checks should live in the cellify decorator which is called by the setter.

Yeah, Jack slacked me about this as well. Makes sense, I'll take that out.

Copy link
Member

@JBGreisman JBGreisman left a comment

Choose a reason for hiding this comment

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

This looks good to me -- thanks for the PR!

@JBGreisman
Copy link
Member

As mentioned above, the setter methods for DataSet.cell and DataSet.spacegroup implicitly handle all the type checking and coercion to gemmi objects. These use the @spacegroupify and @cellify decorators to ensure that all the relevant type-checking is handled in one place. This change was made in #94.

As such, this looks good -- when the DataSet attributes are set any necessary checks/conversion to gemmi objects will be done.

@JBGreisman JBGreisman merged commit 171826a into main Mar 14, 2022
@JBGreisman JBGreisman deleted the precog branch March 14, 2022 00:04
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.

rs.read_precognition(): Update docstring and set spacegroup after parsing log
4 participants