Skip to content

Commit 99bf9ca

Browse files
committed
warn when trying to compute on yaxarray
1 parent 6813395 commit 99bf9ca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/DAT/xmap.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ Computes the YAXArrays dataset `ods` and saves it to a Zarr dataset at `path`.
375375
- `overwrite`: Whether to overwrite the dataset at `path` if it already exists.
376376
"""
377377
function compute_to_zarr(ods, path; max_cache=5e8,overwrite=false)
378+
if !isa(ods,Dataset)
379+
throw(ArgumentError("Direct saving of YAXArrays is not supported. Please wrap your array `a` into a Dataset by calling `Dataset(layer=a)`"))
380+
end
378381
g = DAE.MwopGraph()
379382
outnodes = Dict()
380383
for k in keys(ods.cubes)

0 commit comments

Comments
 (0)