Skip to content

Commit

Permalink
Docstring and notes on status/plans
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHeybrock committed Mar 21, 2024
1 parent 7aa0d52 commit b1c0375
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/cyclebane/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,26 @@ def slice_values(


class Graph:
"""
A Cyclebane graph is a directed acyclic graph with additional array-like structure.
The array-like structure selectively affects nodes in the graph by associating
source nodes with an array-like object. The source node and all its descendants
thus gain an additional index or dimension.
Notes
-----
The current implementation is a proof of concept, there is a number of things to
improve:
- I think I want to avoid spelling out the indices early in `map`, but instead delay
this until `to_networkx`.
- Overall, I would like to reduce the array-handling code and transparently forward
to the slicing code of the underlying array-like object (Pandas, NumPy, Xarray,
Scipp). Basically, we would like to use the slicing methods of the underlying
object. This may not be trivial, since we might mix different types of array-like
objects at nodes with multiple predecessors.
"""

def __init__(self, graph: nx.DiGraph, *, value_attr: str = 'value'):
self.graph = graph
self.indices: dict[IndexName, Iterable[IndexValue]] = {}
Expand Down

0 comments on commit b1c0375

Please sign in to comment.