Changeset 87985ca in sasmodels for sasmodels/sasview_model.py
- Timestamp:
- Sep 2, 2014 2:35:23 PM (10 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:
- 19dcb933
- Parents:
- f4cf580
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
r5d4777d r87985ca 1 """ 2 Sasview model constructor. 3 4 Given a module defining an OpenCL kernel such as sasmodels.models.cylinder, 5 create a sasview model class to run that kernel as follows:: 6 7 from sasmodels.sasview_model import make_class 8 from sasmodels.models import cylinder 9 CylinderModel = make_class(cylinder, dtype='single') 10 11 The model parameters for sasmodels are different from those in sasview. 12 When reloading previously saved models, the parameters should be converted 13 using :func:`sasmodels.convert.convert`. 14 """ 15 16 # TODO: add a sasview=>sasmodels parameter translation layer 17 # this will allow us to use the new sasmodels as drop in replacements, and 18 # delay renaming parameters until all models have been converted. 19 1 20 import math 2 21 from copy import deepcopy … … 16 35 """ 17 36 Load the sasview model defined in *kernel_module*. 18 :param kernel_module: 19 :param dtype: 20 :return: 37 38 Returns a class that can be used directly as a sasview model. 21 39 """ 22 40 model = load_model(kernel_module, dtype=dtype)
Note: See TracChangeset
for help on using the changeset viewer.