From 5206136745edb244aec1752ec568202498dacd4f Mon Sep 17 00:00:00 2001 From: Graeme Winter Date: Fri, 21 Nov 2025 12:06:12 -0600 Subject: [PATCH 1/2] Work around missing dependencies in FormatNXmxEigerFilewriter Make assumptions that the fast depends on the slow which depends on module offset, and none of these add rotations into the mix (fair, for a DECTRIS detector) Resolves #865 --- newsfragments/XXX.bugfix | 1 + src/dxtbx/nexus/__init__.py | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 newsfragments/XXX.bugfix diff --git a/newsfragments/XXX.bugfix b/newsfragments/XXX.bugfix new file mode 100644 index 000000000..f676107ab --- /dev/null +++ b/newsfragments/XXX.bugfix @@ -0,0 +1 @@ +``FormatNXmxEigerFilewriter``: if dependencies missing, make some (prpbably valid) assumptions about dependencies between fast, slow pixel directions and module offset diff --git a/src/dxtbx/nexus/__init__.py b/src/dxtbx/nexus/__init__.py index 8dc71d88c..b760ef421 100644 --- a/src/dxtbx/nexus/__init__.py +++ b/src/dxtbx/nexus/__init__.py @@ -357,7 +357,7 @@ def equipment_component_key(dependency): # Flat detector model # Apply any rotation components of the dependency chain to the fast axis - assert module.fast_pixel_direction.depends_on is not None + # assert module.fast_pixel_direction.depends_on is not None fast_axis_depends_on = [ t for t in nxmx.get_dependency_chain( @@ -372,7 +372,7 @@ def equipment_component_key(dependency): fast_axis = MCSTAS_TO_IMGCIF @ R @ module.fast_pixel_direction.vector # Apply any rotation components of the dependency chain to the slow axis - assert module.slow_pixel_direction.depends_on is not None + # assert module.slow_pixel_direction.depends_on is not None slow_axis_depends_on = [ t for t in nxmx.get_dependency_chain( @@ -388,9 +388,11 @@ def equipment_component_key(dependency): # Apply all components of the dependency chain to the module offset to get the # dxtbx panel origin - dependency_chain = nxmx.get_dependency_chain( - module.fast_pixel_direction.depends_on - ) + if module.fast_pixel_direction.depends_on is not None: + top = module.fast_pixel_direction.depends_on + else: + top = module.module_offset.depends_on + dependency_chain = nxmx.get_dependency_chain(top) A = nxmx.get_cumulative_transformation(dependency_chain) origin = MCSTAS_TO_IMGCIF @ ( From 1abd8e75498e6c03f1551eacec91cdca54d0ba6d Mon Sep 17 00:00:00 2001 From: DiamondLightSource-build-server Date: Fri, 21 Nov 2025 18:07:32 +0000 Subject: [PATCH 2/2] Rename newsfragments/XXX.bugfix to newsfragments/866.bugfix --- newsfragments/{XXX.bugfix => 866.bugfix} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename newsfragments/{XXX.bugfix => 866.bugfix} (100%) diff --git a/newsfragments/XXX.bugfix b/newsfragments/866.bugfix similarity index 100% rename from newsfragments/XXX.bugfix rename to newsfragments/866.bugfix