Skip to content

Write the DIALS file format attributes on reflection tables - #67

Merged
dimitrivlachos merged 1 commit into
mainfrom
dials-hdf5
Nov 16, 2026
Merged

dimitrivlachos merged 1 commit into
mainfrom
dials-hdf5

Conversation

@dimitrivlachos

Copy link
Copy Markdown
Collaborator

This PR marks the reflection files ReflectionTable::write produces as
DIALS processed data. Since dials/dials#3255 (DIALS 3.31) the reflection
table reader refuses any .refl file whose root lacks a file_type
attribute equal to "dials_processed_data" and a file_version of 1
(check), so DIALS 3.31 could not read anything dx2 wrote, which includes
the fast-feedback-service output in the downstream pipeline. Now both
attributes are written with the types h5py gives a Python str and
int, which is what the DIALS check compares against.

Changes

  • Added write_file_format_attributes, called from
    ReflectionTable::write straight after the file is created.
  • write() warns when the target group is not of the form
    /dials/<process>/<group>, since DIALS rejects a file laid out any
    other way regardless of the attributes.
  • Added tests that reopen a written file and check each attribute's
    dataspace, type and value, and that the layout warning fires only
    when it should.

DIALS 3.31 refuses to read a reflection file whose root lacks them. Also
warn when the target group falls outside the layout the attributes
claim, since DIALS would reject that file further in.
@dimitrivlachos dimitrivlachos self-assigned this Nov 16, 2026
@dimitrivlachos
dimitrivlachos enabled auto-merge (squash) November 16, 2026 15:59

@jbeilstenedmands jbeilstenedmands left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, tested and confirmed this works 👍

@dimitrivlachos
dimitrivlachos merged commit 9f4e599 into main Nov 16, 2026
4 of 5 checks passed
@dimitrivlachos
dimitrivlachos deleted the dials-hdf5 branch November 16, 2026 16:06
dimitrivlachos added a commit to DiamondLightSource/fast-feedback-service that referenced this pull request Nov 16, 2026
Thismakes the reflection files fast-feedback-service writes
readable by DIALS 3.31. Since dials/dials#3255 02bb48d, the
DIALS reflection table reader refuses any HDF5 file whose root
lacks a `file_type` attribute equal to `"dials_processed_data"` and a
`file_version` of 1. Nothing we write carries either attribute,
so the downstream pipeline on the cluster has been held at an older DIALS
to read our `integrated.refl`; this lets it move back to the latest release.
Every C++ writer goes through dx2's `ReflectionTable::write`, which now
writes both attributes (dials/dx2#67), so that half of the fix is a submodule
bump. The stills indexer writes its own file with h5py and gets the same two
attributes by hand.

### Changes

- Bumped dx2 to 9f4e599, which brings in dials/dx2#67
  for the file format attributes.
- `ssx_index.py` writes `file_type` and `file_version` on the file
  root. h5py stores a Python `str` and `int` as a scalar
  variable-length string and a scalar int64, the types the DIALS check
  compares against and the same ones dx2 writes.
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