Skip to content

Commit

Permalink
Added additional check to not modify Scan properties in Scan.from_dic…
Browse files Browse the repository at this point in the history
…t if all properties already have the expected length.
  • Loading branch information
toastisme committed Feb 12, 2024
1 parent 148387c commit 59dbb39
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dxtbx/model/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 59dbb39

Please sign in to comment.