Context
Test coverage is needed for the mdx2.dxtbx_machinery module to verify edge cases and improve code maintainability.
Specific Example
The calc_U_matrix_at_phi function has a potential edge case where the base index b from phi_to_base_fraction_index() may not be properly bounded by crystal.num_scan_points. This happens when crystal.num_scan_points != scan.get_num_images(), potentially causing an out-of-bounds access when calling crystal.get_U_at_scan_point(b).
Requested Action
Generate unit tests that:
- Cover the edge case mentioned above
- Test boundary conditions for scan-varying and non-scan-varying crystals
- Validate behavior when
crystal.num_scan_points differs from scan.get_num_images()
- Improve overall test coverage for the
dxtbx_machinery module
References
Context
Test coverage is needed for the
mdx2.dxtbx_machinerymodule to verify edge cases and improve code maintainability.Specific Example
The
calc_U_matrix_at_phifunction has a potential edge case where the base indexbfromphi_to_base_fraction_index()may not be properly bounded bycrystal.num_scan_points. This happens whencrystal.num_scan_points != scan.get_num_images(), potentially causing an out-of-bounds access when callingcrystal.get_U_at_scan_point(b).Requested Action
Generate unit tests that:
crystal.num_scan_pointsdiffers fromscan.get_num_images()dxtbx_machinerymoduleReferences