-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Python config skeleton for stand-alone installation
- Loading branch information
1 parent
7c62ee9
commit d26a8cb
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
function __init__() | ||
|
||
# Create structural folders if needed | ||
OGGM_path = joinpath(homedir(), "Python/OGGM_data") | ||
if !isdir(OGGM_path) | ||
mkpath(OGGM_path) | ||
end | ||
|
||
println("Initializing Python libraries...") | ||
|
||
# Load Python packages | ||
try | ||
copy!(netCDF4, pyimport("netCDF4")) | ||
copy!(cfg, pyimport("oggm.cfg")) | ||
copy!(utils, pyimport("oggm.utils")) | ||
copy!(workflow, pyimport("oggm.workflow")) | ||
copy!(tasks, pyimport("oggm.tasks")) | ||
copy!(global_tasks, pyimport("oggm.global_tasks")) | ||
copy!(graphics, pyimport("oggm.graphics")) | ||
copy!(bedtopo, pyimport("oggm.shop.bedtopo")) | ||
copy!(millan22, pyimport("oggm.shop.millan22")) | ||
copy!(MBsandbox, pyimport("MBsandbox.mbmod_daily_oneflowline")) | ||
copy!(salem, pyimport("salem")) | ||
copy!(pd, pyimport("pandas")) | ||
copy!(xr, pyimport("xarray")) | ||
copy!(rioxarray, pyimport("rioxarray")) | ||
catch e | ||
@warn "It looks like you have not installed and/or activated the virtual Python environment. \n | ||
Please follow the guidelines in: https://github.com/ODINN-SciML/ODINN.jl#readme" | ||
@warn exception=(e, catch_backtrace()) | ||
end | ||
|
||
end | ||
|
||
function clean() | ||
atexit() do | ||
run(`$(Base.julia_cmd())`) | ||
end | ||
exit() | ||
end |
d26a8cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
d26a8cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request updated: JuliaRegistries/General/90604
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: