-
Notifications
You must be signed in to change notification settings - Fork 1
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
Type piracy? #8
Comments
It also happens only in Julia v1.6, but not v1.5 |
Uh oh, that's not good. To start, I do a kind of nasty trick to lazy-load the data, and that's overloading abstract type Dataset end
struct BetaPictoris <: Dataset end
Base.getindex(::Type{BetaPictoris}, key) = # ... parse key and load data from file the other possibility might be this method, which reaches into HCIDatasets.jl/src/BetaPictoris.jl Lines 20 to 27 in f7bf4f0
any ideas? |
Binary search in the code of HCIDatasets would be my strategy to track down the culprit |
I skimmed through the code, couldn't see anything blatantly pirat-y |
HCIDatasets.jl/src/HCIDatasets.jl Lines 14 to 15 in d52ceed
looks piraty to me since it also applies to HCIDatasets.jl/src/HCIDatasets.jl Line 16 in d52ceed
as well. It's not a good idea to define methods like this on types, better to use instances. |
@KristofferC thanks for the tip. Do you think the piracy is removed if I avoid this- Base.getindex(::Type{<:Dataset}, # ... and instead write this? Base.getindex(::Type{BetaPictoris}, # ... |
I think it would be best to have
and use singletons for the instances (like |
as of da2c812 I switched to using singletons, which worked just like I needed it to. I've since bumped to |
I am not able to reproduce the bug on my build of julia master @giordano
using the exact same command order pkg> activate --temp
pkg> st
pkg> add HCIDatasets
julia> using HCIDatasets
pkg> st output (old version)(@v1.6) pkg> activate --temp
Activating new environment at `/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_J9SAHb/Project.toml`
(jl_J9SAHb) pkg> st
Status `/private/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_J9SAHb/Project.toml` (empty project)
(jl_J9SAHb) pkg> add HCIDatasets
Updating registry at `~/.julia/registries/General`
Resolving package versions...
Updating `/private/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_J9SAHb/Project.toml`
[1893dc6a] + HCIDatasets v0.2.0
Updating `/private/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_J9SAHb/Manifest.toml`
[3b1b4be9] + CFITSIO v1.0.0
[124859b0] + DataDeps v0.7.4
[525bcba6] + FITSIO v0.16.3
[1893dc6a] + HCIDatasets v0.2.0
[cd3eb016] + HTTP v0.9.0
[83e8ac13] + IniFile v0.5.0
[692b3bcd] + JLLWrappers v1.1.3
[739be429] + MbedTLS v1.0.3
[189a3867] + Reexport v0.2.0
[5c2747f8] + URIs v1.0.1
[b3e40c51] + CFITSIO_jll v3.48.0+0
[c8ffd9c3] + MbedTLS_jll v2.24.0+1
[0dad84c5] + ArgTools
[56f22d72] + Artifacts
[2a0f44e3] + Base64
[ade2ca70] + Dates
[f43a241f] + Downloads
[b77e0a4c] + InteractiveUtils
[b27032c2] + LibCURL
[76f85450] + LibGit2
[8f399da3] + Libdl
[56ddb016] + Logging
[d6f4376e] + Markdown
[ca575930] + NetworkOptions
[44cfe95a] + Pkg
[de0858da] + Printf
[3fa0cd96] + REPL
[9a3f8284] + Random
[ea8e919c] + SHA
[9e88b42a] + Serialization
[6462fe0b] + Sockets
[fa267f1f] + TOML
[a4e569a6] + Tar
[8dfed614] + Test
[cf7118a7] + UUIDs
[4ec0a83e] + Unicode
[deac9b47] + LibCURL_jll
[14a3606d] + MozillaCACerts_jll
julia> using HCIDatasets
(jl_J9SAHb) pkg> st
Status `/private/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_J9SAHb/Project.toml`
[1893dc6a] HCIDatasets v0.2.0 output (new version)(@v1.6) pkg> activate --temp
Activating new environment at `/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_ssd5FJ/Project.toml`
(jl_ssd5FJ) pkg> st
Status `/private/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_ssd5FJ/Project.toml` (empty project)
(jl_ssd5FJ) pkg> add HCIDatasets
Updating registry at `~/.julia/registries/General`
Resolving package versions...
Installed HCIDatasets ─ v0.2.1
Updating `/private/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_ssd5FJ/Project.toml`
[1893dc6a] + HCIDatasets v0.2.1
Updating `/private/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_ssd5FJ/Manifest.toml`
[3b1b4be9] + CFITSIO v1.0.0
[124859b0] + DataDeps v0.7.4
[525bcba6] + FITSIO v0.16.3
[1893dc6a] + HCIDatasets v0.2.1
[cd3eb016] + HTTP v0.9.0
[83e8ac13] + IniFile v0.5.0
[692b3bcd] + JLLWrappers v1.1.3
[739be429] + MbedTLS v1.0.3
[189a3867] + Reexport v0.2.0
[5c2747f8] + URIs v1.0.1
[b3e40c51] + CFITSIO_jll v3.48.0+0
[c8ffd9c3] + MbedTLS_jll v2.24.0+1
[0dad84c5] + ArgTools
[56f22d72] + Artifacts
[2a0f44e3] + Base64
[ade2ca70] + Dates
[f43a241f] + Downloads
[b77e0a4c] + InteractiveUtils
[b27032c2] + LibCURL
[76f85450] + LibGit2
[8f399da3] + Libdl
[56ddb016] + Logging
[d6f4376e] + Markdown
[ca575930] + NetworkOptions
[44cfe95a] + Pkg
[de0858da] + Printf
[3fa0cd96] + REPL
[9a3f8284] + Random
[ea8e919c] + SHA
[9e88b42a] + Serialization
[6462fe0b] + Sockets
[fa267f1f] + TOML
[a4e569a6] + Tar
[8dfed614] + Test
[cf7118a7] + UUIDs
[4ec0a83e] + Unicode
[deac9b47] + LibCURL_jll
[14a3606d] + MozillaCACerts_jll
Precompiling project...
Progress [========================================>] 1/1
1 dependency successfully precompiled in 2 seconds (11 already precompiled)
julia> using HCIDatasets
(jl_ssd5FJ) pkg> st
Status `/private/var/folders/g2/n_lg14f56k776c2p35gktr000000gn/T/jl_ssd5FJ/Project.toml`
[1893dc6a] HCIDatasets v0.2.1
|
I made the code in Julia less susceptible to this issue: JuliaLang/julia#38511. |
I can confirm this is fixed now, thanks everybody! |
It is not fixed though. It still type pirates it and any code using the same syntax I did to create such an array will get the same error here. |
It looks like there is type piracy somewhere related to this package:
This doesn't happen with
FITSIO
norDataDeps
only, which are the two dependencies of this package. Unless there is a bad interaction between them, I suspect the type piracy is in this package.The text was updated successfully, but these errors were encountered: