JuliaStats/KernelDensity.jl

Grid.jl is deprecated, causes breakage on v0.6

Closed this issue · 13 comments

julia> using KernelDensity
ERROR: LoadError: LoadError: MethodError: no method matching Union(::Type{Distributions.Laplace}, ::Type{Distributions.Logistic}, ::Type{Distributions.SymTriangularDist})
Closest candidates are:
  Union{T}(::Any) at sysimg.jl:53
 in include_from_node1(::String) at ./loading.jl:426
 in include_from_node1(::String) at /Users/tamasnagy/Downloads/julia/usr/lib/julia/sys.dylib:?
 in include_from_node1(::String) at ./loading.jl:426
 in include_from_node1(::String) at /Users/tamasnagy/Downloads/julia/usr/lib/julia/sys.dylib:?
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval(::Module, ::Any) at /Users/tamasnagy/Downloads/julia/usr/lib/julia/sys.dylib:?
 in require(::Symbol) at ./loading.jl:357
 in require(::Symbol) at /Users/tamasnagy/Downloads/julia/usr/lib/julia/sys.dylib:?
while loading /Users/tamasnagy/.julia/v0.6/KernelDensity/src/univariate.jl, in expression starting on line 11
while loading /Users/tamasnagy/.julia/v0.6/KernelDensity/src/KernelDensity.jl, in expression starting on line 12

julia> versioninfo()
Julia Version 0.6.0-dev.376
Commit 2390055 (2016-08-23 16:14 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

julia> Pkg.installed("KernelDensity")
v"0.0.2"

Looks like you're using the very first KernelDensity release, not master. See the list of releases here. The most recent is 0.2.0. Can you try Pkg.update() then using KernelDensity and see what happens?

Or if you've Pkg.pinned it at 0.0.2, you'll need Pkg.free("KernelDensity").

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> Pkg.status()
2 required packages:
 - Gadfly                        0.4.3
 - RDatasets                     0.1.3
31 additional packages:
 - BinDeps                       0.4.2
 - Calculus                      0.1.15
 - Codecs                        0.2.0
 - ColorTypes                    0.2.6
 - Colors                        0.6.6
 - Compat                        0.8.8
 - Compose                       0.4.4
 - Contour                       0.2.0
 - DataArrays                    0.3.8
 - DataFrames                    0.7.8
 - DataStructures                0.4.5
 - Distances                     0.3.2
 - Distributions                 0.10.2
 - FixedPointNumbers             0.1.4
 - FixedSizeArrays               0.2.3
 - GZip                          0.2.20
 - Hexagons                      0.0.4
 - Iterators                     0.1.10
 - JSON                          0.7.0
 - KernelDensity                 0.0.2
 - Loess                         0.0.7
 - Measures                      0.0.3
 - PDMats                        0.4.2
 - Reexport                      0.0.3
 - Rmath                         0.1.2
 - SHA                           0.2.1
 - Showoff                       0.0.7
 - SortingAlgorithms             0.1.0
 - StatsBase                     0.9.0
 - StatsFuns                     0.3.0
 - URIParser                     0.1.6

Not sure what is going on. Neither Gadfly nor RDatasets set a ceiling what KernelDensity version can be installed.

As for freeing...

julia> Pkg.free("KernelDensity")
INFO: Freeing KernelDensity
INFO: Downgrading KernelDensity: v0.2.0 => v0.0.2
INFO: Building Rmath

Weird.

Did you update after freeing?

Yes. It is still stuck at 0.0.2.

julia> Pkg.free("KernelDensity")
INFO: Freeing KernelDensity
INFO: Downgrading KernelDensity: v0.2.0 => v0.0.2
INFO: Building Rmath

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> Pkg.status()
2 required packages:
 - Gadfly                        0.4.3
 - RDatasets                     0.1.3
31 additional packages:
 - BinDeps                       0.4.2
 - Calculus                      0.1.15
 - Codecs                        0.2.0
 - ColorTypes                    0.2.6
 - Colors                        0.6.6
 - Compat                        0.8.8
 - Compose                       0.4.4
 - Contour                       0.2.0
 - DataArrays                    0.3.8
 - DataFrames                    0.7.8
 - DataStructures                0.4.5
 - Distances                     0.3.2
 - Distributions                 0.10.2
 - FixedPointNumbers             0.1.4
 - FixedSizeArrays               0.2.3
 - GZip                          0.2.20
 - Hexagons                      0.0.4
 - Iterators                     0.1.10
 - JSON                          0.7.0
 - KernelDensity                 0.0.2
 - Loess                         0.0.7
 - Measures                      0.0.3
 - PDMats                        0.4.2
 - Reexport                      0.0.3
 - Rmath                         0.1.2
 - SHA                           0.2.1
 - Showoff                       0.0.7
 - SortingAlgorithms             0.1.0
 - StatsBase                     0.9.0
 - StatsFuns                     0.3.0
 - URIParser                     0.1.6

All I did was build the latest master and ran Pkg.add(["Gadfly", "RDatasets"])

Hm. Maybe @tkelman would know what's going on?

I feel like I should have a cape.

So nothing in metadata has upper or lower bounds on KernelDensity. But, KernelDensity 0.01 and 0.02 differ from the rest of its version by depending on Optim. Apparently Pkg decided it would be better to install a really old KernelDensity instead of installing Optim? Or maybe there's a conflict preventing it from doing so? What happens if you do Pkg.add("Optim") ? We should probably add a fake dependency of the earliest KernelDensity versions on Optim, that should fix this.

Pkg.add(["Gadfly", "RDatasets"])

I get a MethodError from that. If you set a separate JULIA_PKGDIR can you come up with a set of steps that reproduces ending up with KernelDensity 0.0.2?

Pkg.add(["Gadfly", "RDatasets"])

I get a MethodError from that. If you set a separate JULIA_PKGDIR can you come up with a set of steps that reproduces ending up with KernelDensity 0.0.2?

I did that off the top of my head. It was actually Pkg.add("Gadfly") and Pkg.add("RDatasets")

Adding Optim didn't help:

julia> Pkg.add("Optim")
INFO: Updating cache of ForwardDiff...
INFO: Installing ForwardDiff v0.2.3
INFO: Installing NaNMath v0.2.1
INFO: Installing Optim v0.6.1
INFO: Installing PositiveFactorizations v0.0.2
INFO: Package database updated

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> Pkg.status()
3 required packages:
 - Gadfly                        0.4.3
 - Optim                         0.6.1
 - RDatasets                     0.1.3
34 additional packages:
 - BinDeps                       0.4.2
 - Calculus                      0.1.15
 - Codecs                        0.2.0
 - ColorTypes                    0.2.6
 - Colors                        0.6.6
 - Compat                        0.8.8
 - Compose                       0.4.4
 - Contour                       0.2.0
 - DataArrays                    0.3.8
 - DataFrames                    0.7.8
 - DataStructures                0.4.5
 - Distances                     0.3.2
 - Distributions                 0.10.2
 - FixedPointNumbers             0.1.4
 - FixedSizeArrays               0.2.3
 - ForwardDiff                   0.2.3
 - GZip                          0.2.20
 - Hexagons                      0.0.4
 - Iterators                     0.1.10
 - JSON                          0.7.0
 - KernelDensity                 0.0.2
 - Loess                         0.0.7
 - Measures                      0.0.3
 - NaNMath                       0.2.1
 - PDMats                        0.4.2
 - PositiveFactorizations        0.0.2
 - Reexport                      0.0.3
 - Rmath                         0.1.2
 - SHA                           0.2.1
 - Showoff                       0.0.7
 - SortingAlgorithms             0.1.0
 - StatsBase                     0.9.0
 - StatsFuns                     0.3.0
 - URIParser                     0.1.6

Oh, I can reproduce actually, when I run from Julia 0.6-dev. So I bet someone might have a Julia upper bound somewhere and that's causing the dependency resolver to end up at a very different solution. I guess out of those 37 packages we can check METADATA for who's been upper-bounding julia.

My mistake - it's not Optim that's the problematic difference between KernelDensity 0.0.2 and later versions, it's Grid.jl which is now deprecated. So either we could add a fake dependency on Grid for the early versions in which case this package will end up effectively deprecated by proxy, and/or replace the Grid dependency with whatever its replacement should be. Interpolations.jl I think?

replace the Grid dependency with whatever its replacement should be. Interpolations.jl I think?

It looks like that would be the best solution.

Issue #34 is already tracking the replacement of Grid.jl so I'm going to close this in favor of that issue.