Skip to content

Commit

Permalink
Migrate to pure julia (#15)
Browse files Browse the repository at this point in the history
* [WIP] remove pycall dependencies

* bump version
  • Loading branch information
albangossard authored Jan 23, 2025
1 parent 1dbbcc1 commit 482a249
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
name = "Muninn"
uuid = "4b816528-16ba-4e32-9a2e-3c1bc2049d3a"
uuid = "b6044226-3b0b-478c-8efe-7760f499bf18"
authors = ["Jordi Bolibar <jordi.bolibar@gmail.com>"]
version = "0.3.0"
version = "0.3.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Sleipnir = "f5e6c550-199f-11ee-3608-394420200519"
Sleipnir = "10baed72-45ec-4fdd-b59b-ebd9654d36be"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Infiltrator = "1"
JLD2 = "0.4"
PyCall = "1"
Reexport = "1"
Revise = "3"
Sleipnir = "0.6"
Sleipnir = "0.7.1"
julia = "1.9"

[extras]
Expand Down
1 change: 0 additions & 1 deletion src/Muninn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ using Infiltrator
import Pkg
using Distributed
using Dates
using PyCall

### ODINN.jl dependencies ###
using Reexport
Expand Down
6 changes: 3 additions & 3 deletions src/models/mass_balance/mass_balance_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ end
function MB_timestep(model::Model, glacier::G, step::F, t::F) where {F <: AbstractFloat, G <: AbstractGlacier}
# First we get the dates of the current time and the previous step
period = partial_year(Day, t - step):Day(1):partial_year(Day, t)
climate_step::PyObject = get_cumulative_climate(glacier.climate.sel(time=period))
climate_step::Dict{String, Any} = get_cumulative_climate(glacier.climate[At(period)])
# Convert climate dataset to 2D based on the glacier's DEM
climate_2D_step::PyObject = downscale_2D_climate(climate_step, glacier)
climate_2D_step::Climate2Dstep = downscale_2D_climate(climate_step, glacier)
MB::Matrix{F} = compute_MB(model.mb_model, climate_2D_step)
return MB
end


function MB_timestep!(model::Model, glacier::G, step::F, t; batch_id::Union{Nothing, I} = nothing) where {I <: Integer, F <: AbstractFloat, G <: AbstractGlacier}
# First we get the dates of the current time and the previous step
period = partial_year(Day, t - step):Day(1):partial_year(Day, t)
Expand Down

0 comments on commit 482a249

Please sign in to comment.