Code duplication in the discharge_tools module
The code review (#55 (closed)) found potential errors related to code duplication. The result leads to errors in the displayed value of channel section widths in the Discharge Stations table. The final computed discharge appears unaffected.
Manual evaluation: I conducted a spot check of the codebase focusing on loops, function calls, concurrency, and overall structure. Overall, everything appears to be in good shape. However, I found a potential issue with code duplication. In the discharge_tools.py module, the function compute_discharge() performs a calculation similar to that of the create_discharge_data.df() function in the discharge.py module. I suspect that create_discharge_data.df() may be responsible for width miscalculations in the Discharge Summary Table.
The widths in this table do not undergo the same logic checks as those in the compute_discharge() function. This width miscalculation in this table don't impact the final results, as demonstrated with this manual calculation of section 3 here:
width = ((distance from initial point to next location) - (distance from initial point to preceding location)) / 2
-- width = (16.214 - 9.202) / 2 = 3.506 ft.
Q = Area * Surface Velocity * Alpha
-- Q = (3.506 ft. * 3.761 ft.) * (3.256 ft/s) * 0.85 = 36.49 ft³/sec