Changeset 0c3e5d2 in sasmodels for sasmodels/sasview_model.py
- Timestamp:
- Feb 18, 2015 10:14:10 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:
- 9474dda
- Parents:
- c5b7d07 (diff), 0a82216 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
r250fa25 r0a82216 32 32 33 33 34 def make_class(kernel_module, dtype='single' ):34 def make_class(kernel_module, dtype='single', namestyle='name'): 35 35 """ 36 36 Load the sasview model defined in *kernel_module*. 37 37 38 38 Returns a class that can be used directly as a sasview model. 39 40 Defaults to using the new name for a model. Setting namestyle='name' 41 will produce a class with a name compatible with SasView 39 42 """ 40 43 model = load_model(kernel_module, dtype=dtype) … … 42 45 SasviewModel.__init__(self, model) 43 46 attrs = dict(__init__=__init__) 44 ConstructedModel = type(model.info[ 'name'], (SasviewModel,), attrs)47 ConstructedModel = type(model.info[namestyle], (SasviewModel,), attrs) 45 48 return ConstructedModel 46 49 … … 54 57 55 58 self.name = model.info['name'] 59 self.oldname = model.info['oldname'] 56 60 self.description = model.info['description'] 57 61 self.category = None
Note: See TracChangeset
for help on using the changeset viewer.