Skip to content
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

ERROR: KeyError: key :Ti not found #320

Closed
dpabon opened this issue Aug 23, 2023 · 1 comment
Closed

ERROR: KeyError: key :Ti not found #320

dpabon opened this issue Aug 23, 2023 · 1 comment

Comments

@dpabon
Copy link
Contributor

dpabon commented Aug 23, 2023

Doing a rechunking of a Dataset that contains Ti

using Pkg
cd("/Net/Groups/BGI/work_3/OEMC/oemc_towers/")
Pkg.activate("/Net/Groups/BGI/work_3/OEMC/oemc_towers/")

using YAXArrays, CairoMakie, YAXArraysToolbox, Zarr, Statistics,  DiskArrays, DiskArrayTools, Revise, DataFrames, CSV, Plots, ProgressMeter, DimensionalData


YAXArrays.YAXdir("/Net/Groups/BGI/scratch/dpabon/YAXA_tmp")

cubeloc = "/Net/Groups/BGI/scratch/zmhamdi/sen2cube/"

sen2cube = open_dataset(cubeloc)

site_name = "ES-LMa"

site_cube = sen2cube[site = At(site_name)]


site_cube.Ti
site_cube_space = setchunks(site_cube, Dict(:lon_pixel => 1000, :lat_pixel => 1000, :Ti => 1))

savedataset(site_cube_space; path = "/Net/Groups/BGI/scratch/dpabon/ES-LMa_space.zarr", overwrite = true)

Produce

ERROR: KeyError: key :Ti not found
Stacktrace:

getindex(h::Dict{Symbol, Int64}, key::Symbol) at [./dict.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

#93 at [./none](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

iterate at [./generator.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

collect_to!(dest::Vector{Int64}, itr::Base.Generator{Base.KeySet{Symbol, Dict{Symbol, DimensionalData.Dimensions.Dimension}}, YAXArrays.Datasets.var"#93#99"{Dict{Symbol, Int64}}}, offs::Int64, st::Int64) at [./array.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

collect_to_with_first! at [./array.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

collect(itr::Base.Generator{Base.KeySet{Symbol, Dict{Symbol, DimensionalData.Dimensions.Dimension}}, YAXArrays.Datasets.var"#93#99"{Dict{Symbol, Int64}}}) at [./array.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

savedataset(ds::Dataset; path::String, persist::Nothing, overwrite::Bool, append::Bool, skeleton::Bool, backend::Symbol, driver::Symbol, max_cache::Float64, writefac::Float64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) at [/Net/Groups/BGI/people/dpabon/bin/julia_packages/packages/YAXArrays/lvvMa/src/DatasetAPI/Datasets.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

kwcall(::NamedTuple{(:path, :overwrite), Tuple{String, Bool}}, ::typeof(savedataset), ds::Dataset) at [/Net/Groups/BGI/people/dpabon/bin/julia_packages/packages/YAXArrays/lvvMa/src/DatasetAPI/Datasets.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

top-level scope at [/Net/Groups/BGI/work_3/OEMC/oemc_towers/bin/ES-LMa_developing_all_bands.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

ERROR: KeyError: key :Ti not found
Stacktrace:

getindex(h::Dict{Symbol, Int64}, key::Symbol) at [./dict.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

#93 at [./none](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

iterate at [./generator.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

collect_to!(dest::Vector{Int64}, itr::Base.Generator{Base.KeySet{Symbol, Dict{Symbol, DimensionalData.Dimensions.Dimension}}, YAXArrays.Datasets.var"#93#99"{Dict{Symbol, Int64}}}, offs::Int64, st::Int64) at [./array.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

collect_to_with_first! at [./array.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

collect(itr::Base.Generator{Base.KeySet{Symbol, Dict{Symbol, DimensionalData.Dimensions.Dimension}}, YAXArrays.Datasets.var"#93#99"{Dict{Symbol, Int64}}}) at [./array.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

savedataset(ds::Dataset; path::String, persist::Nothing, overwrite::Bool, append::Bool, skeleton::Bool, backend::Symbol, driver::Symbol, max_cache::Float64, writefac::Float64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) at [/Net/Groups/BGI/people/dpabon/bin/julia_packages/packages/YAXArrays/lvvMa/src/DatasetAPI/Datasets.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

kwcall(::NamedTuple{(:path, :overwrite), Tuple{String, Bool}}, ::typeof(savedataset), ds::Dataset) at [/Net/Groups/BGI/people/dpabon/bin/julia_packages/packages/YAXArrays/lvvMa/src/DatasetAPI/Datasets.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

top-level scope at [/Net/Groups/BGI/work_3/OEMC/oemc_towers/bin/ES-LMa_developing_all_bands.jl](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)
@kongdd
Copy link
Contributor

kongdd commented Oct 1, 2023

can close now. solved by #337

@dpabon dpabon closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants