Skip to content

Commit 0590fed

Browse files
committed
Code review: ask for errors to be reported to help find exotic Eigers quickly
1 parent bf179e2 commit 0590fed

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/dxtbx/format/FormatNXmxEigerFilewriter.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
from dxtbx.format.FormatNXmx import FormatNXmx
1111
from dxtbx.nexus import _dataset_as_flex, get_detector_module_slices
12+
from dxtbx.setup import setup_kwargs
13+
14+
author_email = setup_kwargs["author_email"]
1215

1316
DATA_FILE_RE = re.compile(r"data_\d{6}")
1417

@@ -67,7 +70,12 @@ def _get_nxmx(self, fh: h5py.File):
6770
module.data_size = module.data_size[::-1]
6871

6972
# Fail if we find an unknown Eiger module size
70-
assert tuple(module.data_size) in KNOWN_MODULE_SLOW_FAST_DIMS
73+
try:
74+
assert tuple(module.data_size) in KNOWN_MODULE_SLOW_FAST_DIMS
75+
except AssertionError:
76+
raise ValueError(
77+
f"Unknown Eiger module size: {module.data_size}, please report to {author_email}"
78+
)
7179

7280
return nxmx_obj
7381

0 commit comments

Comments
 (0)