You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now all properties are computed every time they are called. We should implement a caching mechanism by which the computed values are stored the first time they are computed.
Proposed solution
We should implement a decorator, e.g. cached_property, that stores computed properties into a global dict cache if they are not found in the cache. We should also implement a second decorator invalidates_cached_properties(property_names) that removes data from the cache whenever a function is run that invalidates some property (e.g. rescaling the area of a polygon invalidates the moment of inertia calculation).
The text was updated successfully, but these errors were encountered:
Feature description
Right now all properties are computed every time they are called. We should implement a caching mechanism by which the computed values are stored the first time they are computed.
Proposed solution
We should implement a decorator, e.g.
cached_property
, that stores computed properties into a global dict cache if they are not found in the cache. We should also implement a second decoratorinvalidates_cached_properties(property_names)
that removes data from the cache whenever a function is run that invalidates some property (e.g. rescaling the area of a polygon invalidates the moment of inertia calculation).The text was updated successfully, but these errors were encountered: