Avoid reading h5 imagesets as having a single image, when a format class is not available.#825
Merged
jbeilstenedmands merged 5 commits intomainfrom Jun 3, 2025
Merged
Conversation
…ass is not available
dagewa
reviewed
Jun 2, 2025
dagewa
approved these changes
Jun 2, 2025
Member
There was a problem hiding this comment.
The original function is a bit messy - it has specific behaviour according to whether the string "master" is in the template, which is surely fragile, and implies this special case is only intended for *_master.h5-style DECTRIS data. There are other image stack types, like MRC files, and I suppose for those other stack types we'd also want to create FormatMultiImage.
However, I think fixing all that would require rather more invasive changes. I'm satisfied that this is a reasonable fix for dials/dials#2944, and it seems that errors like that are rare in practice.
aaronfinke
pushed a commit
to aaronfinke/dxtbx
that referenced
this pull request
Oct 7, 2025
…ass is not available. (cctbx#825) In order to make sure the xds.to_imageset function returns an imageset of the correct length for h5 image files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attempt to fix an issue described in dials/dials#2944
I will try to create a minimal reproducer of the issue, but my basic understanding of the underlying cause is that these parts of the code should not always be defaulting to use
Formatwhen the true format class is not known (as we can't pass an image range to set up the 'Reader' correctly). That is appropriate for a e.g. cbf template but not data from a master.h5. Rather we need aFormatMultiImagein these cases. This kind of pattern seems to happen in other functions in this file, and I guess it is not a common code path for imageset creation as we usually know the format.The dxtbx tests and dials command line tests all seem to pass still.