Skip to content

Commit

Permalink
Doc: DASK
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Jun 25, 2023
1 parent b86c423 commit eadfd75
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions docs/source/analysis/dask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ The Python bindings of openPMD-api provide direct methods to load data into the
How to Install
--------------

...
Among many package managers, `PyPI <https://pypi.org/project/dask/>`__ ships the latest packages of DASK:

...
.. code-block:: python
python3 -m pip install -U dask
python3 -m pip install -U pyarrow
Expand All @@ -20,31 +20,31 @@ How to Install
How to Use
----------

...
The central Python API calls to convert to DASK datatypes are the ``ParticleSpecies.to_dask`` and ``Record_Component.to_dask_array`` methods.

...
.. code-block:: python
s = io.Series("samples/git-sample/data%T.h5", io.Access.read_only)
electrons = s.iterations[400].particles["electrons"]
s = io.Series("samples/git-sample/data%T.h5", io.Access.read_only)
electrons = s.iterations[400].particles["electrons"]
# the default schedulers are local/threaded. We can also use local
# "processes" or for multi-node "distributed", among others.
dask.config.set(scheduler='processes')
# the default schedulers are local/threaded. We can also use local
# "processes" or for multi-node "distributed", among others.
dask.config.set(scheduler='processes')
df = electrons.to_dask()
type(df) # ...
df = electrons.to_dask()
type(df) # ...
E = s.iterations[400].meshes["E"]
E_x = E["x"]
darr_x = E_x.to_dask_array()
type(darr_x) # ...
E = s.iterations[400].meshes["E"]
E_x = E["x"]
darr_x = E_x.to_dask_array()
type(darr_x) # ...
# note: no series.flush() needed
# note: no series.flush() needed
Example
-------

A detailed example script for particle and field analysis is documented under as ``11_particle_dataframe.py`` in our :ref:`examples <usage-examples>`.

See a video of openPMD on DASK in action here: ...
See a video of openPMD on DASK in action in `pull request #963 <https://github.com/openPMD/openPMD-api/pull/963#issuecomment-873350174>`__ (part of openPMD-api v0.14.0 and later).

0 comments on commit eadfd75

Please sign in to comment.