Skip to content

Commit

Permalink
ENH: Add typing in g704.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanSkocic committed Jun 29, 2024
1 parent 5d81d06 commit 41c4a5e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions py/src/pyiapws/g704.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""IAPWS G704."""
from typing import Union, List
import numpy as np
import array
from . import g704_


def kh(T: np.ndarray, gas: str, heavywater: bool=False):
def kh(T: np.ndarray, gas: str, heavywater: bool=False)->Union[np.ndarray, float]:
"""
Get the Henry constant for gas in H2O or D2O at T.
If gas not found returns NaNs.
Expand Down Expand Up @@ -48,7 +49,7 @@ def kh(T: np.ndarray, gas: str, heavywater: bool=False):
return k


def kd(T: np.ndarray, gas: str, heavywater: bool=False):
def kd(T: np.ndarray, gas: str, heavywater: bool=False)->Union[np.ndarray, float]:
"""
Get the vapor-liquid constant for gas in H2O or D2O at T.
If gas not found returns NaNs.
Expand Down Expand Up @@ -85,7 +86,7 @@ def kd(T: np.ndarray, gas: str, heavywater: bool=False):
return g704_.kd(T_, gas_, heavywater_)


def ngases(heavywater:bool=False):
def ngases(heavywater:bool=False)->int:
"""
Get the number of available gases.
Expand All @@ -102,7 +103,7 @@ def ngases(heavywater:bool=False):
return g704_.ngases(heavywater)


def gases(heavywater: bool=False):
def gases(heavywater: bool=False)->List[str]:
"""
Get the list of available gases.
Expand All @@ -119,7 +120,7 @@ def gases(heavywater: bool=False):
return g704_.gases(heavywater)


def gases2(heavywater: bool=False):
def gases2(heavywater: bool=False)->str:
"""
Get the available gases as a string.
Expand Down

0 comments on commit 41c4a5e

Please sign in to comment.