Skip to content

Commit

Permalink
Update regression and HWS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Oct 7, 2024
1 parent 92e10d6 commit 8ceffc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions core/integration_test/hws_integration_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

timed = @timed Ribasim.run(toml_path)

# current benchmark is 600s
benchmark_runtime = 600
# current benchmark in seconds
benchmark_runtime = 12
performance_diff =
round((timed.time - benchmark_runtime) / benchmark_runtime * 100; digits = 2)
if performance_diff < 0.0
Expand Down
18 changes: 9 additions & 9 deletions core/regression_test/regression_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
config = Ribasim.Config(toml_path)

solver_list =
["QNDF", "Rosenbrock23", "TRBDF2", "Rodas5", "KenCarp4", "Tsit5", "ImplicitEuler"]
["QNDF", "Rosenbrock23", "TRBDF2", "Rodas5P", "KenCarp4", "Tsit5", "ImplicitEuler"]
sparse_on = [true, false]
autodiff_on = [true, false]

Expand Down Expand Up @@ -38,13 +38,13 @@
# subgrid = Arrow.Table(subgrid_bytes)

@testset "Results values" begin
@test basin.storage[1] 1.0
@test basin.level[1] 0.044711584
@test basin.storage[end] 16.530443267
@test basin.storage[1] 1.0f0
@test basin.level[1] 0.044711584f0
@test basin.storage[end] 16.530443267f0
@test basin.level[end] 0.181817438
@test flow.flow_rate[1] == basin.outflow_rate[1]
@test flow.flow_rate[1] basin.outflow_rate[1]
@test all(q -> abs(q) < 1e-7, basin.balance_error)
@test all(q -> abs(q) < 0.01, basin.relative_error)
@test all(err -> abs(err) < 0.01, basin.relative_error)
end
end
end
Expand Down Expand Up @@ -105,7 +105,7 @@ end
@test all(q -> abs(q) < 1.0, basin.storage - basin_bench.storage)
@test all(q -> abs(q) < 0.5, basin.level - basin_bench.level)
@test all(q -> abs(q) < 1e-3, basin.balance_error)
@test all(q -> abs(q) < 2.5, basin.relative_error)
@test all(err -> abs(err) < 2.5, basin.relative_error)
end
end
end
Expand All @@ -127,7 +127,7 @@ end
flow_bench = Arrow.Table(flow_bytes_bench)
basin_bench = Arrow.Table(basin_bytes_bench)

# TODO "Rosenbrock23" and "Rodas5" solver are resulting unsolvable gradients
# TODO "Rosenbrock23" and "Rodas5P" solver are resulting unsolvable gradients
solver_list = ["QNDF"]
sparse_on = [true, false]
autodiff_on = [true, false]
Expand Down Expand Up @@ -167,7 +167,7 @@ end
@test basin.node_id == basin_bench.node_id
@test all(q -> abs(q) < 100.0, basin.storage - basin_bench.storage)
@test all(q -> abs(q) < 0.5, basin.level - basin_bench.level)
@test all(q -> abs(q) < 1e-3, basin.balance_error)
@test all(err -> abs(err) < 1e-3, basin.balance_error)
end
end
end
Expand Down

0 comments on commit 8ceffc7

Please sign in to comment.