modelCacher1d
- sherpa.models.model.modelCacher1d(func: Callable) Callable[source] [edit on github]
A decorator to cache 1D ArithmeticModel evaluations.
Apply to the
calcmethod of a 1D model to allow the model evaluation to be cached. The decision is based on theintegratesetting, the evaluation grid, parameter values, and the keywords sent to the model.Notes
The keywords are included in the hash calculation even if they are not relevant for the model (as there’s no easy way to find this out).
Examples
Allow
MyModelmodel evaluations to be cached:def MyModel(ArithmeticModel): ... @modelCacher1d def calc(self, p, *args, **kwargs): ...