Skip to content

Commit

Permalink
replace caxes by dims (#466)
Browse files Browse the repository at this point in the history
* replace caxes by dims

* collect

* Only replace caxes by dims for AbstractDimArray

* Reenable fallback caxes

---------

Co-authored-by: Felix Cremer <fcremer@bgc-jena.mpg.de>
  • Loading branch information
lazarusA and felixcremer authored Nov 25, 2024
1 parent 19db33d commit f4253c2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/Cubes/Cubes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,18 @@ function DD.rebuild(A::YAXArray; data=parent(A), dims=DD.dims(A), metadata=DD.me
end

function caxes(x)
#@show x
#@show typeof(x)
dims = map(enumerate(dimnames(x))) do a
index, symbol = a
values = YAXArrayBase.dimvals(x, index)
DD.Dim{symbol}(values)
end
(dims... ,)
#@show x
#@show typeof(x)
dims = map(enumerate(dimnames(x))) do a
index, symbol = a
values = YAXArrayBase.dimvals(x, index)
DD.Dim{symbol}(values)
end
(dims... ,)
end

caxes(x::DD.AbstractDimArray) = collect(DD.dims(x))

caxes(c::YAXArray) = getfield(c, :axes)
"""
caxes
Expand Down

0 comments on commit f4253c2

Please sign in to comment.