Skip to content

Commit

Permalink
Changes due to deprecations in Cubed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed Oct 29, 2024
1 parent 0e9a6f3 commit d311ff6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions tests/benchmarks/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import cubed
import cubed.random
from cubed.core.optimization import multiple_inputs_optimize_dag, simple_optimize_dag
from cubed.extensions.rich import RichProgressBar
from cubed.diagnostics.rich import RichProgressBar

from ..utils import run

Expand Down Expand Up @@ -47,9 +47,7 @@ def test_quadratic_means_xarray(tmp_path, runtime, benchmark_all, optimizer, t_l
quad = ds**2
quad["uv"] = ds.anom_u * ds.anom_v
print(quad)
result = quad.mean(
"time", skipna=False, use_new_impl=True, split_every=10
)
result = quad.mean("time", skipna=False, split_every=10)

if optimizer == "new-optimizer":
opt_fn = partial(multiple_inputs_optimize_dag, max_total_num_input_blocks=20)
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def benchmark_memory(test_run_benchmark):
.. code-block:: python
def test_something(benchmark_memory):
history = cubed.extensions.history.HistoryCallback()
history = cubed.diagnostics.history.HistoryCallback()
with benchmark_memory(history):
cubed.compute(*arrs, callbacks=[history])
"""
Expand Down Expand Up @@ -259,7 +259,7 @@ def benchmark_tasks(test_run_benchmark):
.. code-block:: python
def test_something(benchmark_tasks):
history = cubed.extensions.history.HistoryCallback()
history = cubed.diagnostics.history.HistoryCallback()
with benchmark_tasks(history):
cubed.compute(*arrs, callbacks=[history])
"""
Expand Down Expand Up @@ -305,7 +305,7 @@ def benchmark_all(
.. code-block:: python
def test_something(benchmark_all):
history = cubed.extensions.history.HistoryCallback()
history = cubed.diagnostics.history.HistoryCallback()
with benchmark_all(history):
cubed.compute(*arrs, callbacks=[history])
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import yaml

import cubed
from cubed.extensions.history import HistoryCallback
from cubed.extensions.timeline import TimelineVisualizationCallback
from cubed.diagnostics.history import HistoryCallback
from cubed.diagnostics.timeline import TimelineVisualizationCallback
from cubed.spec import spec_from_config
from cubed import config

Expand Down

0 comments on commit d311ff6

Please sign in to comment.