From 59dbb390c46cafa9107c1b75b3d21085078b996b Mon Sep 17 00:00:00 2001 From: davidmcdonagh Date: Mon, 12 Feb 2024 14:37:18 +0000 Subject: [PATCH] Added additional check to not modify Scan properties in Scan.from_dict if all properties already have the expected length. --- src/dxtbx/model/scan.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dxtbx/model/scan.py b/src/dxtbx/model/scan.py index fe6c4f527..e63f2b025 100644 --- a/src/dxtbx/model/scan.py +++ b/src/dxtbx/model/scan.py @@ -155,6 +155,13 @@ def make_properties_table_consistent(properties, num_images): if not properties: return properties + property_length = len(next(iter(properties.values()))) + all_same_length = all( + len(lst) == property_length for lst in properties.values() + ) + if all_same_length and property_length == num_images: + return properties + if "oscillation" in properties: assert len(properties["oscillation"]) > 0