modelCacher1d

sherpa.models.model.modelCacher1d(func)[source] [edit on github]

A decorater to cache 1D ArithmeticModel evalutions.

Apply to the calc method of a 1D model to allow the model evaluation to be cached. The decision is based on the _use_caching attribute of the cache along with the integrate setting, the evaluation grid, and parameter values.

Example

Allow MyModel model evaluations to be cached:

def MyModel(ArithmeticModel):
    ...
    @modelCacher1d
    def calc(self, *args, **kwargs):
        ...