Skip to content

Commit 5a92a4f

Browse files
committed
Move print options to the test setup
1 parent 27db7d7 commit 5a92a4f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

flopy4/xarray_jinja/filters.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
31
import numpy as np
42
import xarray as xr
53

@@ -11,6 +9,4 @@ def dask_expand(data: xr.DataArray):
119

1210

1311
def nparray2string(data: np.ndarray):
14-
return np.array2string(
15-
data, separator=" ", precision=4, max_line_width=sys.maxsize
16-
)[1:-1] # remove brackets
12+
return np.array2string(data, separator=" ")[1:-1] # remove brackets

test/test_xarray_io.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ def create_and_write_jinja(tmp_path, data: xr.DataArray):
6565
generator = env.get_template("disu_template.disu.jinja").generate(
6666
data=data
6767
)
68-
with open(tmp_path / "test_xarray_to_text_jinja.disu", "w") as f:
69-
f.writelines(generator)
68+
with np.printoptions(precision=4, linewidth=sys.maxsize):
69+
with open(tmp_path / "test_xarray_to_text_jinja.disu", "w") as f:
70+
f.writelines(generator)
7071

7172

7273
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)