Changeset a5b8477 in sasmodels for sasmodels/generate.py


Ignore:
Timestamp:
Apr 13, 2016 6:17:10 PM (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:
0ce5710
Parents:
60f03de
Message:

update docs to work with the new ModelInfo/ParameterTable? classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/generate.py

    r7ae2b7f ra5b8477  
    123123    polydispersity values for tests. 
    124124 
    125 An *model_info* dictionary is constructed from the kernel meta data and 
    126 returned to the caller. 
     125A :class:`modelinfo.ModelInfo` structure is constructed from the kernel meta 
     126data and returned to the caller. 
    127127 
    128128The doc string at the start of the kernel module will be used to 
     
    132132file systems are case-sensitive, so only use lower case characters for 
    133133file names and extensions. 
    134  
    135  
    136 The function :func:`make` loads the metadata from the module and returns 
    137 the kernel source.  The function :func:`make_doc` extracts the doc string 
    138 and adds the parameter table to the top.  The function :func:`model_sources` 
    139 returns a list of files required by the model. 
    140134 
    141135Code follows the C99 standard with the following extensions and conditions:: 
     
    149143    all double declarations may be converted to half, float, or long double 
    150144    FLOAT_SIZE is the number of bytes in the converted variables 
     145 
     146:func:`load_kernel_module` loads the model definition file and 
     147:modelinfo:`make_model_info` parses it. :func:`make_source` 
     148converts C-based model definitions to C source code, including the 
     149polydispersity integral.  :func:`model_sources` returns the list of 
     150source files the model depends on, and :func:`timestamp` returns 
     151the latest time stamp amongst the source files (so you can check if 
     152the model needs to be rebuilt). 
     153 
     154The function :func:`make_doc` extracts the doc string and adds the 
     155parameter table to the top.  *make_figure* in *sasmodels/doc/genmodel* 
     156creates the default figure for the model.  [These two sets of code 
     157should mignrate into docs.py so docs can be updated in one place]. 
    151158""" 
    152159from __future__ import print_function 
     
    585592    Sq_units = "The returned value is a dimensionless structure factor, $S(q)$." 
    586593    docs = convert_section_titles_to_boldface(model_info.docs) 
     594    pars = make_partable(model_info.parameters.COMMON 
     595                         + model_info.parameters.kernel_parameters) 
    587596    subst = dict(id=model_info.id.replace('_', '-'), 
    588597                 name=model_info.name, 
    589598                 title=model_info.title, 
    590                  parameters=make_partable(model_info.parameters.kernel_parameters), 
     599                 parameters=pars, 
    591600                 returns=Sq_units if model_info.structure_factor else Iq_units, 
    592601                 docs=docs) 
Note: See TracChangeset for help on using the changeset viewer.