Changeset aa25fc7 in sasmodels for sasmodels/weights.py
- Timestamp:
- May 23, 2018 3:55:27 PM (6 years ago)
- Branches:
- master
- Children:
- 910c0f4
- Parents:
- 33969b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/weights.py
r3d58247 raa25fc7 231 231 )) 232 232 233 SASMODELS_WEIGHTS = "~/.sasview/weights/*.py" 234 def load_weights(pattern=None): 235 # type: (str) -> None 236 """ 237 Load dispersion distributions matching the given pattern 238 """ 239 import logging 240 import os 241 import os.path 242 import glob 243 import traceback 244 from .custom import load_custom_kernel_module 245 if pattern is None: 246 pattern = os.environ.get("SASMODELS_WEIGHTS", SASMODELS_WEIGHTS) 247 for filename in sorted(glob.glob(os.path.expanduser(pattern))): 248 try: 249 print("loading weights from", filename) 250 module = load_custom_kernel_module(filename) 251 MODELS[module.Dispersion.type] = module.Dispersion 252 except Exception as exc: 253 logging.error(traceback.format_exc(exc)) 233 254 234 255 def get_weights(disperser, n, width, nsigmas, value, limits, relative):
Note: See TracChangeset
for help on using the changeset viewer.