Comments (1)
YAX bug?
julia> g_ds_w = broadcast_dims.(*, DimArray.(weights), DimArray.(g_ds))
╭───────────────────────────────────────╮
│ 4-element DimGroupByArray{DimArray,1} │
├───────────────────────────────────────┴─────────────────────────────────────────────── dims ┐
↓ Ti Categorical{Symbol} [:Dec_Jan_Feb, :Mar_Apr_May, :Jun_Jul_Aug, :Sep_Oct_Nov] Unordered
├───────────────────────────────────────────────────────────────────────────────── metadata ┤
Dict{Symbol, Any} with 1 entry:
:groupby => :Ti=>CyclicBins(month; cycle=12, step=3, start=12)…
├─────────────────────────────────────────────────────────────────────────────── group dims ┤
↓ Ti, → X, ↗ Y, ⬔ Variable
└───────────────────────────────────────────────────────────────────────────────────────────┘
:Dec_Jan_Feb 121×10×15×2 DimArray
:Mar_Apr_May 92×10×15×2 DimArray
:Jun_Jul_Aug 92×10×15×2 DimArray
:Sep_Oct_Nov 91×10×15×2 DimArray
@felixcremer looks like you need to implement rebuild(::YAXArray; kw...)
because you don't have a metadata
field.
Oops you do it just has a limited type, maybe loosen it to a parameter?
https://github.com/JuliaDataCubes/YAXArrays.jl/blob/master/src/Cubes/Cubes.jl#L203
NoMetadata
is just like nothing
but get(nometadata, :key, default)
wont fail on it. And it doesn't allocate like Dict()
. You could catch it and make a Dict{String,Any}()
instead if you always want that.
julia> g_ds_w = broadcast_dims.(*, weights, g_ds)
ERROR: MethodError: Cannot `convert` an object of type
DimensionalData.Dimensions.LookupArrays.NoMetadata to an object of type
Dict{String}
Closest candidates are:
convert(::Type{T}, ::T) where T<:AbstractDict
@ Base abstractdict.jl:565
convert(::Type{T}, ::T) where T
@ Base Base.jl:84
convert(::Type{T}, ::AbstractDict) where T<:AbstractDict
@ Base abstractdict.jl:567
Stacktrace:
[1] YAXArray(axes::Tuple{…}, data::Array{…}, properties::DimensionalData.Dimensions.LookupArrays.No
Metadata, chunks::DiskArrays.GridChunks{…}, cleaner::Vector{…})
@ YAXArrays.Cubes ~/.julia/packages/YAXArrays/vR35N/src/Cubes/Cubes.jl:123
[2] YAXArray(axes::Tuple{…}, data::Array{…}, properties::DimensionalData.Dimensions.LookupArrays.No
Metadata; cleaner::Vector{…}, chunks::DiskArrays.GridChunks{…})
@ YAXArrays.Cubes ~/.julia/packages/YAXArrays/vR35N/src/Cubes/Cubes.jl:136
[3] rebuild(A::YAXArray{…}; data::Array{…}, dims::Tuple{…}, metadata::DimensionalData.Dimensions.Lo
okupArrays.NoMetadata, kw::@Kwargs{…})
@ YAXArrays.Cubes ~/.julia/packages/YAXArrays/vR35N/src/Cubes/Cubes.jl:203
[4] similar(A::YAXArray{Float64, 1, Vector{…}, Tuple{…}}, ::Type{Float64}, D::Tuple{Dim{…}, X{…}, Y
{…}, Dim{…}})
@ DimensionalData ~/.julia/dev/DimensionalData/src/array/array.jl:244
[5] broadcast_dims(::Function, ::YAXArray{Float64, 1, Vector{Float64}, Tuple{Dim{…}}}, ::Vararg{Abs
tractDimArray})
@ DimensionalData ~/.julia/dev/DimensionalData/src/utils.jl:117
[6] _broadcast_getindex_evalf
@ ./broadcast.jl:709 [inlined]
[7] _broadcast_getindex
@ ./broadcast.jl:682 [inlined]
[8] getindex
@ ./broadcast.jl:636 [inlined]
[9] copy
@ ./broadcast.jl:942 [inlined]
[10] copy(bc::Base.Broadcast.Broadcasted{DimensionalData.DimensionalStyle{…}, Nothing, typeof(broadc
ast_dims), Tuple{…}})
@ DimensionalData ~/.julia/dev/DimensionalData/src/array/broadcast.jl:39
[11] copy(bc::Base.Broadcast.Broadcasted{DimensionalData.DimensionalStyle{…}, Tuple{…}, typeof(broad
cast_dims), Tuple{…}})
@ DimensionalData ~/.julia/dev/DimensionalData/src/array/broadcast.jl:39
[12] materialize(bc::Base.Broadcast.Broadcasted{…})
@ Base.Broadcast ./broadcast.jl:903
[13] top-level scope
@ REPL[55]:1
Some type information was truncated. Use `show(err)` to see complete types.
from dimensionaldata.jl.
Related Issues (20)
- typos HOT 6
- Explain difference of Interval and Range for Indexing HOT 1
- Weighted mean from `StatsBase` does not work on DimArray HOT 6
- Invalid assignment to DimArray indexed by DimSelectors HOT 3
- Use of `set` leads to error during display HOT 2
- improve `show`
- `similar` for `DimGroupByArray` should return a `DimArray`
- Stack overflow when using DimPoints with an empty tuple HOT 1
- Add a DiskArrays extension HOT 1
- Forward `eachindex` and/or `Generator` to the parent array?
- New type instability issues
- missing function in plot recipe HOT 1
- New logo? HOT 26
- image should use extrema of dimensions and not the full lookup HOT 1
- `pairs` of DimVector do not reflect lookup values HOT 5
- Cannot write CSV from diskbased DimArray
- `end` doesn't work correctly HOT 4
- implement `@broadcast_dims` macro HOT 2
- Would it make sense to add support for defining dimensions with a symbol -OR- string? HOT 4
- Dimension mismatch: `DimSelectors` with alphabetized labels HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dimensionaldata.jl.