Changeset 0633048 in sasview for src/sas/sasgui/perspectives/fitting/pagestate.py
- Timestamp:
- Dec 9, 2016 1:52:27 PM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 8aec639
- Parents:
- 9eb8fae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/pagestate.py
r9eb8fae r0633048 392 392 self.formfactorcombobox = 'hardsphere' 393 393 394 def param_remap_to_sasmodels_convert(self, params ):394 def param_remap_to_sasmodels_convert(self, params, is_string=False): 395 395 """ 396 396 Remaps the parameters for sasmodels conversion … … 412 412 lower[0] = False 413 413 lower[1] = numpy.nan 414 p[name] = float(value) 414 if is_string: 415 p[name] = str(value) 416 else: 417 p[name] = float(value) 415 418 p[name + ".fittable"] = bool(fittable) 416 419 p[name + ".std"] = float(uncert[1]) … … 468 471 convert.convert_model(self.formfactorcombobox, params) 469 472 if len(self.str_parameters) > 0: 470 str_p = self.param_remap_to_sasmodels_convert(self.str_parameters) 471 formfactor, str_params = convert.convert_model(formfactor, str_p) 472 else: 473 str_params = None 473 str_pars = self.param_remap_to_sasmodels_convert( 474 self.str_parameters, True) 475 formfactor, str_params = convert.convert_model( 476 self.formfactorcombobox, str_pars) 477 for key, value in str_params.iteritems(): 478 params[key] = value 474 479 475 480 # Only convert if old != new, otherwise all the same 476 481 if formfactor != self.formfactorcombobox or \ 477 482 structurefactor != self.structurecombobox: 483 # Spherical SLD number of layers changed between 3.1.2 and 4.0 484 if self.formfactorcombobox == 'SphericalSLDModel': 485 self.multi_factor += 1 478 486 self.formfactorcombobox = formfactor 479 487 self.structurecombobox = structurefactor 480 488 self.parameters = [] 481 489 self.parameters = self.param_remap_from_sasmodels_convert(params) 482 if str_params:483 self.str_parameters = \484 self.param_remap_from_sasmodels_convert(str_params)485 490 486 491 def _repr_helper(self, list, rep):
Note: See TracChangeset
for help on using the changeset viewer.