Customizable caching of Dask-delayed.
Project description
Dask-checkpoint
Dask-checkpoint is a Python package
that adds a customizable caching capabilities to dask.
It builds on top of dask.delayed
,
adding load and save instructions
to the dask graph.
from dask_checkpoint import Storage, task
storage = Storage.from_fsspec("my_directory")
@task(save=True)
def add_one(x):
return x + 1
x0 = add_one(1).compute() # computed
with storage():
x1 = add_one(1).compute() # computed and saved to storage
x2 = add_one(1).compute() # loaded from storage
x3 = add_one(1).compute() # recomputed, not loaded from storage
assert x0 == x1 == x2 == x3
Installation
Dask-checkpoint can be installed from PyPI:
pip install dask-checkpoint
Getting started
Check out the tutorial to see Dask-checkpoint in action.
Development
To set up a development environment in a new conda environment, run the following commands:
git clone https://github.com/maurosilber/dask-checkpoint
cd dask-checkpoint
conda env create -f environment-dev.yml
pre-commit install
Run tests locally with tox
:
tox
or, if you have mamba
installed:
CONDA_EXE=mamba tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dask_checkpoint-0.2.tar.gz
(14.9 kB
view hashes)
Built Distribution
Close
Hashes for dask_checkpoint-0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70255594bd739a96e79ad32db1e586b7e04eb5aafe49b37d40524c638559e21a |
|
MD5 | 54ef55e596811e447fe863a04c6ffe28 |
|
BLAKE2b-256 | 232902311f2dcdacf1f421b96318ec4534e78bbdfcc9df48a85048f91e219359 |