Changeset 91c5fdc in sasmodels
- Timestamp:
- Mar 16, 2016 10:07:28 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:
- 3936ad3, 348557a
- Parents:
- 7b3e62c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/genmodel.py
rd138d43 r91c5fdc 1 import sys 2 sys.path.insert(0,'..') 1 import sys, os 2 sys.path.insert(0, os.path.abspath('..')) 3 from sasmodels import generate, core 3 4 4 # Convert ../sasmodels/models/name.py to sasmodels.models.name 5 module_name = sys.argv[1][3:-3].replace('/','.').replace('\\','.') 6 #print module_name 7 module = __import__(module_name) 8 for part in module_name.split('.')[1:]: 9 module = getattr(module, part) 10 #print module 5 # Convert ../sasmodels/models/name.py to name 6 model_name = os.path.basename(sys.argv[1])[:-3] 11 7 12 8 # Load the doc string from the module definition file and store it in rst 13 from sasmodels import generate 14 docstr = generate.doc(module) 9 docstr = generate.make_doc(core.load_model_info(model_name)) 15 10 open(sys.argv[2],'w').write(docstr) -
sasmodels/compare.py
r35b4c47 r91c5fdc 431 431 print(exc) 432 432 print("... trying again with single precision") 433 dtype = 'single' 434 return core.build_model(model_info, dtype=dtype, platform="ocl") 433 return core.build_model(model_info, dtype='single', platform="ocl") 435 434 if model_info['composition']: 436 435 composition_type, parts = model_info['composition'] … … 717 716 print("expected parameters: model N1 N2") 718 717 719 def load_model(name):718 def _get_info(name): 720 719 try: 721 720 model_info = core.load_model_info(name) … … 728 727 name = args[0] 729 728 if '*' in name: 730 parts = [ load_model(k) for k in name.split('*')]729 parts = [_get_info(k) for k in name.split('*')] 731 730 model_info = product.make_product_info(*parts) 732 731 else: 733 model_info = load_model(name)732 model_info = _get_info(name) 734 733 735 734 invalid = [o[1:] for o in flags -
sasmodels/generate.py
rb8e5e21 r91c5fdc 754 754 Iq_units = "The returned value is scaled to units of |cm^-1| |sr^-1|, absolute scale." 755 755 Sq_units = "The returned value is a dimensionless structure factor, $S(q)$." 756 is_Sq = ("structure-factor" in model_info['category'])757 #docs = kernel_module.__doc__758 756 docs = convert_section_titles_to_boldface(model_info['docs']) 759 757 subst = dict(id=model_info['id'].replace('_', '-'), … … 761 759 title=model_info['title'], 762 760 parameters=make_partable(model_info['parameters']), 763 returns=Sq_units if is_Sqelse Iq_units,761 returns=Sq_units if model_info['structure_factor'] else Iq_units, 764 762 docs=docs) 765 763 return DOC_HEADER % subst
Note: See TracChangeset
for help on using the changeset viewer.