Skip to content

Commit

Permalink
Merge pull request #200 from Deltares/Road_step_function_test
Browse files Browse the repository at this point in the history
update road step function test
  • Loading branch information
frederique-hub authored Oct 31, 2023
2 parents 93e11c1 + 836c744 commit c2ac97e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_create_step_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

def test_create_step_function():
x = Vulnerability()
name = "roads_2"
name = "roads"
min_hazard_input = 0
max_hazard_input = 15
threshold_value = 0.5
step_hazard_value = 2
x.create_step_function("roads")
x.create_step_function("roads_2")
x.create_step_function(name, threshold_value, min_hazard_input, max_hazard_input, step_hazard_value)



assert x.functions == {'roads': [0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 'roads_2': [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]}
assert x.hazard_values == [0.0, 0.49, 0.5, 0.59, 0.6, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
assert x.functions == {'roads_2': [0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 'roads': [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]}
assert x.hazard_values == [0.0, 0.49, 0.5, 0.59, 0.6, 1, 2.0, 3, 4.0, 5, 6.0, 7, 8.0, 9, 10.0, 11, 13, 15]

0 comments on commit c2ac97e

Please sign in to comment.