Skip to content

GetTDewPointFromHumRatio fails with NaN input #95

@gsalinas

Description

@gsalinas

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

psychrolib.GetTDewPointFromRelHum(25, np.nan)
psychrolib.GetTDewPointFromHumRatio(np.nan, 0.010, 101325)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions