Skip to main content

Carve computation trees from a burl of dependencies.

Project description

griblet logo

griblet

PyPI Version License: MIT DOI Codacy Badge Codacy Badge

The griblet knows the easiest path through your data.

  • It thrives where there are multiple, looping paths.
  • It can account for cache and disk state.
  • It loves scientific post-processing.

Installation

Install griblet in the usual way:

pip install griblet

The griblet has no runtime dependencies.

Example

Start by describing common computational paths in your data. For example, below one can compute volume via two paths: via area, and directly from length, width, and height.

from griblet import Graph

graph = Graph()

graph.add("length", lambda: 5.0)
graph.add("width", lambda: 4.0)
graph.add("height", lambda: 3.0)

graph.add(
    "area",
    lambda length, width: length * width,
    needs=("length", "width"),
    cost=2.0,
)

graph.add(
    "volume",
    lambda area, height: area * height,
    needs=("area", "height"),
    cost=2.0,
)
graph.add(
    "volume",
    lambda length, width, height: length * width * height,
    needs=("length", "width", "height"),
    cost=3.0,
)

print(graph.compute("volume"))

The griblet finds the easiest path.

The griblet is okay with disconnected graphs; when there is no path to the requested field, griblet raises NoPathError. The user can then consider adding further computational paths with graph.add.

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

griblet-0.3.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

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

griblet-0.3.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file griblet-0.3.0.tar.gz.

File metadata

  • Download URL: griblet-0.3.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for griblet-0.3.0.tar.gz
Algorithm Hash digest
SHA256 54592ae2856040db168552cf81e836a9a168209e4ed3c338960c3a23fe6f9069
MD5 3fac98becade7afec805c1571f8081fd
BLAKE2b-256 a00ba18c26051afb013d40e613086d5f84821fbd3e07828c4adfd424299ac8a2

See more details on using hashes here.

File details

Details for the file griblet-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: griblet-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for griblet-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c723670ee6e2e12ec6ddcde72f40eef591e3cfeb1265d5e053bd20a247dd16d2
MD5 f8260174bcfe4bfa9e6970181cf50295
BLAKE2b-256 4eee3322b9100b66ea6cc20388906e08ac459e3af86d09ce6777e55195c2b944

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