Changeset f41027b in sasmodels
- Timestamp:
- Jul 19, 2018 1:12:48 PM (6 years ago)
- Branches:
- master
- Children:
- d0fdba2
- Parents:
- 7609046
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/guide/pd/polydispersity.rst
r7609046 rf41027b 405 405 the volume fraction to lie between zero and one. 406 406 407 To activate a user-defined distribution, set the following environment variable: 408 409 SASMODELS_WEIGHTS=path/to/folder/name_of_distribution.py 407 To activate a user-defined distribution, put it in a file such as *distname.py* 408 in the *SAS_WEIGHTS_PATH* folder. This is defined with an environment 409 variable, defaulting to:: 410 411 SAS_WEIGHTS_PATH=~/.sasview/weights 412 413 The weights path is loaded on startup. To update the distribution definition 414 in 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') 410 418 411 419 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -
sasmodels/compare.py
r7609046 rf41027b 115 115 === environment variables === 116 116 -DSAS_MODELPATH=path sets directory containing custom models 117 -DSAS_WEIGHTS_PATH=path sets directory containing custom distributions 117 118 -DSAS_OPENCL=vendor:device|none sets the target OpenCL device 118 119 -DXDG_CACHE_HOME=~/.cache sets the pyopencl cache root (linux only) -
sasmodels/weights.py
r910c0f4 rf41027b 231 231 )) 232 232 233 SAS MODELS_WEIGHTS = "~/.sasview/weights/*.py"233 SAS_WEIGHTS_PATH = "~/.sasview/weights" 234 234 def load_weights(pattern=None): 235 235 # type: (str) -> None 236 236 """ 237 Load dispersion distributions matching the given pattern237 Load dispersion distributions matching the given glob pattern 238 238 """ 239 239 import logging … … 244 244 from .custom import load_custom_kernel_module 245 245 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") 247 248 for filename in sorted(glob.glob(os.path.expanduser(pattern))): 248 249 try:
Note: See TracChangeset
for help on using the changeset viewer.