Changeset a18c5b3 in sasmodels
- Timestamp:
- Apr 13, 2016 10:10:43 AM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 04dc697
- Parents:
- 793beb3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
r793beb3 ra18c5b3 112 112 All the attributes should be immutable to avoid accidents. 113 113 """ 114 attrs = {} # type: Dict[str, Any]115 attrs['_model_info'] = model_info116 attrs['name'] = model_info.name117 attrs['id'] = model_info.id118 attrs['description'] = model_info.description119 attrs['category'] = None120 114 121 115 # TODO: allow model to override axis labels input/output name/unit 122 116 123 parameters = model_info.parameters 124 125 #self.is_multifunc = False 117 # Process multiplicity 126 118 non_fittable = [] # type: List[str] 127 119 xlabel = model_info.profile_axes[0] if model_info.profile is not None else "" 128 120 variants = MultiplicityInfo(0, "", [], xlabel) 129 for p in parameters.kernel_parameters:121 for p in model_info.parameters.kernel_parameters: 130 122 if p.name == model_info.control: 131 123 non_fittable.append(p.name) … … 141 133 break 142 134 143 attrs['is_structure_factor'] = model_info.structure_factor 144 attrs['is_form_factor'] = model_info.ER is not None 145 attrs['is_multiplicity_model'] = variants[0] > 1 146 attrs['multiplicity_info'] = variants 147 135 # Organize parameter sets 148 136 orientation_params = [] 149 137 magnetic_params = [] 150 138 fixed = [] 151 for p in parameters.user_parameters():139 for p in model_info.parameters.user_parameters(): 152 140 if p.type == 'orientation': 153 141 orientation_params.append(p.name) … … 158 146 magnetic_params.append(p.name) 159 147 fixed.append(p.name+".width") 148 149 # Build class dictionary 150 attrs = {} # type: Dict[str, Any] 151 attrs['_model_info'] = model_info 152 attrs['name'] = model_info.name 153 attrs['id'] = model_info.id 154 attrs['description'] = model_info.description 155 attrs['category'] = model_info.category 156 attrs['is_structure_factor'] = model_info.structure_factor 157 attrs['is_form_factor'] = model_info.ER is not None 158 attrs['is_multiplicity_model'] = variants[0] > 1 159 attrs['multiplicity_info'] = variants 160 160 attrs['orientation_params'] = tuple(orientation_params) 161 161 attrs['magnetic_params'] = tuple(magnetic_params) 162 162 attrs['fixed'] = tuple(fixed) 163 164 163 attrs['non_fittable'] = tuple(non_fittable) 165 164 … … 227 226 def __init__(self, multiplicity=None): 228 227 # type: () -> None 229 print("initializing", self.name)230 #raise Exception("first initialization")231 self._model = None232 228 233 229 ## _persistency_dict is used by sas.perspectives.fitting.basepage … … 564 560 from . import weights 565 561 disperser = weights.dispersers[dispersion.__class__.__name__] 566 dispersion = weights. models[disperser]()562 dispersion = weights.MODELS[disperser]() 567 563 self.dispersion[parameter] = dispersion.get_pars() 568 564 else:
Note: See TracChangeset
for help on using the changeset viewer.