gher-uliege / DIVAnd.jl

DIVAnd performs an n-dimensional variational analysis of arbitrarily located observations
GNU General Public License v2.0
70 stars 11 forks source link

MethodError: *(::SparseArrays.SparseMatrixCSC #102

Closed ctroupin closed 2 years ago

ctroupin commented 2 years ago

Hello,

when running this simple 2D example:

using HTTP
using CSV
res = HTTP.get("https://www.ncei.noaa.gov/data/oceans/ncei/ocads/data/0001644/GLODAP_gridded.data/C14.data/C14Sta.0.txt");
#It is possible to change the datafile(depth) to read just changing the last number on the url [0 - 5500]
data = CSV.File(res.body);

mask,(pm,pn),(xi,yi) = DIVAnd_rectdom(range(0,stop=50,length=50),
                                                  range(0,stop=50,length=50))
len = (2.5,2.5);
# obs. error variance normalized by the background error variance
epsilon2 = 1.;
# fi is the interpolated field
@time fi,s = DIVAndrun(mask,(pm,pn),(xi,yi),(data.longitude[:],data.latitude[:]),data.c14[:],len,epsilon2);

We got this error:

MethodError: *(::SparseArrays.SparseMatrixCSC{Float64, Int64}, ::BitVector) is ambiguous. Candidates:
  *(A::Union{SparseArrays.AbstractSparseMatrixCSC{TA, Ti}, SubArray{TA, 2, <:SparseArrays.AbstractSparseMatrixCSC{TA, Ti}, Tuple{Base.Slice{Base.OneTo{Int64}}, I}} where I<:AbstractUnitRange} where Ti, x::Union{StridedVector, BitVector}) where TA in SparseArrays at C:\Users\david\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\SparseArrays\src\linalg.jl:50
  *(A::SparseArrays.SparseMatrixCSC, B::BitArray) in DIVAnd at C:\Users\david\.julia\packages\DIVAnd\rJCtr\src\DIVAnd.jl:32
Possible fix, define
  *(::SparseArrays.SparseMatrixCSC{TA}, ::BitVector) where TA

Stacktrace:
  [1] DIVAnd_laplacian(operatortype::Type, mask::BitMatrix, pmn::Tuple{Matrix{Float64}, Matrix{Float64}}, nu::Tuple{Matrix{Float64}, Matrix{Float64}}, iscyclic::BitVector; coeff_laplacian::Vector{Float64})
    @ DIVAnd C:\Users\david\.julia\packages\DIVAnd\rJCtr\src\DIVAnd_laplacian.jl:73
  [2] DIVAnd_operators(operatortype::Type, mask::BitMatrix, pmn::Tuple{Matrix{Float64}, Matrix{Float64}}, nu::Tuple{Matrix{Float64}, Matrix{Float64}}, iscyclic::BitVector, mapindex::Vector{Any}, Labs::Tuple{Matrix{Float64}, Matrix{Float64}}; coeff_laplacian::Vector{Float64})
    @ DIVAnd C:\Users\david\.julia\packages\DIVAnd\rJCtr\src\DIVAnd_operators.jl:59
  [3] DIVAnd_background(operatortype::Type, mask::BitMatrix, pmn::Tuple{Matrix{Float64}, Matrix{Float64}}, Labs::Tuple{Matrix{Float64}, Matrix{Float64}}, alpha::Vector{Any}, moddim::Vector{Any}, scale_len::Bool, mapindex::Vector{Any}; btrunc::Vector{Any}, coeff_laplacian::Vector{Float64}, coeff_derivative2::Vector{Float64})
    @ DIVAnd C:\Users\david\.julia\packages\DIVAnd\rJCtr\src\DIVAnd_background.jl:85
  [4] DIVAndrun(operatortype::Type, mask::BitMatrix, pmnin::Tuple{Matrix{Float64}, Matrix{Float64}}, xiin::Tuple{Matrix{Float64}, Matrix{Float64}}, x::Tuple{Vector{Float64}, Vector{Float64}}, f::Vector{Float64}, lin::Tuple{Float64, Float64}, epsilon2::Float64; velocity::Tuple{}, primal::Bool, factorize::Bool, tol::Float64, maxit::Int64, minit::Int64, constraints::Tuple{}, inversion::Symbol, moddim::Vector{Any}, fracindex::Matrix{Float64}, alpha::Vector{Any}, keepLanczosVectors::Int64, compPC::typeof(DIVAnd_pc_none), progress::DIVAnd.var"#284#286", fi0::Matrix{Float64}, f0::Vector{Float64}, alphabc::Float64, scale_len::Bool, btrunc::Vector{Any}, MEMTOFIT::Float64, topographyforfluxes::Tuple{}, fluxes::Tuple{}, epsfluxes::Int64, epsilon2forfractions::Int64, RTIMESONESCALES::Tuple{}, QCMETHOD::Tuple{}, coeff_laplacian::Vector{Float64}, coeff_derivative2::Vector{Float64})
    @ DIVAnd C:\Users\david\.julia\packages\DIVAnd\rJCtr\src\DIVAndrun.jl:52
  [5] DIVAndrun(operatortype::Type, mask::BitMatrix, pmnin::Tuple{Matrix{Float64}, Matrix{Float64}}, xiin::Tuple{Matrix{Float64}, Matrix{Float64}}, x::Tuple{Vector{Float64}, Vector{Float64}}, f::Vector{Float64}, lin::Tuple{Float64, Float64}, epsilon2::Float64)
    @ DIVAnd C:\Users\david\.julia\packages\DIVAnd\rJCtr\src\DIVAndrun.jl:44
  [6] DIVAndrun(mask::BitMatrix, pmnin::Tuple{Matrix{Float64}, Matrix{Float64}}, xiin::Tuple{Matrix{Float64}, Matrix{Float64}}, x::Tuple{Vector{Float64}, Vector{Float64}}, f::Vector{Float64}, lin::Tuple{Float64, Float64}, epsilon2::Float64; operatortype::Type, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ DIVAnd C:\Users\david\.julia\packages\DIVAnd\rJCtr\src\DIVAndrun.jl:288
  [7] DIVAndrun(mask::BitMatrix, pmnin::Tuple{Matrix{Float64}, Matrix{Float64}}, xiin::Tuple{Matrix{Float64}, Matrix{Float64}}, x::Tuple{Vector{Float64}, Vector{Float64}}, f::Vector{Float64}, lin::Tuple{Float64, Float64}, epsilon2::Float64)
    @ DIVAnd C:\Users\david\.julia\packages\DIVAnd\rJCtr\src\DIVAndrun.jl:288
  [8] top-level scope
    @ .\timing.jl:220 [inlined]
  [9] top-level scope
    @ .\In[27]:0
 [10] eval
    @ .\boot.jl:373 [inlined]
 [11] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:1196

The problem is: I cannot reproduce it on my machine;

Here is the result of Pkg.status() with Julia-1.7.3 running on Windows:

     Status `C:\Users\david\.julia\environments\v1.7\Project.toml`
  [336ed68f] CSV v0.10.4
  [4f4ee721] ClimateTools v0.14.2
  [8f4d0f93] Conda v1.7.0
  [efc8151c] DIVAnd v2.5.1
  [a93c6f00] DataFrames v0.21.8
  [cd3eb016] HTTP v0.8.19
  [7073ff75] IJulia v1.23.3
  [85f8d34a] NCDatasets v0.9.5
  [438e738f] PyCall v1.93.1
  [d330b81b] PyPlot v2.10.0
  [ade2ca70] Dates
  [8bb1440f] DelimitedFiles
  [de0858da] Printf
  [10745b16] Statistics

Code was retested after running Pkg.update(), with the same error.

CC @davidmoncayog

Alexander-Barth commented 2 years ago

Your test case, works for me on DIVAnd 2.7.7. Do you see any difference between your output of ]status --manifest and mine (copied below)?

julia> using DIVAnd

julia> using HTTP

julia> using CSV

julia> res = HTTP.get("https://www.ncei.noaa.gov/data/oceans/ncei/ocads/data/0001644/GLODAP_gridded.data/C14.data/C14Sta.0.txt");

julia> #It is possible to change the datafile(depth) to read just changing the last number on the url [0 - 5500]
       data = CSV.File(res.body);

julia> mask,(pm,pn),(xi,yi) = DIVAnd_rectdom(range(0,stop=50,length=50),
                                                         range(0,stop=50,length=50))
(Bool[1 1 … 1 1; 1 1 … 1 1; … ; 1 1 … 1 1; 1 1 … 1 1], ([0.98 0.98 … 0.98 0.98; 0.98 0.98 … 0.98 0.98; … ; 0.9800000000000011 0.9800000000000011 … 0.9800000000000011 0.9800000000000011; 0.9799999999999977 0.9799999999999977 … 0.9799999999999977 0.9799999999999977], [0.98 0.98 … 0.9800000000000011 0.9799999999999977; 0.98 0.98 … 0.9800000000000011 0.9799999999999977; … ; 0.98 0.98 … 0.9800000000000011 0.9799999999999977; 0.98 0.98 … 0.9800000000000011 0.9799999999999977]), ([0.0 0.0 … 0.0 0.0; 1.0204081632653061 1.0204081632653061 … 1.0204081632653061 1.0204081632653061; … ; 48.97959183673469 48.97959183673469 … 48.97959183673469 48.97959183673469; 50.0 50.0 … 50.0 50.0], [0.0 1.0204081632653061 … 48.97959183673469 50.0; 0.0 1.0204081632653061 … 48.97959183673469 50.0; … ; 0.0 1.0204081632653061 … 48.97959183673469 50.0; 0.0 1.0204081632653061 … 48.97959183673469 50.0]))

julia> len = (2.5,2.5);

julia> # obs. error variance normalized by the background error variance
       epsilon2 = 1.;

julia> # fi is the interpolated field
       @time fi,s = DIVAndrun(mask,(pm,pn),(xi,yi),(data.longitude[:],data.latitude[:]),data.c14[:],len,epsilon2);
 14.800144 seconds (48.86 M allocations: 2.642 GiB, 6.44% gc time, 99.83% compilation time)

julia> typeof(fi)
Matrix{Float64} (alias for Array{Float64, 2})

(DIVAnd-2.7.7) pkg> status --manifest
      Status `/mnt/data1/abarth/.julia/environments/DIVAnd-2.7.7/Manifest.toml`
  [79e6a3ab] Adapt v3.3.3
  [2169fc97] AlgebraicMultigrid v0.5.1
  [13072b0f] AxisAlgorithms v1.0.1
  [179af706] CFTime v0.1.2
  [336ed68f] CSV v0.10.4
  [d360d2e6] ChainRulesCore v1.15.1
  [9e997f8a] ChangesOfVariables v0.1.3
  [944b1d66] CodecZlib v0.7.0
  [38540f10] CommonSolve v0.2.1
  [34da2185] Compat v3.45.0
  [efc8151c] DIVAnd v2.7.7
  [9a962f9c] DataAPI v1.10.0
  [864edb3b] DataStructures v0.18.13
  [e2d170a0] DataValueInterfaces v1.0.0
  [ffbed154] DocStringExtensions v0.8.6
  [8f5d6c58] EzXML v1.1.0
  [48062228] FilePathsBase v0.9.18
  [cd3eb016] HTTP v0.9.17
  [83e8ac13] IniFile v0.5.1
  [842dd82b] InlineStrings v1.1.4
  [a98d9a8b] Interpolations v0.13.6
  [3587e190] InverseFunctions v0.1.7
  [92d709cd] IrrationalConstants v0.1.1
  [42fd0dbc] IterativeSolvers v0.9.2
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.4.1
  [2ab3a3ac] LogExpFunctions v0.3.15
  [739be429] MbedTLS v1.1.0
  [e1d29d7a] Missings v1.0.2
  [ffc61752] Mustache v1.0.13
  [85f8d34a] NCDatasets v0.12.5
  [6fe1bfb0] OffsetArrays v1.12.7
  [bac558e1] OrderedCollections v1.4.1
  [69de0a69] Parsers v2.3.2
  [2dfb63ee] PooledArrays v1.4.2
  [21216c6a] Preferences v1.3.0
  [c84ed2f1] Ratios v0.4.3
  [3cdcf5f2] RecipesBase v1.2.1
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.0
  [91c51154] SentinelArrays v1.3.13
  [276daf66] SpecialFunctions v2.1.7
  [90137ffa] StaticArrays v1.5.0
  [1e83bf80] StaticArraysCore v1.0.1
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.7.0
  [3bb67fe8] TranscodingStreams v0.9.6
  [5c2747f8] URIs v1.3.0
  [ea10d353] WeakRefStrings v1.4.2
  [efce3f68] WoodburyMatrices v0.5.5
  [a5390f91] ZipFile v0.9.4
  [0234f1f7] HDF5_jll v1.12.0+1
  [94ce4f54] Libiconv_jll v1.16.1+1
  [7243133f] NetCDF_jll v400.702.400+0
  [458c3c95] OpenSSL_jll v1.1.16+0
  [efe28fd5] OpenSpecFun_jll v0.5.5+0
  [02c8fc9c] XML2_jll v2.9.14+0
Alexander-Barth commented 2 years ago

I am wondering if you restarted Julia after the Pkg.update().

ctroupin commented 2 years ago

ok this seems to be the issue: the package version. The Pkg.update() did not update it in fact, I thought he had restarted but we'll make sure that's the case.

ctroupin commented 2 years ago

Update: DIVAnd cannot be upgraded of dependency issues, which seems strange as it was a fresh Julia installation on Windows. Will try with 1.8 (now it is 1.7.3) but I guess that's not the best solution.

Alexander-Barth commented 2 years ago

Can you paste the message here that you see when you

  1. run this in julia 1.7.3:
]add DIVAnd@2.7.7` 
  1. Restart julia and then:
]activate @temp-env
]add DIVAnd@2.7.7` 

So the output of the command 1. and then the output of commands 2. I would like to know what prevents you to upgrade DIVAnd to version 2.7.7.

Can you in addition also give the output of ]status --manifest ?

ctroupin commented 2 years ago

Sure, I'll ask David to provide that information, it would be easier.

davidmoncayog commented 2 years ago

Hello…Ok, the output for the command 1:

julia> Pkg.status() Status C:\Users\david\.julia\environments\v1.7\Project.toml [336ed68f] CSV v0.10.4 [4f4ee721] ClimateTools v0.14.2 [8f4d0f93] Conda v1.7.0 [efc8151c] DIVAnd v2.5.1 [a93c6f00] DataFrames v0.21.8 [cd3eb016] HTTP v0.8.19 [7073ff75] IJulia v1.23.3 [85f8d34a] NCDatasets v0.9.5 [d41bc354] NLSolversBase v7.8.2 [438e738f] PyCall v1.93.1 [d330b81b] PyPlot v2.10.0 [ade2ca70] Dates [8bb1440f] DelimitedFiles [de0858da] Printf [10745b16] Statistics

@.) pkg> add @. Updating registry at C:\Users\david\.julia\registries\General.toml Resolving package versions... ERROR: Unsatisfiable requirements detected for package NLSolversBase [d41bc354]: NLSolversBase [d41bc354] log: ├─possible versions are: 7.0.0-7.8.2 or uninstalled ├─restricted to versions by an explicit requirement, leaving only versions 7.0.0-7.8.2 ├─restricted by compatibility requirements with Optim [429524aa] to versions: 7.3.1-7.5.0 │ └─Optim [429524aa] log: │ ├─possible versions are: 0.15.3-1.7.0 or uninstalled │ ├─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: [0.18.0-0.18.1, 0.20.0-0.22.0] │ │ └─GeoStatsBase [323cb8eb] log: │ │ ├─possible versions are: 0.2.0-0.25.6 or uninstalled │ │ ├─restricted by compatibility requirements with SpecialFunctions [276daf66] to versions: [0.2.0-0.6.4, 0.8.0-0.25.6] or uninstalled │ │ │ └─SpecialFunctions [276daf66] log: │ │ │ ├─possible versions are: 0.7.0-2.1.7 or uninstalled │ │ │ ├─restricted by compatibility requirements with DIVAnd [efc8151c] to versions: [0.8.0, 0.10.0-2.1.7] │ │ │ │ └─DIVAnd [efc8151c] log: │ │ │ │ ├─possible versions are: 2.1.0-2.7.7 or uninstalled │ │ │ │ └─restricted to versions 2.7.7 by an explicit requirement, leaving only versions 2.7.7 │ │ │ ├─restricted by compatibility requirements with Extremes [fe3fe864] to versions: 0.8.0-0.10.3, leaving only versions: [0.8.0, 0.10.0-0.10.3] │ │ │ │ └─Extremes [fe3fe864] log: │ │ │ │ ├─possible versions are: 0.1.0-0.2.3 or uninstalled │ │ │ │ ├─restricted by compatibility requirements with Distributions [31c24e10] to versions: 0.1.1-0.2.3 or uninstalled │ │ │ │ │ └─Distributions [31c24e10] log: │ │ │ │ │ ├─possible versions are: 0.16.0-0.25.65 or uninstalled │ │ │ │ │ ├─restricted by compatibility requirements with SpecialFunctions [276daf66] to versions: 0.21.6-0.25.65 or uninstalled │ │ │ │ │ │ └─SpecialFunctions [276daf66] log: see above │ │ │ │ │ ├─restricted by compatibility requirements with Extremes [fe3fe864] to versions: 0.18.0-0.22.6, leaving only versions: 0.21.6-0.22.6 │ │ │ │ │ │ └─Extremes [fe3fe864] log: see above │ │ │ │ │ └─restricted by compatibility requirements with SpecialFunctions [276daf66] to versions: 0.22.3-0.25.45 or uninstalled, leaving only versions: 0.22.3-0.22.6 │ │ │ │ │ └─SpecialFunctions [276daf66] log: see above │ │ │ │ ├─restricted by compatibility requirements with ClimateTools [4f4ee721] to versions: 0.1.0-0.1.2, leaving only versions: 0.1.1-0.1.2 │ │ │ │ │ └─ClimateTools [4f4ee721] log: │ │ │ │ │ ├─possible versions are: 0.9.0-0.23.1 or uninstalled │ │ │ │ │ ├─restricted to versions by an explicit requirement, leaving only versions 0.9.0-0.23.1 │ │ │ │ │ ├─restricted by compatibility requirements with NCDatasets [85f8d34a] to versions: 0.18.2-0.23.1 or uninstalled, leaving only versions: 0.18.2-0.23.1 │ │ │ │ │ │ └─NCDatasets [85f8d34a] log: │ │ │ │ │ │ ├─possible versions are: 0.3.0-0.12.5 or uninstalled │ │ │ │ │ │ ├─restricted to versions by an explicit requirement, leaving only versions 0.3.0-0.12.5 │ │ │ │ │ │ ├─restricted by compatibility requirements with DIVAnd [efc8151c] to versions: 0.10.0-0.12.5 │ │ │ │ │ │ │ └─DIVAnd [efc8151c] log: see above │ │ │ │ │ │ └─restricted by compatibility requirements with ClimateTools [4f4ee721] to versions: 0.3.0-0.11.9, leaving only versions: 0.10.0-0.11.9 │ │ │ │ │ │ └─ClimateTools [4f4ee721] log: see above │ │ │ │ │ └─restricted by compatibility requirements with GeoStats [dcc97b0b] to versions: [0.9.0-0.14.2, 0.20.0-0.23.1] or uninstalled, leaving only versions: 0.20.0-0.23.1 │ │ │ │ │ └─GeoStats [dcc97b0b] log: │ │ │ │ │ ├─possible versions are: 0.7.0-0.31.7 or uninstalled │ │ │ │ │ ├─restricted by compatibility requirements with Distributions [31c24e10] to versions: [0.7.0-0.9.0, 0.10.0-0.31.7] or uninstalled │ │ │ │ │ │ └─Distributions [31c24e10] log: see above │ │ │ │ │ ├─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: [0.7.0-0.9.0, 0.10.0-0.10.1, 0.11.0-0.31.7] or uninstalled │ │ │ │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ │ │ │ ├─restricted by compatibility requirements with Variography [04a0146e] to versions: 0.10.2-0.31.7 or uninstalled, leaving only versions: 0.11.0-0.31.7 or uninstalled │ │ │ │ │ │ └─Variography [04a0146e] log: │ │ │ │ │ │ ├─possible versions are: 0.2.0-0.14.5 or uninstalled │ │ │ │ │ │ ├─restricted by compatibility requirements with SpecialFunctions [276daf66] to versions: 0.5.1-0.14.5 or uninstalled │ │ │ │ │ │ │ └─SpecialFunctions [276daf66] log: see above │ │ │ │ │ │ ├─restricted by compatibility requirements with GeoStats [dcc97b0b] to versions: 0.5.0-0.12.25, leaving only versions: 0.5.1-0.12.25 │ │ │ │ │ │ │ └─GeoStats [dcc97b0b] log: see above │ │ │ │ │ │ ├─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: 0.5.1-0.10.1 or uninstalled, leaving only versions: 0.5.1-0.10.1 │ │ │ │ │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ │ │ │ │ ├─restricted by compatibility requirements with GeoStats [dcc97b0b] to versions: 0.5.0-0.8.4, leaving only versions: 0.5.1-0.8.4 │ │ │ │ │ │ │ └─GeoStats [dcc97b0b] log: see above │ │ │ │ │ │ └─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: 0.5.1-0.8.2 or uninstalled, leaving only versions: 0.5.1-0.8.2 │ │ │ │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ │ │ │ ├─restricted by compatibility requirements with ClimateTools [4f4ee721] to versions: 0.11.0-0.26.2 │ │ │ │ │ │ └─ClimateTools [4f4ee721] log: see above │ │ │ │ │ ├─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: 0.11.0-0.17.0 or uninstalled, leaving only versions: 0.11.0-0.17.0 │ │ │ │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ │ │ │ └─restricted by compatibility requirements with GaussianSimulation [e40f437e] to versions: [0.7.0-0.15.1, 0.21.1-0.31.7] or uninstalled, leaving only versions: 0.11.0-0.15.1 │ │ │ │ │ └─GaussianSimulation [e40f437e] log: │ │ │ │ │ ├─possible versions are: 0.1.0-0.4.0 or uninstalled │ │ │ │ │ ├─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: 0.1.0-0.2.0 or uninstalled │ │ │ │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ │ │ │ └─restricted by compatibility requirements with Distributions [31c24e10] to versions: uninstalled │ │ │ │ │ └─Distributions [31c24e10] log: see above │ │ │ │ └─restricted by compatibility requirements with SpecialFunctions [276daf66] to versions: 0.1.2-0.2.3 or uninstalled, leaving only versions: 0.1.2 │ │ │ │ └─SpecialFunctions [276daf66] log: see above │ │ │ └─restricted by compatibility requirements with Variography [04a0146e] to versions: 0.9.0-1.8.7, leaving only versions: 0.10.0-0.10.3 │ │ │ └─Variography [04a0146e] log: see above │ │ ├─restricted by compatibility requirements with Distributions [31c24e10] to versions: [0.2.0-0.4.3, 0.6.1-0.25.6] or uninstalled, leaving only versions: [0.2.0-0.4.3, 0.6.1-0.6.4, 0.8.0-0.25.6] or uninstalled │ │ │ └─Distributions [31c24e10] log: see above │ │ ├─restricted by compatibility requirements with DataFrames [a93c6f00] to versions: [0.2.0-0.4.3, 0.8.0-0.25.6] or uninstalled │ │ │ └─DataFrames [a93c6f00] log: │ │ │ ├─possible versions are: 0.11.7-1.3.4 or uninstalled │ │ │ ├─restricted to versions by an explicit requirement, leaving only versions 0.11.7-1.3.4 │ │ │ ├─restricted by compatibility requirements with ClimateTools [4f4ee721] to versions: [0.19.0-0.21.8, 1.0.0-1.3.4] │ │ │ │ └─ClimateTools [4f4ee721] log: see above │ │ │ ├─restricted by compatibility requirements with Extremes [fe3fe864] to versions: 0.17.0-0.20.2, leaving only versions: 0.19.0-0.20.2 │ │ │ │ └─Extremes [fe3fe864] log: see above │ │ │ ├─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: [0.18.0-0.18.4, 0.20.0-0.21.8], leaving only versions: 0.20.0-0.20.2 │ │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ │ └─restricted by compatibility requirements with Tables [bd369af6] to versions: [0.11.7-0.13.1, 0.20.1-1.3.4] or uninstalled, leaving only versions: 0.20.1-0.20.2 │ │ │ └─Tables [bd369af6] log: │ │ │ ├─possible versions are: 0.1.0-1.7.0 or uninstalled │ │ │ ├─restricted by compatibility requirements with Mustache [ffc61752] to versions: 0.2.0-1.7.0 │ │ │ │ └─Mustache [ffc61752] log: │ │ │ │ ├─possible versions are: 0.4.1-1.0.13 or uninstalled │ │ │ │ ├─restricted by compatibility requirements with DIVAnd [efc8151c] to versions: 1.0.0-1.0.13 │ │ │ │ │ └─DIVAnd [efc8151c] log: see above │ │ │ │ └─restricted by compatibility requirements with Tables [bd369af6] to versions: [0.4.1-0.5.2, 1.0.1-1.0.13] or uninstalled, leaving only versions: 1.0.1-1.0.13 │ │ │ │ └─Tables [bd369af6] log: see above │ │ │ ├─restricted by compatibility requirements with DataFrames [a93c6f00] to versions: 0.2.3-1.7.0 │ │ │ │ └─DataFrames [a93c6f00] log: see above │ │ │ └─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: 1.0.0-1.7.0 │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ ├─restricted by compatibility requirements with GeoStats [dcc97b0b] to versions: [0.7.0-0.17.1, 0.19.0-0.21.13], leaving only versions: [0.8.0-0.17.1, 0.19.0-0.21.13] │ │ │ └─GeoStats [dcc97b0b] log: see above │ │ ├─restricted by compatibility requirements with InverseDistanceWeighting [6a8e3230] to versions: 0.2.2-0.13.0, leaving only versions: 0.8.0-0.13.0 │ │ │ └─InverseDistanceWeighting [6a8e3230] log: │ │ │ ├─possible versions are: 0.2.0-0.4.2 or uninstalled │ │ │ ├─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: [0.2.0-0.2.2, 0.3.0-0.3.1, 0.3.3-0.4.2] or uninstalled │ │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ │ ├─restricted by compatibility requirements with ClimateTools [4f4ee721] to versions: 0.2.0-0.4.2, leaving only versions: [0.2.0-0.2.2, 0.3.0-0.3.1, 0.3.3-0.4.2] │ │ │ │ └─ClimateTools [4f4ee721] log: see above │ │ │ ├─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: 0.3.3-0.4.2 or uninstalled, leaving only versions: 0.3.3-0.4.2 │ │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ │ └─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: 0.3.3-0.4.1 or uninstalled, leaving only versions: 0.3.3-0.4.1 │ │ │ └─GeoStatsBase [323cb8eb] log: see above │ │ └─restricted by compatibility requirements with GeoStats [dcc97b0b] to versions: 0.7.0-0.12.2, leaving only versions: 0.8.0-0.12.2 │ │ └─GeoStats [dcc97b0b] log: see above │ └─restricted by compatibility requirements with Parameters [d96e819e] to versions: 0.19.3-1.7.0 or uninstalled, leaving only versions: 0.20.0-0.22.0 │ └─Parameters [d96e819e] log: │ ├─possible versions are: 0.9.1-0.12.3 or uninstalled │ └─restricted by compatibility requirements with GeoStatsBase [323cb8eb] to versions: 0.12.0-0.12.3 │ └─GeoStatsBase [323cb8eb] log: see above └─restricted by compatibility requirements with Extremes [fe3fe864] to versions: 7.6.0-7.8.2 ― no versions left └─Extremes [fe3fe864] log: see above


Apparently, the command 2 worked, here the output:

@.***) pkg> activate @temp-env Activating new project at C:\Users\david\.julia\environments\temp-env

@.) pkg> add @. Updating registry at C:\Users\david\.julia\registries\General.toml Resolving package versions... Installed OpenSSL_jll ────── v1.1.17+0 Installed SpecialFunctions ─ v2.1.7 Downloaded artifact: OpenSSL Updating C:\Users\david\.julia\environments\temp-env\Project.toml [efc8151c] + DIVAnd v2.7.7 Updating C:\Users\david\.julia\environments\temp-env\Manifest.toml [79e6a3ab] + Adapt v3.3.3 [2169fc97] + AlgebraicMultigrid v0.5.1 [13072b0f] + AxisAlgorithms v1.0.1 [179af706] + CFTime v0.1.2 [d360d2e6] + ChainRulesCore v1.15.1 [9e997f8a] + ChangesOfVariables v0.1.3 [38540f10] + CommonSolve v0.2.1 [34da2185] + Compat v4.1.0 [efc8151c] + DIVAnd v2.7.7 [9a962f9c] + DataAPI v1.10.0 [864edb3b] + DataStructures v0.18.13 [e2d170a0] + DataValueInterfaces v1.0.0 [ffbed154] + DocStringExtensions v0.8.6 [8f5d6c58] + EzXML v1.1.0 [cd3eb016] + HTTP v0.9.17 [83e8ac13] + IniFile v0.5.1 [a98d9a8b] + Interpolations v0.13.6 [3587e190] + InverseFunctions v0.1.7 [92d709cd] + IrrationalConstants v0.1.1 [42fd0dbc] + IterativeSolvers v0.9.2 [82899510] + IteratorInterfaceExtensions v1.0.0 [692b3bcd] + JLLWrappers v1.4.1 [2ab3a3ac] + LogExpFunctions v0.3.15 [739be429] + MbedTLS v1.1.0 [e1d29d7a] + Missings v1.0.2 [ffc61752] + Mustache v1.0.13 [85f8d34a] + NCDatasets v0.12.5 [6fe1bfb0] + OffsetArrays v1.12.7 [bac558e1] + OrderedCollections v1.4.1 [21216c6a] + Preferences v1.3.0 [c84ed2f1] + Ratios v0.4.3 [3cdcf5f2] + RecipesBase v1.2.1 [189a3867] + Reexport v1.2.2 [ae029012] + Requires v1.3.0 [276daf66] + SpecialFunctions v2.1.7 [90137ffa] + StaticArrays v1.5.0 [1e83bf80] + StaticArraysCore v1.0.1 [3783bdb8] + TableTraits v1.0.1 [bd369af6] + Tables v1.7.0 [5c2747f8] + URIs v1.3.0 [efce3f68] + WoodburyMatrices v0.5.5 [a5390f91] + ZipFile v0.9.4 [0234f1f7] + HDF5_jll v1.12.0+1 [94ce4f54] + Libiconv_jll v1.16.1+1 [7243133f] + NetCDF_jll v400.702.400+0 [458c3c95] + OpenSSL_jll v1.1.17+0 [efe28fd5] + OpenSpecFun_jll v0.5.5+0 [02c8fc9c] + XML2_jll v2.9.14+0 [0dad84c5] + ArgTools [56f22d72] + Artifacts [2a0f44e3] + Base64 [ade2ca70] + Dates [8bb1440f] + DelimitedFiles [8ba89e20] + Distributed [f43a241f] + Downloads [7b1f6079] + FileWatching [b77e0a4c] + InteractiveUtils [b27032c2] + LibCURL [76f85450] + LibGit2 [8f399da3] + Libdl [37e2e46d] + LinearAlgebra [56ddb016] + Logging [d6f4376e] + Markdown [a63ad114] + Mmap [ca575930] + NetworkOptions [44cfe95a] + Pkg [de0858da] + Printf [3fa0cd96] + REPL [9a3f8284] + Random [ea8e919c] + SHA [9e88b42a] + Serialization [1a1011a3] + SharedArrays [6462fe0b] + Sockets [2f01184e] + SparseArrays [10745b16] + Statistics [4607b0f0] + SuiteSparse [fa267f1f] + TOML [a4e569a6] + Tar [8dfed614] + Test [cf7118a7] + UUIDs [4ec0a83e] + Unicode [e66e0078] + CompilerSupportLibraries_jll [deac9b47] + LibCURL_jll [29816b5a] + LibSSH2_jll [c8ffd9c3] + MbedTLS_jll [14a3606d] + MozillaCACerts_jll [4536629a] + OpenBLAS_jll [05823500] + OpenLibm_jll [83775a58] + Zlib_jll [8e850b90] + libblastrampoline_jll [8e850ede] + nghttp2_jll [3f19e933] + p7zip_jll Precompiling project... 16 dependencies successfully precompiled in 24 seconds (39 already precompiled)

@.***) pkg> status Status C:\Users\david\.julia\environments\temp-env\Project.toml [efc8151c] DIVAnd v2.7.7


And this is the output of command 3:

@.***) pkg> status --manifest Status C:\Users\david\.julia\environments\temp-env\Manifest.toml [79e6a3ab] Adapt v3.3.3 [2169fc97] AlgebraicMultigrid v0.5.1 [13072b0f] AxisAlgorithms v1.0.1 [179af706] CFTime v0.1.2 [d360d2e6] ChainRulesCore v1.15.1 [9e997f8a] ChangesOfVariables v0.1.3 [38540f10] CommonSolve v0.2.1 [34da2185] Compat v4.1.0 [efc8151c] DIVAnd v2.7.7 [9a962f9c] DataAPI v1.10.0 [864edb3b] DataStructures v0.18.13 [e2d170a0] DataValueInterfaces v1.0.0 [ffbed154] DocStringExtensions v0.8.6 [8f5d6c58] EzXML v1.1.0 [cd3eb016] HTTP v0.9.17 [83e8ac13] IniFile v0.5.1 [a98d9a8b] Interpolations v0.13.6 [3587e190] InverseFunctions v0.1.7 [92d709cd] IrrationalConstants v0.1.1 [42fd0dbc] IterativeSolvers v0.9.2 [82899510] IteratorInterfaceExtensions v1.0.0 [692b3bcd] JLLWrappers v1.4.1 [2ab3a3ac] LogExpFunctions v0.3.15 [739be429] MbedTLS v1.1.0 [e1d29d7a] Missings v1.0.2 [ffc61752] Mustache v1.0.13 [85f8d34a] NCDatasets v0.12.5 [6fe1bfb0] OffsetArrays v1.12.7 [bac558e1] OrderedCollections v1.4.1 [21216c6a] Preferences v1.3.0 [c84ed2f1] Ratios v0.4.3 [3cdcf5f2] RecipesBase v1.2.1 [189a3867] Reexport v1.2.2 [ae029012] Requires v1.3.0 [276daf66] SpecialFunctions v2.1.7 [90137ffa] StaticArrays v1.5.0 [1e83bf80] StaticArraysCore v1.0.1 [3783bdb8] TableTraits v1.0.1 [bd369af6] Tables v1.7.0 [5c2747f8] URIs v1.3.0 [efce3f68] WoodburyMatrices v0.5.5 [a5390f91] ZipFile v0.9.4 [0234f1f7] HDF5_jll v1.12.0+1 [94ce4f54] Libiconv_jll v1.16.1+1 [7243133f] NetCDF_jll v400.702.400+0 [458c3c95] OpenSSL_jll v1.1.17+0 [efe28fd5] OpenSpecFun_jll v0.5.5+0 [02c8fc9c] XML2_jll v2.9.14+0 [0dad84c5] ArgTools [56f22d72] Artifacts [2a0f44e3] Base64 [ade2ca70] Dates [8bb1440f] DelimitedFiles [8ba89e20] Distributed [f43a241f] Downloads [7b1f6079] FileWatching [b77e0a4c] InteractiveUtils [b27032c2] LibCURL [76f85450] LibGit2 [8f399da3] Libdl [37e2e46d] LinearAlgebra [56ddb016] Logging [d6f4376e] Markdown [a63ad114] Mmap [ca575930] NetworkOptions [44cfe95a] Pkg [de0858da] Printf [3fa0cd96] REPL [9a3f8284] Random [ea8e919c] SHA [9e88b42a] Serialization [1a1011a3] SharedArrays [6462fe0b] Sockets [2f01184e] SparseArrays [10745b16] Statistics [4607b0f0] SuiteSparse [fa267f1f] TOML [a4e569a6] Tar [8dfed614] Test [cf7118a7] UUIDs [4ec0a83e] Unicode [e66e0078] CompilerSupportLibraries_jll [deac9b47] LibCURL_jll [29816b5a] LibSSH2_jll [c8ffd9c3] MbedTLS_jll [14a3606d] MozillaCACerts_jll [4536629a] OpenBLAS_jll [05823500] OpenLibm_jll [83775a58] Zlib_jll [8e850b90] libblastrampoline_jll [8e850ede] nghttp2_jll [3f19e933] p7zip_jll


At the moment the command 2 worked to run: julia> using CSV julia> using HTTP julia> using DIVAnd julia> res = HTTP.get("https://www.ncei.noaa.gov/data/oceans/ncei/ocads/data/0001644/GLODAP_gridded.data/C14.data/C14Sta.0.txt"); julia> data = CSV.File(res.body); julia> mask,(pm,pn),(xi,yi) = DIVAnd_rectdom(range(0,stop=50,length=50),range(0,stop=50,length=50)); julia> len = (2.5,2.5); julia> epsilon2 = 1.; julia> @time fi,s = DIVAndrun(mask,(pm,pn),(xi,yi),(data.longitude[:],data.latitude[:]),data.c14[:],len,epsilon2);

But, once restarted Julia…the same error of the beggining appears.

From: Charles @.> Sent: sábado, 9 de julio de 2022 8:16 To: @.> Cc: @.>; @.> Subject: Re: [gher-ulg/DIVAnd.jl] MethodError: *(::SparseArrays.SparseMatrixCSC (Issue #102)

Sure, I'll ask David to provide that information, it would be easier.

― Reply to this email directly, view it on GitHubhttps://github.com/gher-ulg/DIVAnd.jl/issues/102#issuecomment-1179487983, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZ5UMZHMNCNQB75VC6SFHZ3VTEKLHANCNFSM53APATBQ. You are receiving this because you were mentioned.Message ID: @.***>

Alexander-Barth commented 2 years ago

Thank you for the complete information. It is really helpful to have the full error message to know what is the problem.

But, once restarted Julia…the same error of the beggining appears.

Yes, this is expected since with ]activate @temp-env we installed DIVAnd in its separate environment, which is not the default "global" environment. You use this environment by calling ]activate @temp-env before any using commands. (In this case, I strongly encourage you to remove the outdated packages DIVAnd 2.5.1 in your global environment which is really old.)

Or (probably simpler) I would uninstall the problematic package in your global environment. As a test I would try to uninstall this:

]rm ClimateTools

Unfortunately, there are many outdated dependencies of this package https://github.com/JuliaClimate/ClimateTools.jl/pulls

And then try ]add DIVAnd@2.7.7 again in your global environment. If you see still errors, remove some more packages reported by Pkg.status() with a version number (but you will need to keep IJulia :-) ).

Verify that you have at the end DIVAnd 2.7.7 and NCDataset 0.12.5 (which are the latest version).

Alexander-Barth commented 2 years ago

I checked with @davidmoncayog off-line, and the dependency issue is resolved after removing ClimateTools.

(If you want to use ClimateTools, you can install it in a separate environment. Maybe this information is helpful: https://pkgdocs.julialang.org/v1/environments/ )

Feel free to re-open if the issue re-surface :-)

ctroupin commented 2 years ago

Thanks Alex, good to know it's solved that way; I was not sure why he got those issues while starting from a fresh installation.

Alexander-Barth commented 2 years ago

For the record, in Julia 1.8, there will be warnings like these in such situations:

 Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ cannot be upgraded. To see why use `status --outdated`
davidmoncayog commented 1 year ago

The second option worked perfectly!! Now I have the updated packages pkg> status Status C:\Users\david\.julia\environments\v1.7\Project.toml [336ed68f] CSV v0.10.4 [8f4d0f93] Conda v1.7.0 [efc8151c] DIVAnd v2.7.7 [a93c6f00] DataFrames v1.3.4 [cd3eb016] HTTP v0.9.17 [7073ff75] IJulia v1.23.3 [85f8d34a] NCDatasets v0.12.5 [d41bc354] NLSolversBase v7.8.2 [91a5bcdd] Plots v1.31.2 [438e738f] PyCall v1.93.1 [d330b81b] PyPlot v2.10.0 [ade2ca70] Dates [8bb1440f] DelimitedFiles [de0858da] Printf [10745b16] Statistics

Thank you very much!

From: Alexander @.> Sent: sábado, 9 de julio de 2022 22:35 To: @.> Cc: @.>; @.> Subject: Re: [gher-ulg/DIVAnd.jl] MethodError: *(::SparseArrays.SparseMatrixCSC (Issue #102)

But, once restarted Julia…the same error of the beggining appears.

Yes, this is expected since with ]activate @temp-env we installed DIVAnd in its separate environment, which is not the default "global" environment. You use this environment by calling ]activate @temp-env before any using commands. (In this case, I strongly encourage you to remove the outdated packages DIVAnd 2.5.1 in your global environment which is really old.)

Or (probably simpler) I would uninstall the problematic package in your global environment. As a test I would try to uninstall this:

]rm ClimateTools

Unfortunately, there are many outdated dependencies of this package https://github.com/JuliaClimate/ClimateTools.jl/pulls

And then try ]add @.*** again in your global environment. If you see still error, remove some more packages (but you will need to keep IJulia :-) ).

Verify that you have at the end DIVAnd 2.7.7 and NCDataset 0.12.5 (which are the latest version).

— Reply to this email directly, view it on GitHubhttps://github.com/gher-ulg/DIVAnd.jl/issues/102#issuecomment-1179602889, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZ5UMZHQNTE2WAEDYIHYTB3VTHO7FANCNFSM53APATBQ. You are receiving this because you were mentioned.Message ID: @.***>

Alexander-Barth commented 1 year ago

Thanks a lot a following up :-) I guess we can close this issue now. Feel free to re-open and file a new issue if the issue persists.