-
Notifications
You must be signed in to change notification settings - Fork 43
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
preservedims
in tables
#917
base: main
Are you sure you want to change the base?
Conversation
Will test it out, thanks! @alex-s-gardner this is thing number 1 for saving glacier height histogram as GeoJSON |
This works on this branch but fails when I merge it with master, just FYI |
Also this kind of works the other way around than I had expected, I thought that julia> da = @d sin.(hypot.(X(LinRange(-9,9,100)), Y(LinRange(0, 18, 100))) .+ Ti(LinRange(0, 6pi, 100)))
┌ 100×100×100 DimArray{Float64, 3} ┐
├──────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────── dims ┐
↓ X Sampled{Float64} LinRange{Float64}(-9.0, 9.0, 100) ForwardOrdered Regular Points,
→ Y Sampled{Float64} LinRange{Float64}(0.0, 18.0, 100) ForwardOrdered Regular Points,
↗ Ti Sampled{Float64} LinRange{Float64}(0.0, 18.84955592153876, 100) ForwardOrdered Regular Points
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
[:, :, 1]
⋮ ⋱
julia> DimTable(da; preservedims=(Ti,))
DimTable with 100 rows, 2 columns, and schema:
:Ti … Float64
:layer1 DimMatrix{Float64, Tuple{X{Sampled{Float64, LinRange{Float64, Int64}, ForwardOrdered, Regular{Float64}, Points, NoMetadata}}, Y{Sampled{Float64, LinRange{Float64, Int64}, ForwardOrdered, Regular{Float64}, Points, NoMetadata}}}, Tuple{Ti{Sampled{Float64, LinRange{Float64, Int64}, ForwardOrdered, Regular{Float64}, Points, NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Slice{OneTo{Int64}}, Slice{OneTo{Int64}}, Int64}, true}, Symbol, NoMetadata} where I would have expected the dimtable to have columns |
Thats what I thought it did too 😆 |
Co-authored-by: Anshul Singhvi <[email protected]>
Forgot to PR this a while ago
Closes #896
@asinghvi17 want to review?