Skip to content

Commit f0afffd

Browse files
authored
Merge pull request #185 from AdvancedPhotonSource/fix_bkg_save
Remove np.float from saved background files
2 parents 153249b + def95b7 commit f0afffd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

GSASII/GSASIIpwdGUI.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,13 @@ def OnBackSave(event):
16441644
filename = os.path.splitext(filename)[0]+'.pwdrbck'
16451645
File = open(filename,'w')
16461646
File.write("#GSAS-II background parameter file; do not add/delete items!\n")
1647-
File.write(str(data[0])+'\n')
1647+
out_tmp = list()
1648+
for item in data[0]:
1649+
if isinstance(item, np.float64) or isinstance(item, float):
1650+
out_tmp.append(float(item))
1651+
else:
1652+
out_tmp.append(item)
1653+
File.write(str(out_tmp)+'\n')
16481654
for item in data[1]:
16491655
if item in ['nPeaks','background PWDR','nDebye'] or not len(data[1][item]):
16501656
File.write(item+':'+str(data[1][item])+'\n')

0 commit comments

Comments
 (0)