Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspect and / or delete cached properties #211

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Mar 5, 2020

  1. Access or delete all cached properties

    * All cached properties derive from a parent class ``CachedProperty``, so that we can use isinstance to identify them.
    * Add function ``cached_properties``: iterate over the cached properties of an object.
    * Add function ``cached_properties_computed``: iterate over the cached properties that are already computed.
    * Add function ``delete_cache``: empty the whole cache of an object.
    * Add decorator ``property_deleting_cache``: a property that deletes the cache when it is set or deleted.
    francois-durand committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    cbaafee View commit details
    Browse the repository at this point in the history
  2. Alternative syntax for property_deleting_cache

    * Use Black.
    * ``property_deleting_cache`` uses the function for its side effects, even if its return value is ignored.
    * ``property_deleting_cache_2``: proposition or alternate syntax.
    francois-durand committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    874e465 View commit details
    Browse the repository at this point in the history
  3. Add is_cached and un_cache

    * Remove ``cached_properties_computed``, because it is now a trivial combination of ``cached_properties`` and ``is_cached``.
    francois-durand committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    dafc574 View commit details
    Browse the repository at this point in the history
  4. Update Readme

    * Update Readme:
      * Add new functions (un_cache, delete_cache, etc.).
      * Replace the monopoly running example by a more generic example.
    * Add a notebook "readme companion" to test the code of the readme.
    francois-durand committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    47b2b92 View commit details
    Browse the repository at this point in the history