Skip to content

Commit a8a7d47

Browse files
authored
Merge pull request #1907 from HEXRD/wppf-params-basic-only
Don't save numpy types in WPPF parameters
2 parents 19d724b + 217951e commit a8a7d47

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

hexrdgui/calibration/wppf_options_dialog.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,13 +1642,21 @@ def generate_params(method, materials, peak_shape, bkgmethod, amorphous_model):
16421642

16431643

16441644
def param_to_dict(param):
1645-
return {
1645+
# Make sure these are non-numpy types
1646+
def _dict_to_basic(d):
1647+
for k, v in list(d.items()):
1648+
if isinstance(v, np.generic):
1649+
d[k] = v.item()
1650+
1651+
return d
1652+
1653+
return _dict_to_basic({
16461654
'name': param.name,
16471655
'value': param.value,
16481656
'min': param.min,
16491657
'max': param.max,
16501658
'vary': param.vary,
1651-
}
1659+
})
16521660

16531661

16541662
def dict_to_param(d):

0 commit comments

Comments
 (0)