{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaCollections/DataStructures.jl/issues/394","repository_url":"https://api.github.com/repos/JuliaCollections/DataStructures.jl","labels_url":"https://api.github.com/repos/JuliaCollections/DataStructures.jl/issues/394/labels{/name}","comments_url":"https://api.github.com/repos/JuliaCollections/DataStructures.jl/issues/394/comments","events_url":"https://api.github.com/repos/JuliaCollections/DataStructures.jl/issues/394/events","html_url":"https://github.com/JuliaCollections/DataStructures.jl/issues/394","id":339260362,"node_id":"MDU6SXNzdWUzMzkyNjAzNjI=","number":394,"title":"OrderedDict Key Not Found","user":{"login":"RobertRosca","id":32569096,"node_id":"MDQ6VXNlcjMyNTY5MDk2","avatar_url":"https://avatars0.githubusercontent.com/u/32569096?v=4","gravatar_id":"","url":"https://api.github.com/users/RobertRosca","html_url":"https://github.com/RobertRosca","followers_url":"https://api.github.com/users/RobertRosca/followers","following_url":"https://api.github.com/users/RobertRosca/following{/other_user}","gists_url":"https://api.github.com/users/RobertRosca/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertRosca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertRosca/subscriptions","organizations_url":"https://api.github.com/users/RobertRosca/orgs","repos_url":"https://api.github.com/users/RobertRosca/repos","events_url":"https://api.github.com/users/RobertRosca/events{/privacy}","received_events_url":"https://api.github.com/users/RobertRosca/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-08T21:42:12Z","updated_at":"2018-07-09T09:47:16Z","closed_at":null,"author_association":"NONE","body":"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.\r\n\r\nFor example, I have:\r\n\r\n```\r\nDataStructures.OrderedDict{Int64,JAXTAM.GTIData} with 320 entries:\r\n  3   => JAXTAM.GTIData(:nustar, :FPMA, \"10002008001\", 1.0, 3, 3, [8, 7, 10, 6, 11, 14, 15, 13, 9, 8  …  6, 6, 9, 10…\r\n  4   => JAXTAM.GTIData(:nustar, :FPMA, \"10002008001\", 1.0, 4, 42, [8, 10, 17, 12, 21, 13, 19, 8, 14, 16  …  14, 10,…\r\n  5   => JAXTAM.GTIData(:nustar, :FPMA, \"10002008001\", 1.0, 5, 150, [6, 10, 14, 2, 16, 14, 8, 13, 19, 14  …  8, 10, …\r\n  7   => JAXTAM.GTIData(:nustar, :FPMA, \"10002008001\", 1.0, 7, 389, [12, 16, 15, 13, 8, 15, 20, 6, 10, 11  …  11, 9,…\r\n⋮\r\n```\r\n\r\nWhere `3`, `4`, `5`, `7`, etc... are the integer keys:\r\n\r\n```\r\nBase.KeyIterator for a DataStructures.OrderedDict{Int64,JAXTAM.GTIData} with 320 entries. Keys:\r\n  3\r\n  4\r\n  5\r\n  7\r\n⋮\r\n```\r\n\r\nBut for some reason, if I try and access the key by doing `gtis[3]` (with `gtis` 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.\r\n\r\nHave I misunderstood something? This problem only happens if I use ordered dicts, I looked through the docs but couldn't figure anything out."},"comment":{"url":"https://api.github.com/repos/JuliaCollections/DataStructures.jl/issues/comments/403423191","html_url":"https://github.com/JuliaCollections/DataStructures.jl/issues/394#issuecomment-403423191","issue_url":"https://api.github.com/repos/JuliaCollections/DataStructures.jl/issues/394","id":403423191,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzQyMzE5MQ==","user":{"login":"oxinabox","id":5127634,"node_id":"MDQ6VXNlcjUxMjc2MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5127634?v=4","gravatar_id":"","url":"https://api.github.com/users/oxinabox","html_url":"https://github.com/oxinabox","followers_url":"https://api.github.com/users/oxinabox/followers","following_url":"https://api.github.com/users/oxinabox/following{/other_user}","gists_url":"https://api.github.com/users/oxinabox/gists{/gist_id}","starred_url":"https://api.github.com/users/oxinabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxinabox/subscriptions","organizations_url":"https://api.github.com/users/oxinabox/orgs","repos_url":"https://api.github.com/users/oxinabox/repos","events_url":"https://api.github.com/users/oxinabox/events{/privacy}","received_events_url":"https://api.github.com/users/oxinabox/received_events","type":"User","site_admin":false},"created_at":"2018-07-09T09:47:16Z","updated_at":"2018-07-09T09:47:16Z","author_association":"MEMBER","body":"My suspicion is confirmed.\r\nBy changing \r\n\r\nhttps://github.com/JuliaCollections/DataStructures.jl/blob/437f0bf371da24d3d749b34c80d40effe814997e/src/dict_sorting.jl#L16\r\n\r\nto\r\n```\r\n idx = ht_keyindex2(d, key)\r\n```"}}
{"actor":{"display_login":"oxinabox"}}