Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parameters[p.name] = NXfield(p.value, error=p.stderr,
initial_value=p.init_value,
min=str(p.min), max=str(p.max))
group[f.name].insert(parameters)
if self.fit is not None:
group['program'] = 'lmfit'
group['version'] = lmfit.__version__
group['title'] = 'Fit Results'
group['fit'] = self.get_model()
fit = NXparameters()
fit.nfev = self.fit.result.nfev
fit.chisq = self.fit.result.chisqr
fit.redchi = self.fit.result.redchi
fit.message = self.fit.result.message
group['statistics'] = fit
group.note = NXnote(self.fit.result.message,
('Chi^2 = %s\n' % self.fit.result.chisqr +
'Reduced Chi^2 = %s\n' % self.fit.result.redchi +
'No. of Function Evaluations = %s\n' % self.fit.result.nfev +
'No. of Variables = %s\n' % self.fit.result.nvarys +
'No. of Data Points = %s\n' % self.fit.result.ndata +
'No. of Degrees of Freedom = %s\n' % self.fit.result.nfree +
'%s' % self.fit.fit_report()))
else:
group['title'] = 'Fit Model'
group['model'] = self.get_model()
if 'w0' not in self.tree:
self.tree['w0'] = nxload(self.mainwindow.scratch_file, 'rw')
ind = []
for key in self.tree['w0']:
try: