Skip to main content

A big flappy cache that never forgets.

Project description

Mamo

Your friendly neighborhood persistent memoization library.

Getting started

pip install mamo

Design

Code changes drive data changes. Especially, with big data, it is highly likely that different calls return different data.

Mamo fingerprints data by hashing it when unavoidable and by fingerprinting the computational graph (as far as known to Mamo) otherwise.

As future extension, Mamo will support different fingerprints for the same value, but in common use-cases detecting code changes is more impactful.

It assumes functions are pure, which allows for ignoring stochasticity. Otherwise anything using a random number generator would constantly be marked as stale.

More details

Mamo has concepts: value identity and fingerprints. Fingerprints are used to determine whether a stored computed value is stale: If an argument value to the function that computes a value is different (different fingerprints) from the one that was used originally, we mark the value as stale.

Value identity is about when two values have the same identity. (If every value was unique, there would never be stale values.) This is only an important concept for computed values: the result of a function with the same arguments (argument identity) has the same value identity as the stored result for a previous call.

Assumptions

The biggest assumption for the current design is:

Values are unlikely to ever be the same.

This means that we can use hashing for checking equality checks, and that different computational graphs imply unequal values.

Thus, Mamo does not implement perfect memoization at the moment but only a heuristic that does not try to actually match arguments fully.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mamo-0.1.0.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mamo-0.1.0-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file mamo-0.1.0.tar.gz.

File metadata

  • Download URL: mamo-0.1.0.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.6

File hashes

Hashes for mamo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 789043659c2a51b5d41b4f814430075ae54d11d00e3b7698ffafaa4121a3d2ee
MD5 cb7d8410740bd45074db66241014045e
BLAKE2b-256 178a069c1ae7b90ae2c02260f1cb6567008347a8b75e13cffc6c7b31d550bb46

See more details on using hashes here.

File details

Details for the file mamo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mamo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.6

File hashes

Hashes for mamo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dee120bcd8aa55daeaf0f1196d36adc29121ca6acb4bfbab27b62d4a2d1a523
MD5 6e67c9d312dcbd6285cd93bccb9d728b
BLAKE2b-256 297aa1ce766474509aea0748c78e5d33adc9249d4089aa28b3390e7642d2c64f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page