Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarusA committed Sep 22, 2024
1 parent ffc57e4 commit 773d627
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 21 additions & 1 deletion docs/src/UserGuide/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,24 @@ and voilà
ds = Dataset(; (d_keys .=> yax_list)...)
````

now they are printed together, showing that is exactly the same axis structure for all variables.
now they are printed together, showing that is exactly the same axis structure for all variables.

## Create a `YAXArray` with unions containing `Strings`

````@example howdoi
test_x = stack(Vector{Union{Int,String}}[[1, "Test"], [2, "Test2"]])
yax_string = YAXArray(test_x)
````

or simply with an `Any` type

````@example howdoi
test_bool = ["Test1" 1 false; 2 "Test2" true; 1 2f0 1f2]
yax_bool = YAXArray(test_bool)
````

::: warning

Note that although their creation is allowed, it is not possible to save these types into Zarr or NetCDF.

:::
2 changes: 1 addition & 1 deletion src/Cubes/Cubes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ function DD.show_after(io::IO, mime, c::YAXArray)
println(io, "\n file size: ", formatbytes(cubesize(c)))
else # fallback
DD.print_block_separator(io, "memory size", blockwidth, blockwidth)
println(io, "\n summarysize size: ", formatbytes(Base.summarysize(parent(c))))
println(io, "\n summarysize: ", formatbytes(Base.summarysize(parent(c))))
end
DD.print_block_close(io, blockwidth)
# Uncomment to print array data if needed
Expand Down

0 comments on commit 773d627

Please sign in to comment.