Coverage for C:\src\imod-python\imod\mf6\out\common.py: 92%
13 statements
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-08 14:15 +0200
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-08 14:15 +0200
1import pathlib
2from typing import BinaryIO, Union
4import numpy as np
6# Type annotations
7IntArray = np.ndarray
8FloatArray = np.ndarray
9FilePath = Union[str, pathlib.Path]
12def _grb_text(f: BinaryIO, lentxt: int = 50) -> str:
13 return f.read(lentxt).decode("utf-8").strip().lower()
16def _to_nan(a: FloatArray, dry_nan: bool) -> FloatArray:
17 # TODO: this could really use a docstring?
18 a[a == 1e30] = np.nan
19 if dry_nan:
20 a[a == -1e30] = np.nan
21 return a