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

Scan from dict fix #693

Merged
merged 8 commits into from
Feb 20, 2024
Merged

Scan from dict fix #693

merged 8 commits into from
Feb 20, 2024

Conversation

toastisme
Copy link
Contributor

This fixes three bugs:

  • Properties were not properly added to a properties dictionary in ScanFactory.from_dict before being passed to Scan.from_dict
  • oscillation_width was not correctly converted to radians in Scan.to_dict when dealing with Scans with only one image
  • Properties were being needlessly recreated when all properties already have the correct length. When a properties table is made from historical values that have different lengths (e.g. a single epoch but multiple exposure times), assumptions are made about epochs and exposure_time, which might give different values to historical data.

The first two are tested in test_scan_properties_from_dict. The third was picked up in test_experimentlist_dumper_dump_formats and test_experimentlist_dumper_dump_scan_varying.

Copy link
Member

@dagewa dagewa left a comment

Choose a reason for hiding this comment

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

Thanks, can confirm this fixes the re-opened dials/dials#2606. I have not considered other aspects in this review

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: 19 lines in your changes are missing coverage. Please review.

Comparison is base (39e463e) 42.40% compared to head (ceaae2f) 42.44%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #693      +/-   ##
==========================================
+ Coverage   42.40%   42.44%   +0.03%     
==========================================
  Files         186      186              
  Lines       16358    16408      +50     
  Branches     3121     3141      +20     
==========================================
+ Hits         6937     6964      +27     
- Misses       8789     8805      +16     
- Partials      632      639       +7     

@toastisme toastisme merged commit e684c41 into cctbx:main Feb 20, 2024
13 checks passed
@toastisme toastisme deleted the scan_from_dict_fix branch February 20, 2024 11:26
toastisme added a commit to toastisme/dxtbx that referenced this pull request Jul 18, 2024
* Fixed bug in `Scan.from_dict` where some properties were not correctly parsed.
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.

4 participants