ImperialCollegeLondon / pyrealm

Development of the pyrealm package, providing an integrated toolbox for modelling plant productivity, growth and demography using Python.
https://pyrealm.readthedocs.io/
MIT License
19 stars 8 forks source link

Verbose mode in SPLASH `estimate_initial_soil_moisture` doesn't handle `np.nan` #192

Closed davidorme closed 5 months ago

davidorme commented 6 months ago

Describe the bug

Running SPLASH using arrays that contain some np.nan values (which is an expected use case - could be water cells in a grid) outputs the following when running estimate_initial_soil_moisture:

In [84]: init_soil_moisture = splash.estimate_initial_soil_moisture(verbose=True)
Iteration: 1; maximum difference: nan
Iteration: 2; maximum difference: nan

Expected behavior

That verbose behaviour should use np.nanmax to give more meaningful progress to convergence.

Edited to add:

To extend this issue with a couple more linked changes: