Changeset aa25fc7 in sasmodels for sasmodels/compare.py


Ignore:
Timestamp:
May 23, 2018 5:55:27 PM (4 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master
Children:
910c0f4
Parents:
33969b6
Message:

load user-defined weight functions from ~/.sasview/weights/*.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r1fbadb2 raa25fc7  
    4141from . import kerneldll 
    4242from . import kernelcl 
     43from . import weights 
    4344from .data import plot_theory, empty_data1D, empty_data2D, load_data 
    4445from .direct_model import DirectModel, get_mesh 
    4546from .generate import FLOAT_RE, set_integration_size 
    46 from .weights import plot_weights 
    4747 
    4848# pylint: disable=unused-import 
     
    771771            model_info = base._kernel.info 
    772772            dim = base._kernel.dim 
    773             plot_weights(model_info, get_mesh(model_info, base_pars, dim=dim)) 
     773            weights.plot_weights(model_info, get_mesh(model_info, base_pars, dim=dim)) 
    774774    if opts['plot']: 
    775775        import matplotlib.pyplot as plt 
     
    13531353    #import pprint; pprint.pprint(model_info) 
    13541354 
     1355    # Hack to load user-defined distributions; run through all parameters 
     1356    # and make sure any pd_type parameter is a defined distribution. 
     1357    if (any(p.endswith('pd_type') and v not in weights.MODELS 
     1358            for p, v in pars.items()) or 
     1359        any(p.endswith('pd_type') and v not in weights.MODELS 
     1360            for p, v in pars2.items())): 
     1361       weights.load_weights() 
     1362 
    13551363    if opts['show_pars']: 
    13561364        if model_info.name != model_info2.name or pars != pars2: 
Note: See TracChangeset for help on using the changeset viewer.