Changeset 91c5fdc in sasmodels


Ignore:
Timestamp:
Mar 16, 2016 10:07:28 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

fix doc build

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/genmodel.py

    rd138d43 r91c5fdc  
    1 import sys 
    2 sys.path.insert(0,'..') 
     1import sys, os 
     2sys.path.insert(0, os.path.abspath('..')) 
     3from sasmodels import generate, core 
    34 
    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 
     6model_name = os.path.basename(sys.argv[1])[:-3] 
    117 
    128# Load the doc string from the module definition file and store it in rst 
    13 from sasmodels import generate 
    14 docstr = generate.doc(module) 
     9docstr = generate.make_doc(core.load_model_info(model_name)) 
    1510open(sys.argv[2],'w').write(docstr) 
  • sasmodels/compare.py

    r35b4c47 r91c5fdc  
    431431            print(exc) 
    432432            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") 
    435434    if model_info['composition']: 
    436435        composition_type, parts = model_info['composition'] 
     
    717716        print("expected parameters: model N1 N2") 
    718717 
    719     def load_model(name): 
     718    def _get_info(name): 
    720719        try: 
    721720            model_info = core.load_model_info(name) 
     
    728727    name = args[0] 
    729728    if '*' in name: 
    730         parts = [load_model(k) for k in name.split('*')] 
     729        parts = [_get_info(k) for k in name.split('*')] 
    731730        model_info = product.make_product_info(*parts) 
    732731    else: 
    733         model_info = load_model(name) 
     732        model_info = _get_info(name) 
    734733 
    735734    invalid = [o[1:] for o in flags 
  • sasmodels/generate.py

    rb8e5e21 r91c5fdc  
    754754    Iq_units = "The returned value is scaled to units of |cm^-1| |sr^-1|, absolute scale." 
    755755    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__ 
    758756    docs = convert_section_titles_to_boldface(model_info['docs']) 
    759757    subst = dict(id=model_info['id'].replace('_', '-'), 
     
    761759                 title=model_info['title'], 
    762760                 parameters=make_partable(model_info['parameters']), 
    763                  returns=Sq_units if is_Sq else Iq_units, 
     761                 returns=Sq_units if model_info['structure_factor'] else Iq_units, 
    764762                 docs=docs) 
    765763    return DOC_HEADER % subst 
Note: See TracChangeset for help on using the changeset viewer.