-
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.
Use preprocessed OGGM data and migrate to pure Julia instead of relyi…
…ng on PyCall (#65) * Add version number to all dependencies * Update CI.yml with new micromamba version * Update environment.yml * Changing python imports * Python environment working in local - testing CI * Update CI.yml - Testing in multiple versions & OS * Update CI.yml * Remove cache environments * Remove unnecessary `which python` * Update CI.yml - bring some specific os info * Rename environment * Update CI.yml - Ask more network variables * Update CI.yml - typo in NetworkOptions * Ping path for Mac - not working for Ubuntu * Update CI.yml - checking path * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update config.jl - remove catch warning * Update CI.yml - Now maybe exporiting global env variable * Update CI.yml - Fix export on environmnet names * Update CI.yml - bump micromamba version * testing idea from the discourse * Update CI.yml * Update action version of `checkout` and `setup-python` * Update CI.yml - fix typo with SSH -> SSL * Update CI.yml - export SSL_CERT_FILE * Update CI.yml - Change Python path * Update CI.yml * Update CI.yml * Update CI.yml - Trying to reproduce past behaviour * Update CI.yml * Update config.jl - remove try's * Update CI.yml - Julia 1.11 * Update CI.yml - remove Python setup and let this to micromamba * Update CI.yml - conda -> micromamba for environment inspection * Remove some redundancy and things that may fail * Update CI.yml * Update CI.yml * [WIP] Removing Python dependencies and migrating to Rasters.jl Ongoing fix, still a few lines missing, and tests have still not been run. * Remove environment.yml file * [WIP] continue the migration, tests of params_construction.jl are passing * Migrate to pure julia (#62) * migrate all 2D files to purejulia * update test references * remove PyCall dependencies in the 1D files * automatic download of preprocessed data + remove DataFrames dependency * try to remove Python from the CI * remove remaining implicit dependencies to Python objects * create get_rgi_paths * fix various bugs * remove absolute paths from get_rgi_paths to make the tests platform agnostic * fix bugs with the climate_2D_step structure * some cleaning * bump version * fix dependencies after rebase --------- Co-authored-by: Facundo Sapienza <fsapienza@berkeley.edu> Co-authored-by: Jordi <jordi.bolibar@gmail.com>
- Loading branch information
1 parent
15f3942
commit a539180
Showing
28 changed files
with
425 additions
and
695 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
Binary file not shown.
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 |
---|---|---|
@@ -1,23 +1,33 @@ | ||
|
||
@kwdef mutable struct Climate1Dstep{F <: AbstractFloat} | ||
@kwdef mutable struct Climate1Dstep{F <: AbstractFloat} | ||
temp::Vector{F} | ||
PDD::Vector{F} | ||
snow::Vector{F} | ||
rain::Vector{F} | ||
gradient::Ref{F} | ||
avg_gradient::Ref{F} | ||
gradient::F | ||
avg_gradient::F | ||
x::Vector{F} | ||
y::Vector{F} | ||
ref_hgt::Ref{F} | ||
ref_hgt::F | ||
end | ||
|
||
@kwdef mutable struct Climate1D{F <: AbstractFloat} | ||
raw_climate::Py # Raw climate dataset for the whole simulation | ||
Base.:(==)(a::Climate1Dstep, b::Climate1Dstep) = a.temp == b.temp && a.PDD == b.PDD && | ||
a.snow == b.snow && a.rain == b.rain && | ||
a.gradient == b.gradient && a.avg_gradient == b.avg_gradient && | ||
a.x == b.x && a.y == b.y && a.ref_hgt == b.ref_hgt | ||
|
||
@kwdef mutable struct Climate1D{F <: AbstractFloat} | ||
raw_climate::RasterStack # Raw climate dataset for the whole simulation | ||
# Buffers to avoid memory allocations | ||
climate_raw_step::Ref{Py} # Raw climate trimmed for the current step | ||
climate_step::Ref{Py} # Climate data for the current step | ||
climate_raw_step::RasterStack # Raw climate trimmed for the current step | ||
climate_step::Dict # Climate data for the current step | ||
climate_2D_step::Climate2Dstep # 2D climate data for the current step to feed to the MB model | ||
longterm_temps::Vector{F} # Longterm temperatures for the ice rheology | ||
avg_temps::Ref{Py} # Intermediate buffer for computing average temperatures | ||
avg_gradients::Ref{Py} # Intermediate buffer for computing average gradients | ||
avg_temps::F # Intermediate buffer for computing average temperatures | ||
avg_gradients::F # Intermediate buffer for computing average gradients | ||
end | ||
|
||
Base.:(==)(a::Climate1D, b::Climate1D) = a.raw_climate == b.raw_climate && a.climate_raw_step == b.climate_raw_step && | ||
a.climate_step == b.climate_step && a.climate_2D_step == b.climate_2D_step && | ||
a.longterm_temps == b.longterm_temps && a.avg_temps == b.avg_temps && | ||
a.avg_gradients == b.avg_gradients |
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 |
---|---|---|
@@ -1,25 +1,35 @@ | ||
|
||
export Climate2Dstep, Climate2D | ||
|
||
@kwdef mutable struct Climate2Dstep{F <: AbstractFloat} | ||
@kwdef mutable struct Climate2Dstep{F <: AbstractFloat} | ||
temp::Matrix{F} | ||
PDD::Matrix{F} | ||
snow::Matrix{F} | ||
rain::Matrix{F} | ||
gradient::Ref{F} | ||
avg_gradient::Ref{F} | ||
gradient::F | ||
avg_gradient::F | ||
x::Vector{F} | ||
y::Vector{F} | ||
ref_hgt::Ref{F} | ||
ref_hgt::F | ||
end | ||
|
||
@kwdef mutable struct Climate2D{F <: AbstractFloat} | ||
raw_climate::Py # Raw climate dataset for the whole simulation | ||
Base.:(==)(a::Climate2Dstep, b::Climate2Dstep) = a.temp == b.temp && a.PDD == b.PDD && | ||
a.snow == b.snow && a.rain == b.rain && | ||
a.gradient == b.gradient && a.avg_gradient == b.avg_gradient && | ||
a.x == b.x && a.y == b.y && a.ref_hgt == b.ref_hgt | ||
|
||
@kwdef mutable struct Climate2D{F <: AbstractFloat} | ||
raw_climate::RasterStack # Raw climate dataset for the whole simulation | ||
# Buffers to avoid memory allocations | ||
climate_raw_step::Ref{Py} # Raw climate trimmed for the current step | ||
climate_step::Ref{Py} # Climate data for the current step | ||
climate_raw_step::RasterStack # Raw climate trimmed for the current step | ||
climate_step::Dict # Climate data for the current step | ||
climate_2D_step::Climate2Dstep # 2D climate data for the current step to feed to the MB model | ||
longterm_temps::Vector{F} # Longterm temperatures for the ice rheology | ||
avg_temps::Ref{Py} # Intermediate buffer for computing average temperatures | ||
avg_gradients::Ref{Py} # Intermediate buffer for computing average gradients | ||
avg_temps::F # Intermediate buffer for computing average temperatures | ||
avg_gradients::F # Intermediate buffer for computing average gradients | ||
end | ||
|
||
Base.:(==)(a::Climate2D, b::Climate2D) = a.raw_climate == b.raw_climate && a.climate_raw_step == b.climate_raw_step && | ||
a.climate_step == b.climate_step && a.climate_2D_step == b.climate_2D_step && | ||
a.longterm_temps == b.longterm_temps && a.avg_temps == b.avg_temps && | ||
a.avg_gradients == b.avg_gradients |
Oops, something went wrong.