Skip to content

Commit

Permalink
Only include "roi" in the config if it is not None
Browse files Browse the repository at this point in the history
The config is valid without the "roi". If the "roi" is None, we just
should not include it at all.

This helps clean up the tree view a little bit in HEXRDGUI, so that there
isn't an "roi" present when there is none.

Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
psavery committed Nov 14, 2023
1 parent f6c819d commit ed59197
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hexrd/instrument/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,13 @@ def config_dict(self, chi=0, tvec=ct.zeros_3,
columns=int(self.cols),
size=[float(self.pixel_size_row),
float(self.pixel_size_col)],
roi=roi
)
)

if roi:
# Only add roi if it is not None
det_dict['pixels']['roi'] = roi

# distortion
if self.distortion is not None:
dparams = self.distortion.params
Expand Down

0 comments on commit ed59197

Please sign in to comment.