Skip to content

Commit 84e3aaa

Browse files
authored
Merge pull request #1910 from HEXRD/copy-memoize-output
Do not allow memoized median output to be modified
2 parents a10a15f + 7af78df commit 84e3aaa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hexrdgui/hexrd_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,10 +971,12 @@ def intensity_corrected_images_dict(self):
971971
# (such as polar or stereo)
972972
if HexrdConfig().apply_median_filter_correction:
973973
for name, img in images_dict.items():
974+
# Since this is memoized, make a copy so we won't modify
975+
# the original.
974976
images_dict[name] = medfilt2d_memoized(
975977
img,
976978
kernel_size=HexrdConfig().median_filter_kernel_size
977-
)
979+
).copy()
978980

979981
# Create this corrections dict, even if we don't use it, because
980982
# it updates the `intensity_corrections_dict` that may be used

0 commit comments

Comments
 (0)