You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GetTDewPoint methods (and, therefore, also any other methods that use dew points internally) have an iterative calculation inside them that fails to converge when called with NaN as input.
Result: ValueError: Convergence not reached in GetTDewPointFromVapPres. Stopping.
Expected behavior
Should return NaN, as happens with, e.g., psychrolib.GetHumRatioFromRelHum(25, np.nan, 101325). This also dovetails with supporting vectorised operations; it's helpful & efficient to be able to run the library methods on vectors that include missing data indicated with NaN.
The text was updated successfully, but these errors were encountered:
Thanks to @C-H-Simpson I found out that I was missing the optional numba dependency, and this now mostly works. You get a runtime warning and dew point calculations involving NaN as an argument return 0 for me. I think NaN would be preferable but I'm already much happier with this situation.
Adding to this, when using psychrolib.GetTWetBublFromRelHum with np.nan as an argument for relative humidity gives you a Runtime warning but also produces a viable result with RH ~1. E.g. psychro.GetTWetBulbFromRelHum(20,np.nan,101325) returns 19.99969482421875 whereas psychro.GetTWetBulbFromRelHum(np.nan, 0.5, 101325) returns nan as expected. This behavior extends to ndarrays with np.nan as values.
The GetTDewPoint methods (and, therefore, also any other methods that use dew points internally) have an iterative calculation inside them that fails to converge when called with NaN as input.
To Reproduce
Result:
ValueError: Convergence not reached in GetTDewPointFromVapPres. Stopping.
Expected behavior
Should return NaN, as happens with, e.g.,
psychrolib.GetHumRatioFromRelHum(25, np.nan, 101325)
. This also dovetails with supporting vectorised operations; it's helpful & efficient to be able to run the library methods on vectors that include missing data indicated with NaN.The text was updated successfully, but these errors were encountered: