-
Notifications
You must be signed in to change notification settings - Fork 246
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
OrderedDict Key Not Found #394
Comments
We'd need a convenient way of reproducing this problem in order to debug it. |
I'm currently on 0.6. I'll see if I can reproduce this in a simpler way than setting up the package I'm working on. Here's an asciinema recording of the issue, if it helps clarify things at all (excuse the slowness, I'm not precompiling my package yet). The testing I've done so far didn't really clarify anything, it just made me more confused if anything:
|
Thanks. For the record, while the asciicinema recording was cool, to save you time in the future that's not necessary. Since JAXTAM isn't a registered package, a link to the repository (I found it) and the steps to reproduce it were all that was needed. But currently I don't think I can help, I get: julia> lc = JAXTAM.lcurve(:nustar, "80002013010", 1);
ERROR: KeyError: key :nustar not found
Stacktrace:
[1] getindex(::Dict{Any,Any}, ::Symbol) at ./dict.jl:474
[2] master(::Symbol) at /tmp/pkgs/v0.6/JAXTAM/src/io/master_tables.jl:112
[3] master_a at /tmp/pkgs/v0.6/JAXTAM/src/io/master_append.jl:124 [inlined]
[4] master_query at /tmp/pkgs/v0.6/JAXTAM/src/io/master_tables.jl:183 [inlined]
[5] #lcurve#46 at /tmp/pkgs/v0.6/JAXTAM/src/science/lcurve.jl:149 [inlined]
[6] lcurve(::Symbol, ::String, ::Int64) at /tmp/pkgs/v0.6/JAXTAM/src/science/lcurve.jl:149 When I try INFO: Building JAXTAM
Installing dependency lftp via `sudo apt-get install lftp`:
[sudo] password for tim:
Reading package lists... Done
Building dependency tree
Reading state information... Done
lftp is already the newest version (4.8.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
======================================================================================[ ERROR: JAXTAM ]======================================================================================
LoadError: Provider BinDeps.PackageManager failed to satisfy dependency lftp
while loading /tmp/pkgs/v0.6/JAXTAM/deps/build.jl, in expression starting on line 65
=============================================================================================================================================================================================
======================================================================================[ BUILD ERRORS ]=======================================================================================
WARNING: JAXTAM had build errors.
- packages with build errors remain installed in /tmp/pkgs/v0.6
- build the package(s) and all dependencies with `Pkg.build("JAXTAM")`
- build a single package by running its `deps/build.jl` script
============================================================================================================================================================================================= This was on Kubuntu 18.04. I've manually installed libhdf5, however, and I still get that I don't have time to figure this out further, sorry. |
Here is a Minimum Failing Example
|
Even more minimal case: It seems not to occur for keys of I don't really follow how
|
My suspicion is confirmed. DataStructures.jl/src/dict_sorting.jl Line 16 in 437f0bf
to
This issue goes away. Actually on further investigation I think that |
Fix #394 with the missing keys after sorting
Hi everyone, I see that the issue is closed but I'm facing it again using
I don't really have a reproducible example 😅 , just want to mention that it happens again and only for that specific index my side. |
@NRHelmi can you check which version of |
@kmsquire I believe the |
I'm 90% sure this is something I've screwed up, but for some reason I get a key not found error for ordered dictionaries. My types are quite long and full of data, but I'm effectively making a Dict with integer keys, then sorting it.
For example, I have:
Where
3
,4
,5
,7
, etc... are the integer keys:But for some reason, if I try and access the key by doing
gtis[3]
(withgtis
as the dict), I get a key not found error. More confusingly, in some (seemingly random) cases it does work for a couple of the keys.Have I misunderstood something? This problem only happens if I use ordered dicts, I looked through the docs but couldn't figure anything out.
The text was updated successfully, but these errors were encountered: