Changeset 839fd68 in sasmodels for sasmodels/sasview_model.py
- Timestamp:
- Sep 17, 2018 12:33:16 PM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 91bd550
- Parents:
- 2c12061
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
rd533590 r839fd68 62 62 #: set of defined models (standard and custom) 63 63 MODELS = {} # type: Dict[str, SasviewModelType] 64 # TODO: remove unused MODEL_BY_PATH cache once sasview no longer references it 64 65 #: custom model {path: model} mapping so we can check timestamps 65 66 MODEL_BY_PATH = {} # type: Dict[str, SasviewModelType] … … 106 107 Load a custom model given the model path. 107 108 """ 108 model = MODEL_BY_PATH.get(path, None)109 if model is not None and model.timestamp == getmtime(path):110 #logger.info("Model already loaded %s", path)111 return model112 113 109 #logger.info("Loading model %s", path) 114 110 kernel_module = custom.load_custom_kernel_module(path) … … 127 123 model_info = modelinfo.make_model_info(kernel_module) 128 124 model = make_model_from_info(model_info) 129 model.timestamp = getmtime(path)130 125 131 126 # If a model name already exists and we are loading a different model, … … 144 139 145 140 MODELS[model.name] = model 146 MODEL_BY_PATH[path] = model147 141 return model 148 142
Note: See TracChangeset
for help on using the changeset viewer.