diff options
-rwxr-xr-x | lib/dfatool.py | 9 | ||||
-rwxr-xr-x | lib/plotter.py | 8 | ||||
-rw-r--r-- | lib/utils.py | 9 |
3 files changed, 9 insertions, 17 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py index c5b58ee..93641d0 100755 --- a/lib/dfatool.py +++ b/lib/dfatool.py @@ -44,15 +44,6 @@ def soft_cast_int(n): except ValueError: return n -def float_or_nan(n): - """Convert to float (if numeric) or NaN.""" - if n == None: - return np.nan - try: - return float(n) - except ValueError: - return np.nan - def vprint(verbose, string): """ Print string if verbose. diff --git a/lib/plotter.py b/lib/plotter.py index e4d9926..2398c12 100755 --- a/lib/plotter.py +++ b/lib/plotter.py @@ -6,14 +6,6 @@ import matplotlib.pyplot as plt import re from matplotlib.patches import Polygon -def float_or_nan(n): - if n == None: - return np.nan - try: - return float(n) - except ValueError: - return np.nan - def flatten(somelist): """ Flatten a list. diff --git a/lib/utils.py b/lib/utils.py index 7c28c91..f6a34e3 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -12,6 +12,15 @@ def is_numeric(n): except ValueError: return False +def float_or_nan(n): + """Convert to float (if numeric) or NaN.""" + if n == None: + return np.nan + try: + return float(n) + except ValueError: + return np.nan + def param_slice_eq(a, b, index): """ Check if by_param keys a and b are identical, ignoring the parameter at index. |