Closed davidorme closed 7 months ago
This is partly resolved by #78 closing #77, but this doesn't document the expectation that forcing variables should not have missing data.
Could use None if using xarrays, but it's slow.
Helper function to check about NAs in the functions that care about NAs, but not in others?
Use a specific error check?
Good description of this here: https://www.residentmar.io/2016/06/12/null-and-missing-data-python.html
This is now covered by #78 and also the more extensive documentation and handling of missing data arising from allowing partial start and end days with the subdaily model in #194.
Describe the bug
The main
PModel
code is not bothered aboutnp.nan
values in inputs - there will be a gap in predictions but it all works. However, thememory_effect
andfill_daily_to_subdaily
methods inFastSlowPModel
iterate over time series and get derailed by missing values.There are various ways this could be handled - and these are most easily dealt with by removing
np.nan
values before fitting models. Then users can decide what to do rather than having baked in approaches. However, the methods should then look fornp.nan
in inputs (perhaps excluding leading and trailingnp.nan
) and raise aValueError
.Expected behavior
xarray.ffill
orscipy.interpolate
etc.