From f7900aa4c2a5c7d17d4fd9edfe46ddbeb6d77b8c Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Fri, 11 Oct 2024 14:53:27 -0400 Subject: [PATCH] make sure non-dask mode works, and increase chunk size dramatically to decrease graph size --- aces/analysis/giantcube_cuts.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/aces/analysis/giantcube_cuts.py b/aces/analysis/giantcube_cuts.py index d9881840..ee2ed578 100644 --- a/aces/analysis/giantcube_cuts.py +++ b/aces/analysis/giantcube_cuts.py @@ -76,13 +76,14 @@ def do_all_stats(cube, molname, mompath=f'{basepath}/mosaics/cubes/moments/', dopv=True, dods=True, howargs={}): t0 = time.time() print(cube, flush=True) - print("Dask graph:\n", cube._data.max().__dask_graph__(), flush=True) + if hasattr(cube, 'rechunk'): + print("Dask graph:\n", cube._data.max().__dask_graph__(), flush=True) - cube = cube.rechunk((-1, 200, 200)) + cube = cube.rechunk((-1, 1000, 1000)) - print("Rechunked") - print(cube, flush=True) - print("Dask graph:\n", cube._data.max().__dask_graph__(), flush=True) + print("Rechunked") + print(cube, flush=True) + print("Dask graph:\n", cube._data.max().__dask_graph__(), flush=True) print(f"mom0. dt={time.time() - t0}", flush=True) mom0 = cube.moment0(axis=0, **howargs)