Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving Datasets #76

Closed
MarkusZehner opened this issue Aug 25, 2021 · 1 comment
Closed

Saving Datasets #76

MarkusZehner opened this issue Aug 25, 2021 · 1 comment

Comments

@MarkusZehner
Copy link
Contributor

Saving Datasets or Cubes with more than the YAXArray is not yet possible. As in #65 with the lost properties or when trying to save the testdatacube ds:

julia> savecube(ds, "test")
ERROR: MethodError: no method matching ndims(::Dataset)
Closest candidates are:
  ndims(::Base.Generator) at generator.jl:53
  ndims(::AbstractChar) at char.jl:191
  ndims(::DataFrames.GroupKey) at /Users/markuszehner/.julia/packages/DataFrames/vuMM8/src/groupeddataframe/groupeddataframe.jl:507
  ...
Stacktrace:
 [1] dimnames(x::Dataset)
   @ YAXArrayBase ~/.julia/packages/YAXArrayBase/OgYsV/src/axisarrays/axisinterface.jl:46
 [2] caxes(x::Dataset)
   @ YAXArrays.Cubes ~/Documents/vsc_jpy/dev/YAXArrays/src/Cubes/Cubes.jl:133
 [3] savecube(c::Dataset, name::String; chunksize::Dict{Any, Any}, max_cache::Float64, backend::Symbol, backendargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ YAXArrays.DAT ~/Documents/vsc_jpy/dev/YAXArrays/src/DAT/CubeIO.jl:17
 [4] savecube(c::Dataset, name::String)
   @ YAXArrays.DAT ~/Documents/vsc_jpy/dev/YAXArrays/src/DAT/CubeIO.jl:17
 [5] top-level scope
   @ REPL[64]:1

Also when saving individual YAXArrays, the name of the cube is replaced by "layer":

julia> savecube(ds.avar, "test_deleteme_ds.zarr", backend=:zarr)
YAXArray with the following dimensions
XVals               Axis with 4 Elements from 1.0 to 4.0
YVals               Axis with 5 elements: 1 2 3 4 5 
Time                Axis with 12 Elements from 2001-01-15 to 2001-12-15
Total size: 1.88 KB

julia> y = YAXArrays.open_dataset("test_deleteme_ds.zarr")
YAXArray Dataset
Dimensions: 
   XVals               Axis with 4 Elements from 1.0 to 4.0
   Time                Axis with 12 Elements from 2001-01-15T00:00:00 to 2001-12-15T00:00:00
   YVals               Axis with 5 Elements from 1 to 5
Variables: layer 
@lazarusA
Copy link
Collaborator

close by #436, although several other before also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants