Changes in / [840ac87:912e645] in sasview
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
run.py
r3388337 rbc8b8a1 67 67 68 68 69 def prepare( rebuild=True):69 def prepare(): 70 70 # Don't create *.pyc files 71 71 sys.dont_write_bytecode = True … … 113 113 # Build project if the build directory does not already exist. 114 114 # PAK: with "update" we can always build since it is fast 115 if rebuildor not os.path.exists(build_path):115 if True or not os.path.exists(build_path): 116 116 import subprocess 117 117 build_cmd = [sys.executable, "setup.py", "build", "update"] -
src/sas/sascalc/fit/BumpsFitting.py
r0aeba4e r1386b2f 2 2 BumpsFitting module runs the bumps optimizer. 3 3 """ 4 from __future__ import print_function5 6 4 import os 7 5 from datetime import timedelta, datetime … … 11 9 12 10 from bumps import fitters 13 14 11 try: 15 12 from bumps.options import FIT_CONFIG 16 # Preserve bumps default fitter in case someone wants it later17 BUMPS_DEFAULT_FITTER = FIT_CONFIG.selected_id18 13 # Default bumps to use the Levenberg-Marquardt optimizer 19 14 FIT_CONFIG.selected_id = fitters.LevenbergMarquardtFit.id … … 22 17 except ImportError: 23 18 # CRUFT: Bumps changed its handling of fit options around 0.7.5.6 24 # Preserve bumps default fitter in case someone wants it later25 BUMPS_DEFAULT_FITTER = fitters.FIT_DEFAULT26 19 # Default bumps to use the Levenberg-Marquardt optimizer 27 20 fitters.FIT_DEFAULT = 'lm' … … 133 126 if initial_values is not None: 134 127 self._reset_pars(fitted, initial_values) 135 #print("constraints", constraints)136 128 self.constraints = dict(constraints) 137 129 self.set_fitted(fitted) … … 230 222 def _setup(self): 231 223 exprs = {} 232 for model in self.models: 233 exprs.update((".".join((model.name, k)), v) 234 for k, v in model.constraints.items()) 224 for M in self.models: 225 exprs.update((".".join((M.name, k)), v) for k, v in M.constraints.items()) 235 226 if exprs: 236 symtab = dict((".".join(( model.name, k)), p)237 for modelin self.models238 for k, p in model.parameters().items())227 symtab = dict((".".join((M.name, k)), p) 228 for M in self.models 229 for k, p in M.parameters().items()) 239 230 self.update = compile_constraints(symtab, exprs) 240 231 else: -
src/sas/sascalc/fit/pagestate.py
r59873e1 r59873e1 1 1 """ 2 2 Class that holds a fit page state 3 4 Pagestate fields reflect the names of the gui controls from the sasview 3.x5 fit page, so they are somewhat difficult to interpret.6 7 Pagestate attributes are as follows:8 9 # =>name: desc indicates the attribute is derived10 # name(xml): desc indicates the attribute name differs from the xml tag11 12 # SasView version which saved the file13 version: (4, 1, 2) from <fitting_plug_in version="major.minor.point">14 15 # Session information16 group_id: unique id for fit page in running system (int)17 => data_group_id: unique id for data item in running system (None)18 19 # Data file20 data: contents of <SASdata> (Data1D or Data2D)21 data_name: filename + [num] (latex_smeared.xml [1])22 data_id: filename + [num] + timestamp (latex_smeared.xml [1]1523303027.73)23 file: filename + [date time] (latex_smeared.xml [Apr 09 15:45])24 name: ?? (None)25 npts: number of points (float)26 enable2D: True if data is 2D (or if model is 2D and no data)27 is_data: True (pagestate will not save if there is no data attached)28 29 # Data weighting30 dI_didata: True if dy = data.dy31 dI_idata: True if dy = data.y32 dI_noweight: True if dy = 133 dI_sqrdata: True if dy = sqrt(data.y)34 35 # Data selection36 qmax: maximum q (float)37 qmin: minimum q (float)38 => qmax_x: ?? (None)39 => qmin_x: ?? (None)40 41 # Resolution smearing42 enable_smearer: True if use data.dx43 disable_smearer: True if no smearing44 pinhole_smearer: True if custom pinhole smear45 slit_smearer: True if custom slit smear46 dq_l: 2D resolution <dQp>47 dq_r: 2D resolution <dQs>48 dx_old: True for 3.x version of custom pinhole, which used dx_min rather49 than dx_percent, with dx_percent interpreted as 100 * dx_percent/q[0]50 dx_percent: custom pinhole resolution percentage51 dxl: slit height for custom slit resolution52 dxw: slit width for custom slit resolution53 smearer: repr() for active smearer (None on load)54 smear_type: None (None on load)55 56 # Model selection57 categorycombobox: model category58 formfactorcombobox: model name (could be "[plug-in] name")59 structurecombobox: structure factor model name (string or None or "None")60 multi_factor: multiplicity (integer or None)61 magnetic_on: True if model is magnetic (only for 2D data for now)62 => model: active model object (None on load)63 64 # Model parameters65 # Parameter is a tuple with the following structure. The parentheses66 # indicate xml attribute for the <parameter .../> tag:67 # fitted(selected_to_fit): True if parameter is fitted68 # name(name): display name for the parameter (string)69 # value(value): displayed parameter value (string)70 # => plusminus: '+/-' (constant string)71 # => uncertainty: tuple72 # (uncertainty_displayed): True if there is an uncertainty73 # (uncertainty_value): displayed uncertainty (string)74 # => lower: tuple75 # (minimum_displayed): True if there is a lower bound76 # (minimum_value): displayed lower bound (string)77 # => upper: tuple78 # (maximum_displayed): True if there is a upper bound79 # (maximum_value): displayed upper bound (string)80 # units(unit): displayed units81 parameters: list of normal parameters82 fixed_param: list of non-fitting parameters (nsigma, npts in dispersity)83 fittable_param: list of fittable dispersity parameters (distribution width)84 str_parameters: list of selection parameters (e.g, shell forms in spherical_sld)85 orientation_params(orientation_parameters): list of orientation and86 magnetic parameters (already included in parameters, so safe to ignore)87 orientation_params_disp(dispersity_parameters): list of orientation88 disperisty parameters (already included in fixed_param and89 fittable_param so safe to ignore)90 91 # Dispersity controls92 enable_disp: True if dispersity parameters93 disable_disp: True if no dispersity parameters94 disp_obj_dict(disp_obj): {'parameter.width': 'dispersity distribution'}95 values: {'parameter.width': [array distribution parameter values] }96 weights: {'parameter.width': [array distribution parameter weights] }97 => disp_box 098 => disp_cb_dict {}99 => disp_list []100 101 # Simultaneous fitting102 103 => images: None (initialized but unused?)104 => reset: False (initialized but unused?)105 => event_owner None106 => m_name None107 => manager None108 => page_name109 => param_toFit: []110 => process: list of process done on object [] (maybe managed by guiframe?)111 => saved_states {}112 => cb1: False (simfit cb1 is now stored in select_all)113 114 tcChi 1.3463115 theory_data None116 timestamp 1523303103.74117 118 Constraint attributes are as follows:119 120 constraint_dict {}121 constraints_list122 {'model_cbox': 'M2', 'param_cbox': 'scale', 'egal_txt': ' = ', 'constraint': 'M1.scale'}123 {'model_cbox': 'M2', 'param_cbox': 'radius', 'egal_txt': ' = ', 'constraint': 'M1.radius'}124 {'model_cbox': 'M2', 'param_cbox': 'radius.width', 'egal_txt': ' = ', 'constraint': 'M1.radius.width'}125 fit_page_no None126 model_list127 {'fit_number': '393', 'checked': 'True', 'fit_page_source': 'M2', 'name': 'latex_smeared.xml [1]1523535051.03', 'model_name': 'sphere'}128 {'fit_number': '335', 'checked': 'True', 'fit_page_source': 'M1', 'name': 'latex_smeared.xml 1523535050.03', 'model_name': 'sphere'}129 model_to_fit130 no_constraint 0131 select_all True132 133 134 3 """ 135 4 # TODO: Refactor code so we don't need to use getattr/setattr … … 293 162 self.theory_data = None 294 163 # Is 2D 164 self.is_2D = False 295 165 self.images = None 296 166 … … 687 557 temp_parameters = [] 688 558 temp_fittable_param = [] 559 if self.data.__class__.__name__ == "Data2D": 560 self.is_2D = True 561 else: 562 self.is_2D = False 689 563 if self.data is not None: 690 is_2D = (self.data.__class__.__name__ == "Data2D") 691 if not is_2D: 564 if not self.is_2D: 692 565 for item in self.parameters: 693 566 if item not in self.orientation_params: -
src/sas/sasgui/perspectives/fitting/fitpage.py
rdabcaf7 rdabcaf7 50 50 # draw sizer 51 51 self._fill_data_sizer() 52 self.is_2D = None 52 53 self.fit_started = False 53 54 self.weightbt_string = None
Note: See TracChangeset
for help on using the changeset viewer.