In the current implementation of calculate_slope()
https://github.com/fema-ffrd/overflow/blob/main/src/overflow/_flow_direction/flow_direction.py#L93C1-L94C22
if dem[row + dy, col + dx] == nodata_value or np.isnan(dem[row + dy, col + dx]):
return np.inf
This value is used inside flow_direction_for_tile():
slope = calculate_slope(dem, row, col, dy, dx, nodata_value)
if slope > max_slope:
max_slope = slope
max_index = i
if slope > 0:
all_non_positive = False
Because max_slope is initialised to -np.inf:
Implies that any np.inf returned from calculate_slope() always becomes the maximum slope. Just checking that the calculate_slope should return -np.inf?
In the current implementation of
calculate_slope()https://github.com/fema-ffrd/overflow/blob/main/src/overflow/_flow_direction/flow_direction.py#L93C1-L94C22
This value is used inside
flow_direction_for_tile():Because
max_slopeis initialised to -np.inf:Implies that any
np.infreturned fromcalculate_slope()always becomes the maximum slope. Just checking that thecalculate_slopeshould return -np.inf?