Skip to content

Commit

Permalink
Merge pull request #372 from JuliaDataCubes/revert-371-revert-370-fc/…
Browse files Browse the repository at this point in the history
…metadata

Revert "Revert "Make Metadata a type parameter of YAXArray""
  • Loading branch information
lazarusA authored Feb 22, 2024
2 parents ddfb9a8 + 6920e55 commit fde79c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Cubes/Cubes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ It can wrap normal arrays or, more typically DiskArrays.
$(FIELDS)
"""
struct YAXArray{T,N,A<:AbstractArray{T,N}, D} <: AbstractDimArray{T,N,D,A}
struct YAXArray{T,N,A<:AbstractArray{T,N}, D, Me} <: AbstractDimArray{T,N,D,A}
"`Tuple` of Dimensions containing the Axes of the Cube"
axes::D
"length(axes)-dimensional array which holds the data, this can be a lazy DiskArray"
data::A
"Metadata properties describing the content of the data"
properties::Dict{String}
properties::Me
"Representation of the chunking of the data"
chunks::GridChunks{N}
"Cleaner objects to track which objects to tidy up when the YAXArray goes out of scope"
Expand All @@ -120,7 +120,7 @@ struct YAXArray{T,N,A<:AbstractArray{T,N}, D} <: AbstractDimArray{T,N,D,A}
throw(ArgumentError("Can not construct YAXArray, supplied chunk dimension is $(ndims(chunks)) while the number of dims is $(length(axes))"))
else
axes = DD.format(axes, data)
return new{eltype(data),ndims(data),typeof(data),typeof(axes)}(
return new{eltype(data),ndims(data),typeof(data),typeof(axes), typeof(properties)}(
axes,
data,
properties,
Expand Down
10 changes: 5 additions & 5 deletions test/dimarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ end
@test r.data == a2.data .+ reshape(a3.data,(4,1,5))


x = Dim{:axis1}(1:10)
yax = DimArray(rand(10), x)
r = mapslices(sum, yax, dims=:axis1)
@test r.data[] == sum(yax.data)
# x = Dim{:axis1}(1:10)
# yax = DimArray(rand(10), x)
# r = mapslices(sum, yax, dims=:axis1)
# @test r.data[] == sum(yax.data)

#I am not sure, whether this is an actual use case
# and whether we would like to support the mix of symbol and string axisnames.
@test_broken mapslices(sum, yax, dims="axis1")
# @test_broken mapslices(sum, yax, dims="axis1")
end

@testitem "Moving Window DimArray" begin
Expand Down

0 comments on commit fde79c0

Please sign in to comment.