Changeset e44432d in sasmodels for sasmodels/modelinfo.py


Ignore:
Timestamp:
Oct 19, 2018 3:46:26 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
be43e39
Parents:
2586ab72
Message:

support hollow models in structure factor calculations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/modelinfo.py

    r9ae0d2e re44432d  
    718718 
    719719#: Set of variables defined in the model that might contain C code 
    720 C_SYMBOLS = ['Imagnetic', 'Iq', 'Iqxy', 'Iqac', 'Iqabc', 'form_volume', 'c_code'] 
     720C_SYMBOLS = ['Imagnetic', 'Iq', 'Iqxy', 'Iqac', 'Iqabc', 'form_volume', 'shell_volume', 'c_code'] 
    721721 
    722722def _find_source_lines(model_info, kernel_module): 
     
    803803    info.tests = getattr(kernel_module, 'tests', []) 
    804804    info.form_volume = getattr(kernel_module, 'form_volume', None) # type: ignore 
     805    info.shell_volume = getattr(kernel_module, 'shell_volume', None) # type: ignore 
    805806    info.Iq = getattr(kernel_module, 'Iq', None) # type: ignore 
    806807    info.Iqxy = getattr(kernel_module, 'Iqxy', None) # type: ignore 
     
    921922    #: void Fq(double q, double *F1, double *F2, ...) 
    922923    have_Fq = False 
     924    #: List of options for computing the effective radius of the shape, 
     925    #: or None if the model is not usable as a form factor model. 
     926    effective_radius_type = None   # type: List[str] 
    923927    #: List of C source files used to define the model.  The source files 
    924928    #: should define the *Iq* function, and possibly *Iqac* or *Iqabc* if the 
    925929    #: model defines orientation parameters. Files containing the most basic 
    926930    #: functions must appear first in the list, followed by the files that 
    927     #: use those functions.  Form factors are indicated by providing 
    928     #: an :attr:`ER` function. 
    929     effective_radius_type = None   # type: List[str] 
    930     #: Returns the occupied volume and the total volume for each parameter set. 
    931     #: See :attr:`ER` for details on the parameters. 
     931    #: use those functions. 
    932932    source = None           # type: List[str] 
    933933    #: The set of tests that must pass.  The format of the tests is described 
     
    958958    #: C code, either defined as a string, or in the sources. 
    959959    form_volume = None      # type: Union[None, str, Callable[[np.ndarray], float]] 
     960    #: Returns the shell volume for python-based models.  Form volume and 
     961    #: shell volume are needed for volume normalization in the polydispersity 
     962    #: integral and structure interactions for hollow shapes.  If no 
     963    #: parameters are *volume* parameters, then shell volume is not needed. 
     964    #: For C-based models, (with :attr:`sources` defined, or with :attr:`Iq` 
     965    #: defined using a string containing C code), shell_volume must also be 
     966    #: C code, either defined as a string, or in the sources. 
     967    shell_volume = None      # type: Union[None, str, Callable[[np.ndarray], float]] 
    960968    #: Returns *I(q, a, b, ...)* for parameters *a*, *b*, etc. defined 
    961969    #: by the parameter table.  *Iq* can be defined as a python function, or 
Note: See TracChangeset for help on using the changeset viewer.