evalf / nutils

The nutils project
http://www.nutils.org/
MIT License
88 stars 48 forks source link

remove CacheMeta-based caching #784

Closed gertjanvanzwieten closed 1 year ago

gertjanvanzwieten commented 1 year ago

This PR removes all uses of the __cache__ mechanism, facilitated by the CacheMeta meta class, and replaces it by the cached_property and lru_cache decorators which are considered to give better visibility to caching structures. The CacheMeta class is removed as no longer relevant.

gertjanvanzwieten commented 1 year ago

Oh there is actually an unresolved problem: I had to remove the base properties Reference.vertices and Reference.edge_vertices because they cannot otherwise be overridden in MosaicReference. @joostvanzwieten Would it be acceptable to use an annotation like vertices: numpy.ndarray instead?