Skip to content

Commit 8eb6f0c

Browse files
authored
switch to Julia 1.11 + fix env when running tests with include (#161)
* switch to Julia 1.11 + fix env when running tests with include * comment initialize_glaciers JET tests * fix minor bug of #158
1 parent 911e0bf commit 8eb6f0c

File tree

10 files changed

+58
-28
lines changed

10 files changed

+58
-28
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
fail-fast: false
4949
matrix:
5050
version:
51-
- '1.10'
51+
- '1.11'
5252
os:
5353
- ubuntu-latest
5454
- macos-latest

.github/workflows/FormatCheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Julia
1616
uses: julia-actions/setup-julia@v2
1717
with:
18-
version: '1.10'
18+
version: '1.11'
1919

2020
- name: Install JuliaFormatter and format
2121
run: |

Project.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Contour = "0.6"
5353
CoordRefSystems = "0.16, 0.17, 0.18, 0.19"
5454
DataStructures = "0.18, 0.19"
5555
DateFormats = "0.1"
56-
Dates = "1.10"
56+
Dates = "1.11"
5757
DimensionalData = "0.29"
58-
Distributed = "1.10"
58+
Distributed = "1.11"
5959
Downloads = "1"
6060
FFTW = "1"
6161
GR = "0.73"
@@ -70,16 +70,16 @@ MLStyle = "0.4"
7070
NCDatasets = "0.14"
7171
NaNStatistics = "0.6"
7272
Observables = "0.5"
73-
Pkg = "1.10"
74-
Printf = "1.10"
73+
Pkg = "1.11"
74+
Printf = "1.11"
7575
Rasters = "0.13, 0.14"
7676
Revise = "3"
7777
Statistics = "1"
7878
Tar = "1"
79-
Test = "1.10"
79+
Test = "1.11"
8080
Unitful = "1"
8181
Zygote = "0.7"
82-
julia = "1.10"
82+
julia = "1.11"
8383

8484
[extras]
8585
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

src/glaciers/data/SurfaceVelocityData_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ function initialize_surfacevelocitydata_mask(
266266

267267
# Unreliable pixels are indicated with 0
268268
# Reliable pixels are indicated with 1
269-
return flagRast_subset.layer1.data .== 1
269+
return flagRast_subset.fmask.data .== 1
270270
end
271271

272272
"""

src/glaciers/glacier/Glacier2D.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,20 +165,20 @@ function Glacier2D(;
165165
rgi_id::String = "",
166166
name::String = "",
167167
climate::Climate2D = nothing,
168-
H₀::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
169-
H_glathida::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
170-
S::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
171-
B::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
172-
V::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
173-
Vx::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
174-
Vy::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
168+
H₀::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
169+
H_glathida::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
170+
S::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
171+
B::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
172+
V::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
173+
Vx::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
174+
Vy::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
175175
A::F = 0.0,
176176
C::F = 0.0,
177177
n::F = 0.0,
178178
p::F = 0.0,
179179
q::F = 0.0,
180-
slope::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
181-
dist_border::Matrix{F} = Matrix{Sleipnir.Float64}(undef, 0, 0),
180+
slope::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
181+
dist_border::Matrix{F} = Matrix{Sleipnir.Float}(undef, 0, 0),
182182
mask::BitMatrix = BitMatrix(undef, 0, 0),
183183
mask_loss::BitMatrix = BitMatrix(undef, 0, 0),
184184
Coords::Dict{String, Vector{Float64}} = Dict{String, Vector{Float64}}(

test/glaciers_construction.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function glaciers2D_constructor(; save_refs::Bool = false, use_glathida_data::Bo
3232

3333
glaciers = initialize_glaciers(rgi_ids, params)
3434
# For the moment this is not type stable because of the readings (type of CSV files and RasterStack cannot be determined at compilation time)
35-
JET.@test_opt broken=true target_modules=(Sleipnir,) initialize_glaciers(
36-
rgi_ids, params)
35+
# JET.@test_opt broken=true target_modules=(Sleipnir,) initialize_glaciers(
36+
# rgi_ids, params)
3737

3838
# Test prints
3939
println(glaciers)

test/results.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ function results_default(; save_refs::Bool = false, useDatacube::Bool = false)
2626
glaciers = initialize_glaciers(rgi_ids, params;
2727
velocityDatacubes = Dict{String, RasterStack}(rgi_ids[1] => fakeRasterStack))
2828
# For the moment this is not type stable because of the readings (type of CSV files and RasterStack cannot be determined at compilation time)
29-
JET.@test_opt broken=true target_modules=(Sleipnir,) initialize_glaciers(
30-
rgi_ids, params;
31-
velocityDatacubes = Dict{String, RasterStack}(rgi_ids[1]=>fakeRasterStack))
29+
# JET.@test_opt broken=true target_modules=(Sleipnir,) initialize_glaciers(
30+
# rgi_ids, params;
31+
# velocityDatacubes = Dict{String, RasterStack}(rgi_ids[1]=>fakeRasterStack))
3232
prefix = "_vel"
3333
else
3434
glaciers = initialize_glaciers(rgi_ids, params)
3535
# For the moment this is not type stable because of the readings (type of CSV files and RasterStack cannot be determined at compilation time)
36-
JET.@test_opt broken=true target_modules=(Sleipnir,) initialize_glaciers(
37-
rgi_ids, params)
36+
# JET.@test_opt broken=true target_modules=(Sleipnir,) initialize_glaciers(
37+
# rgi_ids, params)
3838
prefix = ""
3939
end
4040

test/runtests.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
import Pkg
2-
Pkg.activate(dirname(Base.current_project()))
2+
function is_included_in_repl()
3+
for frame in StackTraces.stacktrace()
4+
if occursin("start_repl_backend", string(frame.func))
5+
return true
6+
end
7+
end
8+
return false
9+
end
10+
11+
if is_included_in_repl()
12+
# The Project.toml of the test environment to be used when running with include is in a subfolder to avoid that Julia uses this file in test mode
13+
Pkg.instantiate()
14+
Pkg.activate(dirname(Base.current_project())*"/test/test_env/")
15+
end
316

417
if !parse(Bool, get(ENV, "CI", "false"))
518
using Revise

test/surface_velocity.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ function surface_velocity_data()
4040
)
4141
glaciers = initialize_glaciers(rgi_ids, params)
4242
# For the moment this is not type stable because of the readings (type of CSV files and RasterStack cannot be determined at compilation time)
43-
JET.@test_opt broken=true target_modules=(Sleipnir,) initialize_glaciers(
44-
rgi_ids, params)
43+
# JET.@test_opt broken=true target_modules=(Sleipnir,) initialize_glaciers(
44+
# rgi_ids, params)
4545

4646
@testset "Fake interpolated datacube w glacier gridding" begin
4747
fakeRasterStack = Sleipnir.fake_interpolated_datacube()

test/test_env/Project.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[deps]
2+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
4+
DateFormats = "44557152-fe0a-4de1-8405-416d90313ce6"
5+
DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0"
6+
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"
7+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
8+
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
9+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
10+
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
11+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
12+
Rasters = "a3a2b9e3-a471-40c9-b274-f788e487c689"
13+
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
14+
Sleipnir = "f5e6c550-199f-11ee-3608-394420200519"
15+
16+
[sources]
17+
Sleipnir = {path = "../../"}

0 commit comments

Comments
 (0)