• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mrocklin / dask / 573
93%
master: 94%

Build:
Build:
LAST BUILD BRANCH: astype-passthrough
DEFAULT BRANCH: master
Ran 12 Jun 2015 02:25PM UTC
Jobs 1
Files 49
Run time 32min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
573

push

travis-ci

mrocklin
add dask.array.cache

This allows us to evaluate a dask.array, store in some cache,
and then return a new dask array pointing to that precomputed data.

One can specify a cache as either a MutableMapping or as an ndarray

Example
-------

>>> import dask.array as da
>>> x = da.arange(5, chunks=2)
>>> y = 2*x + 1
>>> z = y.cache()  # triggers computation

>>> y.compute()  # Does entire computation
array([1, 3, 5, 7, 9])

>>> z.compute()  # Just pulls from store
array([1, 3, 5, 7, 9])

You might base a cache off of an array like a numpy array or
h5py.Dataset.

>>> cache = np.empty(5, dtype=x.dtype)
>>> z = y.cache(store=cache)
>>> cache
array([1, 3, 5, 7, 9])

Or one might use a MutableMapping like a dict or chest

>>> cache = dict()
>>> z = y.cache(store=cache)
>>> cache  # doctest: +SKIP
{('x', 0): array([1, 3]),
 ('x', 1): array([5, 7]),
 ('x', 2): array([9])}

Fixes #293

4944 of 5317 relevant lines covered (92.98%)

0.93 hits per line

Jobs
ID Job ID Ran Files Coverage
2 573.2 12 Jun 2015 02:25PM UTC 0
92.98
Travis Job 573.2
Source Files on build 573
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #573
  • e25b0566 on github
  • Next Build on array-cache2 (#577)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc