Skip to content

test_compute_discharge fails case 2 (vertical wall scenario)

Code Review (#55 (closed)) found the following:

test_discharge.py

The function test_compute_discharge() fails on Test case 2 (vertical wall scenario). This test fails due to the edges not being zero depth/flow and the logic assuming that the end points are zero depth/flow.

Other notes on the test_compute_discharge() function:

Test 4: With only three points in the section.

The minimum for Mid-section is 3 points but the way this computes it uses the end points as the edges; this only works as mid-section method if the end point are not at the edge of water. If the edges were masked points would be lost.

Test 5: Handling of NaN values in velocity input.

This calculates the segment with the v=NAN as zero I think there should be some interpolation done between the segments; This may already be done somewhere else.