@sgyeager ran into an issue where calling eos() when salt and temp are dask arrays but depth is a numpy array (well, all three are of type DataArray, but under the xarray wrapper it's dask, dask, numpy) took several minutes while still returning a dask object, but chunking depth so it was a dask array as well let eos() finish in under a second. I think the problem is in https://github.com/NCAR/pop-tools/blob/main/pop_tools/eos.py#L100
salt, temp, pressure = xr.broadcast(salt, temp, pressure)
if isinstance(salt.data, dask.array.Array):
pressure = pressure.chunk(salt.chunks)
wouldn't it make more sense to chunk pressure before the xr.broadcast()? I.e.
if isinstance(salt.data, dask.array.Array):
pressure = pressure.chunk(salt.chunks)
salt, temp, pressure = xr.broadcast(salt, temp, pressure)
@sgyeager ran into an issue where calling
eos()whensaltandtempare dask arrays butdepthis a numpy array (well, all three are of typeDataArray, but under the xarray wrapper it's dask, dask, numpy) took several minutes while still returning a dask object, but chunking depth so it was a dask array as well leteos()finish in under a second. I think the problem is in https://github.com/NCAR/pop-tools/blob/main/pop_tools/eos.py#L100wouldn't it make more sense to chunk
pressurebefore thexr.broadcast()? I.e.