Skip to content

add batching for mtz files#345

Open
kmdalton wants to merge 2 commits into
mainfrom
batches
Open

add batching for mtz files#345
kmdalton wants to merge 2 commits into
mainfrom
batches

Conversation

@kmdalton

@kmdalton kmdalton commented Jun 17, 2026

Copy link
Copy Markdown
Member

This attempts to address #344 to enable batching with dataset.write_mtz. I could use some eyes on this control flow.

This changes the signature for rs.DataSet.write_mtz adding batch=True and batch_key=None options. write_mtz will generate a naive set of batches in the header if batch is truthy. batch_key will be inferred and is only explicitly needed of there are multiple columns with BATCH dtype. batch=False and batch_key is not None will raise a ValueError.

@kmdalton
kmdalton requested a review from JBGreisman June 17, 2026 00:55
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.84%. Comparing base (d65b8ee) to head (91b921d).

Files with missing lines Patch % Lines
reciprocalspaceship/io/mtz.py 84.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #345      +/-   ##
==========================================
- Coverage   86.86%   86.84%   -0.03%     
==========================================
  Files          40       40              
  Lines        2856     2881      +25     
==========================================
+ Hits         2481     2502      +21     
- Misses        375      379       +4     
Flag Coverage Δ
unittests 86.84% <84.00%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JBGreisman

Copy link
Copy Markdown
Member

Overall, this looks good to me. I still want to test it out a bit more before fully approving the change. Just wanted to confirm two things first:

  1. Are these read properly by aimless?
  2. Are these read by phenix in methods such as the table 1 generator, etc that take unmerged data?

@kmdalton

Copy link
Copy Markdown
Member Author

Overall, this looks good to me. I still want to test it out a bit more before fully approving the change. Just wanted to confirm two things first:

1. Are these read properly by aimless?

2. Are these read by phenix in methods such as the table 1 generator, etc that take unmerged data?

Valid concerns. I agree we should confirm before merging.

@JBGreisman JBGreisman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks fine to me -- I think we should just confirm it behaves with phenix / aimless before merging.

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.

2 participants