Transform directed acyclic graphs using map-reduce and groupby operations
Project description
Cyclebane
About
Transform directed acyclic graphs using map-reduce and groupby operations
This library is an attempt to merge the concepts of directed acyclic graphs (DAG) with array-like objects such as NumPy arrays, Pandas DataFrames, or Xarray/Scipp DataArrays. This could be useful for describing tasks graphs, e.g., when a series of tasks is applied to chunks of an array. These tasks also have an array structure. After an reduction operation of chunks, the graph loses this structure, i.e., only a subset of the graph's nodes has array structure. What if we could work with this structure, even though only parts of the graph follows it? And what if we could use the power of array slicing with named dimensions, or select by label? This is what Cyclebane tries to do.
Our initial goal is to support:
map
operations of a DAG's source nodes over an array-like (https://docs.dask.org/en/latest/high-level-graphs.html). Cyclebane will effectively copy all descendants of those nodes, once for each array element. Cyclebane will support joint mappings of multiple source nodes by mapping over, e.g., a DataFrame with multiple columns, as well as chaining independent map operations at different source nodes. In the latter case this will effectively broadcast at descendant nodes that depend on multiple such source nodes.reduce
operations at descendants of mapped nodes. This will add a new node with edges to all copies of the mapped node being reduced. Cyclebane will support reducing only individual axes or all axes, similar to Numpy.groupby
operations similar to Pandas and Xarray (albeit more limited).- Positional and label-based indexing.
Cyclebane will support selecting branches that were creating during
map
(orgroupby
) operations based on their indices. The graph structure will be left untouched, i.e., nodes after areduce
operation will be preserved, but fewer edges will lead to the reduce node.
See also Dask's High Level Graphs for a related concept (without the direct support for any such operations).
Installation
python -m pip install cyclebane
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
Built Distribution
File details
Details for the file cyclebane-24.5.0.tar.gz
.
File metadata
- Download URL: cyclebane-24.5.0.tar.gz
- Upload date:
- Size: 41.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a41bffde814b753c91b78d44ea75b9e13bfc08122a211a9a53b2985c46c7884 |
|
MD5 | 98b96c61fff165783b62569368539e53 |
|
BLAKE2b-256 | 67e3a47eb68a65dba464750cd15a4012acc60699895489711535c0f963314f51 |
File details
Details for the file cyclebane-24.5.0-py3-none-any.whl
.
File metadata
- Download URL: cyclebane-24.5.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d017e39fca339a4e64dececf29709f1b444a9518b2de8207e92518aba2c84a |
|
MD5 | 7a6d9d6acc00146d981f9e4fb574853e |
|
BLAKE2b-256 | d322a1ac8a4aa599ecd3746bb288f0c395ba5244f2f683e76fabb47deb2bb3ca |