dttrugman / GrowClust3D.jl

Julia-based implementation of GrowClust relative earthquake relocation.
GNU General Public License v3.0
46 stars 7 forks source link

Undocumented dependency on packages DataFrames and Proj #4

Closed zduputel closed 9 months ago

zduputel commented 9 months ago

A minor issue when running the code from a fresh julia installation:

$ julia run_growclust3D.jl vsup_nllgrid3D.inp
ERROR: LoadError: ArgumentError: Package DataFrames not found in current path.
- Run `import Pkg; Pkg.add("DataFrames")` to install the DataFrames package.
Stacktrace: (...)

which can be easily solved by running import Pkg; Pkg.add("DataFrames") in julia as prescribed. Then

$ julia run_growclust3D.jl vsup_nllgrid3D.inp
ERROR: LoadError: ArgumentError: Package Proj not found in current path.
- Run `import Pkg; Pkg.add("Proj")` to install the Proj package.
Stacktrace:

that can also be solved with import Pkg; Pkg.add("Proj").

dttrugman commented 9 months ago

Interesting, thanks for letting me know. I could not replicate this issue with a fresh installation of Julia on a new computer server, setup following these instructions (https://julialang.org/downloads/platform/#linux_and_freebsd). All tests passed after adding GrowClust3D without explicitly adding any other packages.

I also confirmed Proj, DataFrames, etc are in the Project.toml.

Are you certain the Julia instance you are calling is properly installed and is the same one you added GrowClust3D to?

zduputel commented 9 months ago

I installed julia following the instructions at: https://julialang.org/downloads/ (i.e., just by running curl -fsSL https://install.julialang.org | sh)

I then installed growclust using pkg> add https://github.com/dttrugman/GrowClust3D.jl and tested the installation pkg> test GrowClust3D (no issue reported during the test). The aforementioned errors only appeared when running run_growclust3D.jl... The problem was solved after running

import Pkg
Pkg.add("DataFrames")
Pkg.add("Proj")

Here is my current configuration:

$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS (fossa-ditto X84)"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0 (2023-12-25)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg

julia> Pkg.status()
Status `~/.julia/environments/v1.10/Project.toml`
  [a93c6f00] DataFrames v1.6.1
  [59dc28db] GrowClust3D v0.1.0 `https://github.com/dttrugman/GrowClust3D.jl#master`
  [c94c279d] Proj v1.7.0
dttrugman commented 9 months ago

I see what you mean, thanks. DataFrames and Proj are both bundled with the GrowClust3D package but the example scripts also use DataFrames functionality outside the exported functions (the same is not true for Proj).

I've updated the example scripts to remove the unneeded Proj imports and added documentation to recommend installing DataFrames on top of GrowClust3D.

Thanks for the tip.