Changeset 78d3341 in sasmodels
- Timestamp:
- Mar 17, 2016 12:24:09 PM (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:
- 3a45c2c
- Parents:
- 3bcd03d
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/convert.py
r228cbd3 r78d3341 72 72 new model definition end with sld. 73 73 """ 74 return dict((p, (v*1e-6 if p. endswith('sld')74 return dict((p, (v*1e-6 if p.startswith('sld') or p.endswith('sld') 75 75 else v*1e15 if 'ndensity' in p 76 76 else v)) -
sasmodels/generate.py
rfcd7bbd r78d3341 91 91 in *Iqxy* and *Imagnetic*. "magnetic* parameters will be used in 92 92 *Imagnetic* only. If *type* is the empty string, the parameter will 93 be used in all of *Iq*, *Iqxy* and *Imagnetic*. 93 be used in all of *Iq*, *Iqxy* and *Imagnetic*. "sld" parameters 94 can automatically be promoted to magnetic parameters, each of which 95 will have a magnitude and a direction, which may be different from 96 other sld parameters. 94 97 95 98 *description* is a short description of the parameter. This will … … 216 219 import re 217 220 import string 221 import warnings 218 222 from collections import namedtuple 219 223 … … 604 608 """ 605 609 partype = { 606 'volume': [], 'orientation': [], 'magnetic': [], ' ': [],610 'volume': [], 'orientation': [], 'magnetic': [], 'sld': [], '': [], 607 611 'fixed-1d': [], 'fixed-2d': [], 'pd-1d': [], 'pd-2d': [], 608 612 'pd-rel': set(), … … 618 622 elif p.type == 'orientation': 619 623 partype['pd-2d'].append(p.name) 620 elif p.type == '':624 elif p.type in ('', 'sld'): 621 625 partype['fixed-1d'].append(p.name) 622 626 partype['fixed-2d'].append(p.name) … … 632 636 """ 633 637 # convert parameters into named tuples 638 for p in model_info['parameters']: 639 if p[4] == '' and (p[0].startswith('sld') or p[0].endswith('sld')): 640 p[4] = 'sld' 641 # TODO: make sure all models explicitly label their sld parameters 642 #raise ValueError("%s.%s needs to be explicitly set to type 'sld'" %(model_info['id'], p[0])) 643 634 644 pars = [Parameter(*p) for p in model_info['parameters']] 635 645 # Fill in the derived attributes
Note: See TracChangeset
for help on using the changeset viewer.