From 15aa44c713eace3a1dd874f4a26c1801ca4d4cc3 Mon Sep 17 00:00:00 2001 From: Paige Martin Date: Mon, 27 Jun 2022 18:15:00 -0400 Subject: [PATCH 1/7] Add nan land mask shrinking + tests --- source/aerobulk/flux.py | 53 ++++++++++------ source/fortran/mod_aerobulk_wrap_skin.pyf | 2 +- tests/test_flux_np.py | 75 +++++++++++++++++++++++ 3 files changed, 110 insertions(+), 20 deletions(-) create mode 100644 tests/test_flux_np.py diff --git a/source/aerobulk/flux.py b/source/aerobulk/flux.py index 85a877b..daaf21b 100644 --- a/source/aerobulk/flux.py +++ b/source/aerobulk/flux.py @@ -2,6 +2,7 @@ import aerobulk.aerobulk.mod_aerobulk_wrap_noskin as aeronoskin import aerobulk.aerobulk.mod_aerobulk_wrap_skin as aeroskin +import numpy as np import xarray as xr VALID_ALGOS = ["coare3p0", "coare3p6", "ecmwf", "ncar", "andreas"] @@ -13,6 +14,13 @@ def _check_algo(algo, valids): raise ValueError(f"Algorithm {algo} not valid. Choose from {valids}.") +# Unshrink the data (i.e. put land NaN values back in their correct locations) +def unshrink_arr(shrunk_array, shape, ocean_index): + unshrunk_array = np.full(shape, np.nan) + unshrunk_array[ocean_index] = np.squeeze(shrunk_array) + return unshrunk_array + + def noskin_np( sst, t_zt, @@ -69,16 +77,20 @@ def noskin_np( evap : numpy.array evaporation [mm/s] aka [kg/m^2/s] (usually <0, as ocean loses water!) """ - ( - ql, - qh, - taux, - tauy, - evap, - ) = aeronoskin.mod_aerobulk_wrapper_noskin.aerobulk_model_noskin( - algo, zt, zu, sst, t_zt, hum_zt, u_zu, v_zu, slp, niter + + # Define the land mask from the native SST land mask + ocean_index = np.where(~np.isnan(sst)) + + # Shrink the input data (i.e. remove all land points) + args_shrunk = tuple( + np.atleast_3d(a[ocean_index]) for a in (sst, t_zt, hum_zt, u_zu, v_zu, slp) + ) + + out_data = aeronoskin.mod_aerobulk_wrapper_noskin.aerobulk_model_noskin( + algo, zt, zu, *args_shrunk, niter ) - return ql, qh, taux, tauy, evap + + return tuple(unshrink_arr(o, sst.shape, ocean_index) for o in out_data) def skin_np( @@ -145,17 +157,20 @@ def skin_np( evap : numpy.array evaporation [mm/s] aka [kg/m^2/s] (usually <0, as ocean loses water!) """ - ( - ql, - qh, - taux, - tauy, - t_s, - evap, - ) = aeroskin.mod_aerobulk_wrapper_skin.aerobulk_model_skin( - algo, zt, zu, sst, t_zt, hum_zt, u_zu, v_zu, slp, rad_sw, rad_lw, niter + # Define the land mask from the native SST land mask + ocean_index = np.where(~np.isnan(sst)) + + # Shrink the input data (i.e. remove all land points) + args_shrunk = tuple( + np.atleast_3d(a[ocean_index]) + for a in (sst, t_zt, hum_zt, u_zu, v_zu, slp, rad_sw, rad_lw) ) - return ql, qh, taux, tauy, t_s, evap + + out_data = aeroskin.mod_aerobulk_wrapper_skin.aerobulk_model_skin( + algo, zt, zu, *args_shrunk, niter + ) + + return tuple(unshrink_arr(o, sst.shape, ocean_index) for o in out_data) def input_and_output_check(func): diff --git a/source/fortran/mod_aerobulk_wrap_skin.pyf b/source/fortran/mod_aerobulk_wrap_skin.pyf index 52bb2d3..0995d5b 100644 --- a/source/fortran/mod_aerobulk_wrap_skin.pyf +++ b/source/fortran/mod_aerobulk_wrap_skin.pyf @@ -8,7 +8,7 @@ python module mod_aerobulk_wrap_skin ! in use mod_aerobulk, only: aerobulk_init,aerobulk_bye use mod_aerobulk_compute subroutine aerobulk_model_skin(ni,nj,nt,calgo,zt,zu,sst,t_zt,hum_zt,u_zu,v_zu,slp,rad_sw,rad_lw,niter,ql,qh,tau_x,tau_y,t_s,evap) ! in :mod_aerobulk_wrap_skin:mod_aerobulk_wrap_skin.f90:mod_aerobulk_wrapper_skin - threadsafe + integer, optional,intent(in),check(shape(sst, 0) == ni),depend(sst) :: ni=shape(sst, 0) integer, optional,intent(in),check(shape(sst, 1) == nj),depend(sst) :: nj=shape(sst, 1) integer, optional,intent(in),check(shape(sst, 2) == nt),depend(sst) :: nt=shape(sst, 2) diff --git a/tests/test_flux_np.py b/tests/test_flux_np.py new file mode 100644 index 0000000..0a7e83a --- /dev/null +++ b/tests/test_flux_np.py @@ -0,0 +1,75 @@ +from typing import Dict, Tuple + +import numpy as np +import pytest +from aerobulk.flux import noskin_np, skin_np +from numpy.random import default_rng + + +def create_data_np( + shape: Tuple[int, ...], + chunks: Dict[str, int] = {}, + skin_correction: bool = False, + order: str = "F", +): + size = shape[0] * shape[1] + shape2d = (shape[0], shape[1]) + rng = default_rng() + indices = rng.choice(size, size=int(size * 0.3), replace=False) + multi_indices = np.unravel_index(indices, shape2d) + + def _arr(value, chunks, order, land_mask=False): + raw_data = np.full(shape, value, order=order) + if land_mask: + raw_data[ + multi_indices[0], multi_indices[1], : + ] = np.nan # add NaNs to mimic land mask + arr = raw_data + + # adds random noise scaled by a percentage of the value + randomize_factor = 0.001 + randomize_range = value * randomize_factor + noise = np.random.rand(*shape) * randomize_range + arr = arr + noise + return arr + + sst = _arr(290.0, chunks, order, land_mask=True) + t_zt = _arr(280.0, chunks, order) + hum_zt = _arr(0.001, chunks, order) + u_zu = _arr(1.0, chunks, order) + v_zu = _arr(-1.0, chunks, order) + slp = _arr(101000.0, chunks, order) + rad_sw = _arr(0.000001, chunks, order) + rad_lw = _arr(350.0, chunks, order) + if skin_correction: + return sst, t_zt, hum_zt, u_zu, v_zu, rad_sw, rad_lw, slp + else: + return sst, t_zt, hum_zt, u_zu, v_zu, slp + + +@pytest.mark.parametrize("skin_correction", [True, False]) +def test_land_mask(skin_correction): + shape = (2, 3, 4) + size = shape[0] * shape[1] * shape[2] + + if skin_correction: + func = skin_np + else: + func = noskin_np + + args = create_data_np(shape, chunks=False, skin_correction=skin_correction) + out_data = func(*args, "ecmwf", 2, 10, 6) + + # Check the location of all NaNs is correct + for o in out_data: + np.testing.assert_allclose(np.isnan(args[0]), np.isnan(o)) + + # Check that values of the unshrunk array are correct + for i in range(size): + index = np.unravel_index(i, shape) + if not np.isnan(out_data[0][index]): + single_inputs = tuple(np.atleast_3d(i[index]) for i in args) + + single_outputs = func(*single_inputs, "ecmwf", 2, 10, 6) + for so, o in zip(single_outputs, out_data): + assert so == o[index] From cd1f371f1f9e78af365a50c851709ca09bce7cc5 Mon Sep 17 00:00:00 2001 From: Paige Martin Date: Mon, 27 Jun 2022 18:37:35 -0400 Subject: [PATCH 2/7] create test data in a new file --- tests/create_test_data.py | 51 +++++++++++++++++++++++++++++++++++++ tests/test_flux_np.py | 53 +++++++-------------------------------- tests/test_flux_xr.py | 35 +------------------------- 3 files changed, 61 insertions(+), 78 deletions(-) create mode 100644 tests/create_test_data.py diff --git a/tests/create_test_data.py b/tests/create_test_data.py new file mode 100644 index 0000000..9404c10 --- /dev/null +++ b/tests/create_test_data.py @@ -0,0 +1,51 @@ +from typing import Dict, Tuple + +import numpy as np +import xarray as xr +from numpy.random import default_rng + + +def create_data( + shape: Tuple[int, ...], + chunks: Dict[str, int] = {}, + skin_correction: bool = False, + order: str = "F", + use_xr=True, + land_mask=False, +): + size = shape[0] * shape[1] + shape2d = (shape[0], shape[1]) + rng = default_rng() + indices = rng.choice(size, size=int(size * 0.3), replace=False) + multi_indices = np.unravel_index(indices, shape2d) + + def _arr(value, chunks, order): + arr = np.full(shape, value, order=order) + if use_xr: + arr = xr.DataArray(arr) + if land_mask: + arr[ + multi_indices[0], multi_indices[1], : + ] = np.nan # add NaNs to mimic land mask + if chunks: + arr = arr.chunk(chunks) + + # adds random noise scaled by a percentage of the value + randomize_factor = 0.001 + randomize_range = value * randomize_factor + noise = np.random.rand(*shape) * randomize_range + arr = arr + noise + return arr + + sst = _arr(290.0, chunks, order) + t_zt = _arr(280.0, chunks, order) + hum_zt = _arr(0.001, chunks, order) + u_zu = _arr(1.0, chunks, order) + v_zu = _arr(-1.0, chunks, order) + slp = _arr(101000.0, chunks, order) + rad_sw = _arr(0.000001, chunks, order) + rad_lw = _arr(350.0, chunks, order) + if skin_correction: + return sst, t_zt, hum_zt, u_zu, v_zu, rad_sw, rad_lw, slp + else: + return sst, t_zt, hum_zt, u_zu, v_zu, slp diff --git a/tests/test_flux_np.py b/tests/test_flux_np.py index 0a7e83a..beaaa19 100644 --- a/tests/test_flux_np.py +++ b/tests/test_flux_np.py @@ -1,50 +1,9 @@ -from typing import Dict, Tuple - import numpy as np import pytest from aerobulk.flux import noskin_np, skin_np -from numpy.random import default_rng - - -def create_data_np( - shape: Tuple[int, ...], - chunks: Dict[str, int] = {}, - skin_correction: bool = False, - order: str = "F", -): - size = shape[0] * shape[1] - shape2d = (shape[0], shape[1]) - rng = default_rng() - indices = rng.choice(size, size=int(size * 0.3), replace=False) - multi_indices = np.unravel_index(indices, shape2d) - - def _arr(value, chunks, order, land_mask=False): - raw_data = np.full(shape, value, order=order) - if land_mask: - raw_data[ - multi_indices[0], multi_indices[1], : - ] = np.nan # add NaNs to mimic land mask - arr = raw_data +from create_test_data import create_data - # adds random noise scaled by a percentage of the value - randomize_factor = 0.001 - randomize_range = value * randomize_factor - noise = np.random.rand(*shape) * randomize_range - arr = arr + noise - return arr - - sst = _arr(290.0, chunks, order, land_mask=True) - t_zt = _arr(280.0, chunks, order) - hum_zt = _arr(0.001, chunks, order) - u_zu = _arr(1.0, chunks, order) - v_zu = _arr(-1.0, chunks, order) - slp = _arr(101000.0, chunks, order) - rad_sw = _arr(0.000001, chunks, order) - rad_lw = _arr(350.0, chunks, order) - if skin_correction: - return sst, t_zt, hum_zt, u_zu, v_zu, rad_sw, rad_lw, slp - else: - return sst, t_zt, hum_zt, u_zu, v_zu, slp +"""Tests for the numpy land_mask wrapper""" @pytest.mark.parametrize("skin_correction", [True, False]) @@ -57,7 +16,13 @@ def test_land_mask(skin_correction): else: func = noskin_np - args = create_data_np(shape, chunks=False, skin_correction=skin_correction) + args = create_data( + shape, + chunks=False, + skin_correction=skin_correction, + use_xr=False, + land_mask=True, + ) out_data = func(*args, "ecmwf", 2, 10, 6) # Check the location of all NaNs is correct diff --git a/tests/test_flux_xr.py b/tests/test_flux_xr.py index 97418a1..302c154 100644 --- a/tests/test_flux_xr.py +++ b/tests/test_flux_xr.py @@ -1,44 +1,11 @@ -from typing import Dict, Tuple - -import numpy as np import pytest import xarray as xr from aerobulk import noskin, skin +from create_test_data import create_data """Tests for the xarray wrapper""" -def create_data( - shape: Tuple[int, ...], - chunks: Dict[str, int] = {}, - skin_correction: bool = False, - order: str = "F", -): - def _arr(value, chunks, order): - arr = xr.DataArray(np.full(shape, value, order=order)) - - # adds random noise scaled by a percentage of the value - randomize_factor = 0.001 - randomize_range = value * randomize_factor - arr = arr + np.random.rand(*shape) + randomize_range - if chunks: - arr = arr.chunk(chunks) - return arr - - sst = _arr(290.0, chunks, order) - t_zt = _arr(280.0, chunks, order) - hum_zt = _arr(0.001, chunks, order) - u_zu = _arr(1.0, chunks, order) - v_zu = _arr(-1.0, chunks, order) - slp = _arr(101000.0, chunks, order) - rad_sw = _arr(0.000001, chunks, order) - rad_lw = _arr(350, chunks, order) - if skin_correction: - return sst, t_zt, hum_zt, u_zu, v_zu, rad_sw, rad_lw, slp - else: - return sst, t_zt, hum_zt, u_zu, v_zu, slp - - @pytest.mark.parametrize("algo", ["wrong"]) def test_algo_error_noskin(algo): shape = (1, 1, 1) From 6b5d003b4fd6fce4b455cfe9b6ab9b996563676a Mon Sep 17 00:00:00 2001 From: Paige Martin Date: Tue, 28 Jun 2022 12:37:28 -0400 Subject: [PATCH 3/7] minor updates based on review --- source/aerobulk/flux.py | 4 ++++ tests/create_test_data.py | 8 ++++---- tests/test_flux_np.py | 20 ++++++++++++++++---- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/source/aerobulk/flux.py b/source/aerobulk/flux.py index daaf21b..94e5e79 100644 --- a/source/aerobulk/flux.py +++ b/source/aerobulk/flux.py @@ -35,6 +35,7 @@ def noskin_np( ): """Python wrapper for aerobulk without skin correction. !ATTENTION If input not provided in correct units, will crash. + !ATTENTION Land mask taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. Parameters ---------- @@ -109,6 +110,7 @@ def skin_np( ): """Python wrapper for aerobulk with skin correction. !ATTENTION If input not provided in correct units, will crash. + !ATTENTION Land mask taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. Parameters ---------- @@ -213,6 +215,7 @@ def noskin( Warnings -------- !ATTENTION If input not provided in the units shown in [] below the code will crash. + !ATTENTION Land mask taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. Parameters ---------- @@ -313,6 +316,7 @@ def skin( Warnings -------- !ATTENTION If input not provided in the units shown in [] below the code will crash. + !ATTENTION Land mask taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. Parameters ---------- diff --git a/tests/create_test_data.py b/tests/create_test_data.py index 9404c10..eff9c42 100644 --- a/tests/create_test_data.py +++ b/tests/create_test_data.py @@ -21,14 +21,14 @@ def create_data( def _arr(value, chunks, order): arr = np.full(shape, value, order=order) - if use_xr: - arr = xr.DataArray(arr) if land_mask: arr[ multi_indices[0], multi_indices[1], : ] = np.nan # add NaNs to mimic land mask - if chunks: - arr = arr.chunk(chunks) + if use_xr: + arr = xr.DataArray(arr) + if chunks: + arr = arr.chunk(chunks) # adds random noise scaled by a percentage of the value randomize_factor = 0.001 diff --git a/tests/test_flux_np.py b/tests/test_flux_np.py index beaaa19..b4fdd5c 100644 --- a/tests/test_flux_np.py +++ b/tests/test_flux_np.py @@ -6,8 +6,20 @@ """Tests for the numpy land_mask wrapper""" -@pytest.mark.parametrize("skin_correction", [True, False]) -def test_land_mask(skin_correction): +@pytest.mark.parametrize( + "algo, skin_correction", + [ + ("ecmwf", True), + ("ecmwf", False), + ("coare3p0", True), + ("coare3p0", False), + ("coare3p6", True), + ("coare3p6", False), + ("andreas", False), + ("ncar", False), + ], +) +def test_land_mask(skin_correction, algo): shape = (2, 3, 4) size = shape[0] * shape[1] * shape[2] @@ -23,7 +35,7 @@ def test_land_mask(skin_correction): use_xr=False, land_mask=True, ) - out_data = func(*args, "ecmwf", 2, 10, 6) + out_data = func(*args, algo, 2, 10, 6) # Check the location of all NaNs is correct for o in out_data: @@ -35,6 +47,6 @@ def test_land_mask(skin_correction): if not np.isnan(out_data[0][index]): single_inputs = tuple(np.atleast_3d(i[index]) for i in args) - single_outputs = func(*single_inputs, "ecmwf", 2, 10, 6) + single_outputs = func(*single_inputs, algo, 2, 10, 6) for so, o in zip(single_outputs, out_data): assert so == o[index] From 9a8c979c022aea848169db49b15c103c90e79aa5 Mon Sep 17 00:00:00 2001 From: Paige Martin Date: Tue, 28 Jun 2022 17:36:45 -0400 Subject: [PATCH 4/7] remove input_and_output_check --- source/aerobulk/flux.py | 35 ----------------------------------- tests/test_flux_xr.py | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/source/aerobulk/flux.py b/source/aerobulk/flux.py index 94e5e79..d312d8b 100644 --- a/source/aerobulk/flux.py +++ b/source/aerobulk/flux.py @@ -1,5 +1,3 @@ -import functools - import aerobulk.aerobulk.mod_aerobulk_wrap_noskin as aeronoskin import aerobulk.aerobulk.mod_aerobulk_wrap_skin as aeroskin import numpy as np @@ -175,38 +173,6 @@ def skin_np( return tuple(unshrink_arr(o, sst.shape, ocean_index) for o in out_data) -def input_and_output_check(func): - @functools.wraps(func) - def wrapper(*args, **kwargs): - # Check the input shape - test_arg = args[ - 0 - ] # assuming that all the input shapes are the same size. TODO: More thorough check - if len(test_arg.dims) < 3: - # TODO promote using expand_dims? - raise NotImplementedError( - f"Aerobulk-Python expects all input fields as 3D arrays. Found {len(test_arg.dims)} dimensions on input." - ) - if len(test_arg.dims) > 4: - # TODO iterate over extra dims? Or reshape? - raise NotImplementedError( - f"Aerobulk-Python expects all input fields as 3D arrays. Found {len(test_arg.dims)} dimensions on input." - ) - - out_vars = func(*args, **kwargs) - - # TODO: Here we could 'un-reshape' or squeeze the output according to the logic above - - if any(var.ndim != 3 for var in out_vars): - raise ValueError( - f"f2py returned result of unexpected shape. Got {[var.shape for var in out_vars]}" - ) - return out_vars - - return wrapper - - -@input_and_output_check def noskin( sst, t_zt, hum_zt, u_zu, v_zu, slp=101000.0, algo="coare3p0", zt=2, zu=10, niter=6 ): @@ -295,7 +261,6 @@ def noskin( return out_vars -@input_and_output_check def skin( sst, t_zt, diff --git a/tests/test_flux_xr.py b/tests/test_flux_xr.py index 302c154..aaf1d86 100644 --- a/tests/test_flux_xr.py +++ b/tests/test_flux_xr.py @@ -66,3 +66,21 @@ def test_transpose_invariance_noskin(self, chunks, skin_correction, order): ii.transpose("dim_0", "dim_1", "dim_2"), iii.transpose("dim_0", "dim_1", "dim_2"), ) + + +@pytest.mark.parametrize("skin_correction", [True, False]) +def test_all_input_array_sizes_valid(skin_correction): + shapes = ( + (3, 4), + (2, 3, 4), + (2, 3, 4, 5), + ) # create_data() only allows for inputs of 2 or more dimensions + data = (create_data(s, skin_correction=skin_correction) for s in shapes) + if skin_correction: + func = skin + else: + func = noskin + tuple(func(*d, "coare3p0", 2, 10, 6) for d in data) + assert ( + 1 == 1 + ) # This line is always true, but verifies that the above line doesn't crash the Fortran code From 55cff4d14185cee84c2d2dafffd7ff50e504a00f Mon Sep 17 00:00:00 2001 From: Paige Martin Date: Tue, 28 Jun 2022 17:49:46 -0400 Subject: [PATCH 5/7] Minor docstring wording update --- source/aerobulk/flux.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/aerobulk/flux.py b/source/aerobulk/flux.py index d312d8b..08bc371 100644 --- a/source/aerobulk/flux.py +++ b/source/aerobulk/flux.py @@ -33,7 +33,7 @@ def noskin_np( ): """Python wrapper for aerobulk without skin correction. !ATTENTION If input not provided in correct units, will crash. - !ATTENTION Land mask taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. + !ATTENTION Missing values taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. Parameters ---------- @@ -108,7 +108,7 @@ def skin_np( ): """Python wrapper for aerobulk with skin correction. !ATTENTION If input not provided in correct units, will crash. - !ATTENTION Land mask taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. + !ATTENTION Missing values taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. Parameters ---------- @@ -181,7 +181,7 @@ def noskin( Warnings -------- !ATTENTION If input not provided in the units shown in [] below the code will crash. - !ATTENTION Land mask taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. + !ATTENTION Missing values taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. Parameters ---------- @@ -281,7 +281,7 @@ def skin( Warnings -------- !ATTENTION If input not provided in the units shown in [] below the code will crash. - !ATTENTION Land mask taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. + !ATTENTION Missing values taken from NaN values in sst field. No input variables may have NaN values that are not reflected in the sst. Parameters ---------- From 2267b3608666cb41f4a11cf67e67abefa3ab2902 Mon Sep 17 00:00:00 2001 From: Paige Martin Date: Tue, 28 Jun 2022 18:01:47 -0400 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Julius Busecke --- tests/create_test_data.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/create_test_data.py b/tests/create_test_data.py index eff9c42..faef5fc 100644 --- a/tests/create_test_data.py +++ b/tests/create_test_data.py @@ -21,6 +21,12 @@ def create_data( def _arr(value, chunks, order): arr = np.full(shape, value, order=order) + # adds random noise scaled by a percentage of the value + randomize_factor = 0.001 + randomize_range = value * randomize_factor + noise = np.random.rand(*shape) * randomize_range + arr = arr + noise + if land_mask: arr[ multi_indices[0], multi_indices[1], : @@ -29,12 +35,6 @@ def _arr(value, chunks, order): arr = xr.DataArray(arr) if chunks: arr = arr.chunk(chunks) - - # adds random noise scaled by a percentage of the value - randomize_factor = 0.001 - randomize_range = value * randomize_factor - noise = np.random.rand(*shape) * randomize_range - arr = arr + noise return arr sst = _arr(290.0, chunks, order) From 480661d7fc37d9f6e673021543f4d521f322459f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Jun 2022 22:01:53 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/create_test_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/create_test_data.py b/tests/create_test_data.py index faef5fc..d060a27 100644 --- a/tests/create_test_data.py +++ b/tests/create_test_data.py @@ -26,7 +26,7 @@ def _arr(value, chunks, order): randomize_range = value * randomize_factor noise = np.random.rand(*shape) * randomize_range arr = arr + noise - + if land_mask: arr[ multi_indices[0], multi_indices[1], :