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 showing NcVar with no data #118

Open
visr opened this issue Feb 29, 2020 · 1 comment
Open

error showing NcVar with no data #118

visr opened this issue Feb 29, 2020 · 1 comment

Comments

@visr
Copy link
Member

visr commented Feb 29, 2020

This is with NetCDF.jl master on Julia 1.4-rc2

julia> using NetCDF

julia> d = NcDim("Dim1", 1)
NcDim(-1, -1, -1, "Dim1", 0x0000000000000001, Any[], Dict{Any,Any}(), false)

julia> v = NcVar("v1", [d])
Disk Array with size 1


julia> @show v
ERROR: NetCDF error code -33:
        NetCDF: Not a valid ID
Stacktrace:
 [1] check at C:\Users\visser_mn\.julia\packages\NetCDF\SFmQh\src\netcdf_helpers.jl:22 [inlined]
 [2] nc_get_vara_double(::Int32, ::Int32, ::Array{UInt64,1}, ::Array{UInt64,1}, ::Array{Float64,1}) at C:\Users\visser_mn\.julia\packages\NetCDF\SFmQh\src\netcdf_c.jl:2486
 [3] nc_get_vara_x! at C:\Users\visser_mn\.julia\packages\NetCDF\SFmQh\src\NetCDF.jl:465 [inlined]
 [4] readvar!(::NcVar{Float64,1,6}, ::Array{Float64,1}; start::Array{Int64,1}, count::Array{Int64,1}) at C:\Users\visser_mn\.julia\packages\NetCDF\SFmQh\src\NetCDF.jl:343
 [5] readblock!(::NcVar{Float64,1,6}, ::Array{Float64,1}, ::UnitRange{Int64}) at C:\Users\visser_mn\.julia\packages\NetCDF\SFmQh\src\NetCDF.jl:218
 [6] getindex_disk at C:\Users\visser_mn\.julia\packages\DiskArrays\RJ0eT\src\DiskArrays.jl:36 [inlined]
 [7] getindex at C:\Users\visser_mn\.julia\packages\DiskArrays\RJ0eT\src\DiskArrays.jl:158 [inlined]
 [8] isassigned(::NcVar{Float64,1,6}, ::Int64) at .\abstractarray.jl:404
 [9] show_delim_array(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::NcVar{Float64,1,6}, ::Char, ::String, ::Char, ::Bool, ::Int64, ::Int64) at .\show.jl:712
 [10] show_delim_array at .\show.jl:705 [inlined]
 [11] show_vector(::Base.GenericIOBuffer{Array{UInt8,1}}, ::NcVar{Float64,1,6}, ::Char, ::Char) at .\arrayshow.jl:458
 [12] show_vector at .\arrayshow.jl:447 [inlined]
 [13] show(::Base.GenericIOBuffer{Array{UInt8,1}}, ::NcVar{Float64,1,6}) at .\arrayshow.jl:420
 [14] sprint(::Function, ::NcVar{Float64,1,6}; context::Nothing, sizehint::Int64) at .\strings\io.jl:105
 [15] #repr#339 at .\strings\io.jl:227 [inlined]
 [16] repr(::NcVar{Float64,1,6}) at .\strings\io.jl:227
 [17] top-level scope at show.jl:613
@meggart
Copy link
Member

meggart commented Mar 9, 2020

I think this is rather a DiskArrays issue, since this package does not define a show method anymore. I will try to find out which method exactly the @show macro is calling, the stack should never end up in arrayshow.jl

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