Skip to content

Commit 7e6bf3d

Browse files
psaveryZackAttack614
authored andcommitted
Allow skipped subpanels in fit-grains
This allows subpanels to be skipped in the fitting method. This happens if there is no HEDM signal on a particular subpanel. It prevents an error like the following: ```python File ".../hexrd/hedm/fitting/grains.py", line 251, in objFuncFitGrain     results = reflections_dict[det_key]               ~~~~~~~~~~~~~~~~^^^^^^^^^ KeyError: 'eiger_0_0' ``` Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
1 parent 34dab3e commit 7e6bf3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hexrd/hedm/fitting/grains.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def objFuncFitGrain(
248248
instrument.detector_parameters[det_key]
249249
)
250250

251-
results = reflections_dict[det_key]
251+
results = reflections_dict.get(det_key, [])
252252
if not isinstance(results, dict) and len(results) == 0:
253253
continue
254254

0 commit comments

Comments
 (0)