Changeset b297ba9 in sasmodels for sasmodels/list_pars.py
- Timestamp:
- Mar 20, 2019 5:03:50 PM (5 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 4e28511
- Parents:
- 0d362b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/list_pars.py
r2d81cfe rb297ba9 16 16 from .compare import columnize 17 17 18 def find_pars( type=None):18 def find_pars(kind=None): 19 19 """ 20 20 Find all parameters in all models. … … 26 26 model_info = load_model_info(name) 27 27 for p in model_info.parameters.kernel_parameters: 28 if type is None or p.type == type:28 if kind is None or p.type == kind: 29 29 partable.setdefault(p.name, []) 30 30 partable[p.name].append(name) 31 31 return partable 32 32 33 def list_pars(names_only=True, type=None):33 def list_pars(names_only=True, kind=None): 34 34 """ 35 35 Print all parameters in all models. … … 38 38 occurs in. 39 39 """ 40 partable = find_pars( type)40 partable = find_pars(kind) 41 41 if names_only: 42 42 print(columnize(list(sorted(partable.keys())))) … … 57 57 help="list models which use this argument") 58 58 parser.add_argument( 59 ' type', default="any", nargs='?',59 'kind', default="any", nargs='?', 60 60 metavar="volume|orientation|sld|none|any", 61 61 choices=['volume', 'orientation', 'sld', None, 'any'], 62 type=lambda v: None if v == 'any' else ''if v == 'none' else v,63 help="only list arguments of the given type")62 type=lambda v: None if v == 'any' else None if v == 'none' else v, 63 help="only list arguments of the given kind") 64 64 args = parser.parse_args() 65 65 66 list_pars(names_only=not args.verbose, type=args.type)66 list_pars(names_only=not args.verbose, kind=args.kind) 67 67 68 68 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.