Commit b4c6abf
authored
Improve caching decorator and move it to simulations (#73)
Improve the decorator so it can be used in multiple methods within a
same object. Change how the cache objects are stored: each
`_cache_{hash(func)}` attribute will be a tuple with two elements: the
hash of the model and the cached return of the `func`. This way, two
different methods can have their own caches, even for different models.
Remove the `cache_on_model` decorator from `DataMisfit`. Using the
decorator on `DataMisfit` methods would force us to also validate other
relevant attributes, like the data, their uncertainties and the weights.
Use the decorator on the `__call__` method of the `WrappedSimulation`.1 parent 981a706 commit b4c6abf
File tree
4 files changed
+139
-160
lines changed- notebooks
- src/inversion_ideas
4 files changed
+139
-160
lines changed
0 commit comments