Changeset f41027b in sasmodels


Ignore:
Timestamp:
Jul 19, 2018 11:12:48 AM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master
Children:
d0fdba2
Parents:
7609046
Message:

change environment variable for distributions to SAS_WEIGHTS_PATH

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/guide/pd/polydispersity.rst

    r7609046 rf41027b  
    405405the volume fraction to lie between zero and one. 
    406406 
    407 To activate a user-defined distribution, set the following environment variable: 
    408  
    409     SASMODELS_WEIGHTS=path/to/folder/name_of_distribution.py 
     407To activate a user-defined distribution, put it in a file such as *distname.py* 
     408in the *SAS_WEIGHTS_PATH* folder.  This is defined with an environment 
     409variable, defaulting to:: 
     410 
     411    SAS_WEIGHTS_PATH=~/.sasview/weights 
     412 
     413The weights path is loaded on startup.  To update the distribution definition 
     414in a running application you will need to enter the following python commands:: 
     415 
     416    import sasmodels.weights 
     417    sasmodels.weights.load_weights('path/to/distname.py') 
    410418 
    411419.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
  • sasmodels/compare.py

    r7609046 rf41027b  
    115115    === environment variables === 
    116116    -DSAS_MODELPATH=path sets directory containing custom models 
     117    -DSAS_WEIGHTS_PATH=path sets directory containing custom distributions 
    117118    -DSAS_OPENCL=vendor:device|none sets the target OpenCL device 
    118119    -DXDG_CACHE_HOME=~/.cache sets the pyopencl cache root (linux only) 
  • sasmodels/weights.py

    r910c0f4 rf41027b  
    231231)) 
    232232 
    233 SASMODELS_WEIGHTS = "~/.sasview/weights/*.py" 
     233SAS_WEIGHTS_PATH = "~/.sasview/weights" 
    234234def load_weights(pattern=None): 
    235235    # type: (str) -> None 
    236236    """ 
    237     Load dispersion distributions matching the given pattern 
     237    Load dispersion distributions matching the given glob pattern 
    238238    """ 
    239239    import logging 
     
    244244    from .custom import load_custom_kernel_module 
    245245    if pattern is None: 
    246         pattern = os.environ.get("SASMODELS_WEIGHTS", SASMODELS_WEIGHTS) 
     246        path = os.environ.get("SAS_WEIGHTS_PATH", SAS_WEIGHTS_PATH) 
     247        pattern = os.path.join(path, "*.py") 
    247248    for filename in sorted(glob.glob(os.path.expanduser(pattern))): 
    248249        try: 
Note: See TracChangeset for help on using the changeset viewer.