Skip to content

Commit

Permalink
update for executors, 0.2 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Aug 24, 2020
1 parent a7a75c9 commit 12b9a05
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ python:
path: .
extra_requirements:
- docs
- complete
22 changes: 22 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,25 @@ The Rechunked Object

.. warning::
You must manually delete the intermediate store when ``execute`` is finished.


.. _api.executors:

Executors
---------

Rechunking plans can be executed on a variety of backends. The following table lists the current options.

.. autosummary::

rechunker.executors.beam.BeamExecutor
rechunker.executors.dask.DaskExecutor
rechunker.executors.prefect.PrefectExecutor
rechunker.executors.python.PythonExecutor
rechunker.executors.pywren.PywrenExecutor

.. autoclass:: rechunker.executors.beam.BeamExecutor
.. autoclass:: rechunker.executors.dask.DaskExecutor
.. autoclass:: rechunker.executors.prefect.PrefectExecutor
.. autoclass:: rechunker.executors.python.PythonExecutor
.. autoclass:: rechunker.executors.pywren.PywrenExecutor
30 changes: 30 additions & 0 deletions docs/executors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. _executors:

Executors
=========

``rechunker`` plans can be executed by a variety of executors. The default is ``dask``, which executes the plan on a Dask cluster.

For example, we can use :ref:`rechunker.executors.python.PythonExecutor` to execute a plan as a simple Python for loop, which might be useful for debugging.

.. code-block:: python
>>> import zarr
>>> from rechunker import rechunk
>>> source = zarr.ones((4, 4), chunks=(2, 2), store="source.zarr")
>>> intermediate = "intermediate.zarr"
>>> target = "target.zarr"
>>> rechunked = rechunk(
... source, target_chunks=(4, 1), target_store=target,
... max_mem=256000000, temp_store=intermediate,
... executor="python"
... )
>>> rechunked.execute()
.. note::

Most executors will require installing additional optional
dependencies.


See :ref:`api.executors` for a list of all the different executors.
9 changes: 8 additions & 1 deletion docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Release Notes
=============

v0.1 - Unreleased
v0.2.0
------

- Added ``rechunker.executors`` for executing plans with other
backends like Apache Beam, prefect, and pywren. See :ref:`executors` for more.
- Fixed overflow bug when computing the number of chunks needed for a memory target.

v0.0.1
-----------------

- Documentation update and tutorial.
Expand Down

0 comments on commit 12b9a05

Please sign in to comment.