WriteReflections had no test at all, and the defect it hid was invisible to two
of the three libraries that read an MTZ: with the data dataset written at id 0 -
the id reserved for HKL_base - gemmi and iotbx still returned the real
wavelength, and only CCP4's mtzinfo fell back to the 1.54187 A Cu K-alpha
default. iotbx reading such a file reports two datasets both numbered 0.
The test writes a merged MTZ through the real writer at a wavelength well away
from that default, reads the file back, and asserts the layout the report
depends on: HKL_base at id 0, the data dataset at id 1 carrying the wavelength,
and every data column owned by the data dataset rather than the base - that
ownership is what the reported wavelength is read off. Cell and space group are
checked with it, since they travel in the same header.
Verified against the pre-fix writer (base absent, H K L added on the data
dataset): it fails on the dataset count.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N