Skip to content

Commit

Permalink
Add missing api doc (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite authored Jan 29, 2024
1 parent c4aa7e3 commit 5bd8108
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cubed/array_api/array_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@


class Array(CoreArray):
"""Chunked array backed by Zarr storage that conforms to the Python Array API standard."""

def __init__(self, name, zarray, spec, plan):
super().__init__(name, zarray, spec, plan)

Expand Down
42 changes: 40 additions & 2 deletions cubed/core/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,25 @@ def compute(
resume=None,
**kwargs,
):
"""Compute this array, and any arrays that it depends on."""
"""Compute this array, and any arrays that it depends on.
Parameters
----------
executor : Executor, optional
The executor to use to run the computation. If not set then the executor
from the array's ``Spec`` is used.
callbacks : list of Callback, optional
Callbacks to send events to while running the computation.
optimize_graph : bool, optional
If True, the graph is optimized before running the computation.
Otherwise, the graph is computed as is. Default is True.
optimize_function : callable, optional
Function to optimize the computation graph. Default is to use a
function that performs map fusion only.
resume : bool, optional
If True, intermediate arrays that have already been computed won't be
recomputed. Default is False.
"""
result = compute(
self,
executor=executor,
Expand Down Expand Up @@ -231,7 +249,27 @@ def compute(
resume=None,
**kwargs,
):
"""Compute multiple arrays at once."""
"""Compute multiple arrays at once.
Parameters
----------
arrays : cubed.CoreArray
The arrays to compute.
executor : Executor, optional
The executor to use to run the computation. If not set then the executor
from the ``Spec`` from the arrays is used.
callbacks : list of Callback, optional
Callbacks to send events to while running the computation.
optimize_graph : bool, optional
If True, the graph is optimized before running the computation.
Otherwise, the graph is computed as is. Default is True.
optimize_function : callable, optional
Function to optimize the computation graph. Default is to use a
function that performs map fusion only.
resume : bool, optional
If True, intermediate arrays that have already been computed won't be
recomputed. Default is False.
"""
spec = check_array_specs(arrays) # guarantees all arrays have same spec
plan = arrays_to_plan(*arrays)
if executor is None:
Expand Down

0 comments on commit 5bd8108

Please sign in to comment.