Skip to content

Commit

Permalink
Fix bench (#1816)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jingru923 committed Sep 16, 2024
1 parent 5ac4e47 commit b1d3994
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .teamcity/Templates/RegressionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ open class RegressionTest (platformOs: String) : Template() {
scriptContent = header +
"""
pixi run python utils/get_benchmark.py %MiniO_credential_token% "benchmark/"
pixi run python utils/get_benchmark.py %MiniO_credential_token% "hws_2024_7_0/"
pixi run python utils/get_benchmark.py %MiniO_credential_token% "hws_migration_test/"
pixi run test-ribasim-regression
""".trimIndent()
}
Expand All @@ -73,4 +73,4 @@ open class RegressionTest (platformOs: String) : Template() {
}

object RegressionTestWindows : RegressionTest("Windows")
object RegressionTestLinux : RegressionTest("Linux")
object RegressionTestLinux : RegressionTest("Linux")
3 changes: 2 additions & 1 deletion core/integration_test/hws_integration_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@testset "Results values" begin
@test basin.node_id == basin_bench.node_id
@test all(q -> abs(q) < 0.01, basin.level - basin_bench.level)
@test all(q -> abs(q) < 0.06, basin.level - basin_bench.level)
end

timed = @timed Ribasim.run(toml_path)
Expand All @@ -27,6 +27,7 @@
performance_diff =
round((timed.time - benchmark_runtime) / benchmark_runtime * 100; digits = 2)
if performance_diff < 0.0
performance_diff = abs(performance_diff)
@info "Runtime is $(timed.time) and it is $performance_diff % faster than benchmark"
elseif performance_diff > 0.0 && performance_diff < 0.2
@info "Runtime is $(timed.time) and it is $performance_diff % slower than benchmark"
Expand Down
4 changes: 2 additions & 2 deletions python/ribasim/tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

@pytest.mark.regression
def test_hws_migration():
toml_path = root_folder / "models/hws_2024_7_0/hws.toml"
db_path = root_folder / "models/hws_2024_7_0/database.gpkg"
toml_path = root_folder / "models/hws_migration_test/hws.toml"
db_path = root_folder / "models/hws_migration_test/database.gpkg"

assert (
toml_path.exists()
Expand Down
2 changes: 1 addition & 1 deletion utils/get_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
minioServer: the access point to MinIO for Deltares
accessKey: the credentials username
secreyKey: input from the terminal, the credentials password
pathToFolder: input from the terminal, the path to the folder to download. E.g. "benchmark/", "hws_2024_7_0/"
pathToFolder: input from the terminal, the path to the folder to download. E.g. "benchmark/", "hws_2024_7_0/", "hws_migration"
"""

minioServer = "s3.deltares.nl"
Expand Down

0 comments on commit b1d3994

Please sign in to comment.