From 0e0d450de97fc6a822edbcb11d72f763f03f4f07 Mon Sep 17 00:00:00 2001 From: Mark Vrijlandt Date: Fri, 18 Jun 2021 09:26:22 +0200 Subject: [PATCH 1/4] add zmap io and no_data param in write_asc --- pykrige/kriging_tools.py | 204 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 192 insertions(+), 12 deletions(-) diff --git a/pykrige/kriging_tools.py b/pykrige/kriging_tools.py index 8dd4a13..b2174ad 100755 --- a/pykrige/kriging_tools.py +++ b/pykrige/kriging_tools.py @@ -15,9 +15,11 @@ import numpy as np import warnings import io +import datetime +import os -def write_asc_grid(x, y, z, filename="output.asc", style=1): +def write_asc_grid(x, y, z, filename="output.asc", no_data=-999.0, style=1): r"""Writes gridded data to ASCII grid file (\*.asc). This is useful for exporting data to a GIS program. @@ -32,6 +34,8 @@ def write_asc_grid(x, y, z, filename="output.asc", style=1): Gridded data values. May be a masked array. filename : string, optional Name of output \*.asc file. Default name is 'output.asc'. + no_data : float, optional + no data value to be used style : int, optional Determines how to write the \*.asc file header. Specifying 1 writes out DX, DY, XLLCENTER, YLLCENTER. @@ -40,7 +44,7 @@ def write_asc_grid(x, y, z, filename="output.asc", style=1): """ if np.ma.is_masked(z): - z = np.array(z.tolist(-999.0)) + z = np.array(z.tolist(no_data)) x = np.squeeze(np.array(x)) y = np.squeeze(np.array(y)) @@ -71,8 +75,8 @@ def write_asc_grid(x, y, z, filename="output.asc", style=1): dx = abs(x[1] - x[0]) dy = abs(y[1] - y[0]) if ( - abs((x[-1] - x[0]) / (x.shape[0] - 1)) != dx - or abs((y[-1] - y[0]) / (y.shape[0] - 1)) != dy + abs((x[-1] - x[0]) / (x.shape[0] - 1)) != dx + or abs((y[-1] - y[0]) / (y.shape[0] - 1)) != dy ): raise ValueError( "X or Y spacing is not constant; *.asc grid cannot be written." @@ -97,8 +101,6 @@ def write_asc_grid(x, y, z, filename="output.asc", style=1): xllcorner = xllcenter - dx / 2.0 yllcorner = yllcenter - dy / 2.0 - no_data = -999.0 - with io.open(filename, "w") as f: if style == 1: f.write("NCOLS " + "{:<10n}".format(ncols) + "\n") @@ -196,14 +198,14 @@ def read_asc_grid(filename, footer=0): raise IOError("could not read *.asc file. Error in header.") if ( - (ncols is not None) - and (nrows is not None) - and ( + (ncols is not None) + and (nrows is not None) + and ( ((xllcorner is not None) and (yllcorner is not None)) or ((xllcenter is not None) and (yllcenter is not None)) - ) - and ((cellsize is not None) or ((dx is not None) and (dy is not None))) - and (no_data is not None) + ) + and ((cellsize is not None) or ((dx is not None) and (dy is not None))) + and (no_data is not None) ): break @@ -246,3 +248,181 @@ def read_asc_grid(filename, footer=0): cellsize = (dx, dy) return grid_array, x, y, cellsize, no_data + + +def write_zmap_grid(x, y, z, filename="output.zmap", no_data=-999.0, coord_sys=''): + r"""Writes gridded data to ASCII grid file in zmap format (\*.zmap). + + This is useful for exporting data to a GIS program, or Petrel + https://gdal.org/drivers/raster/zmap.html + + Parameters + ---------- + x : array_like, shape (N,) or (N, 1) + X-coordinates of grid points at center of cells. + y : array_like, shape (M,) or (M, 1) + Y-coordinates of grid points at center of cells. + z : array_like, shape (M, N) + Gridded data values. May be a masked array. + filename : string, optional + Name of output \*.zmap file. Default name is 'output.zmap'. + no_data : float, optional + no data value to be used + coord_sys : String, optional + coordinate sytem description + """ + + nodes_per_line = 5 + field_width = 15 + + if np.ma.is_masked(z): + z = np.array(z.tolist(no_data)) + + x = np.squeeze(np.array(x)) + y = np.squeeze(np.array(y)) + z = np.squeeze(np.array(z)) + nx = len(x) + ny = len(y) + + dx = abs(x[1] - x[0]) + dy = abs(y[1] - y[0]) + + xllcenter = x[0] + yllcenter = y[0] + + hix = xllcenter + (nx - 1) * dx + hiy = yllcenter + (ny - 1) * dy + + now = datetime.datetime.now() + + with io.open(filename, "w") as f: + f.write("!" + "\n") + f.write("! ZIMS FILE NAME : " + os.path.basename(filename) + "\n") + f.write("! FORMATTED FILE CREATION DATE: " + now.strftime("%d/%m/%Y") + "\n") + f.write("! FORMATTED FILE CREATION TIME: " + now.strftime("%H:%M:%S") + "\n") + f.write("! COORDINATE REFERENCE SYSTEM: " + coord_sys + "\n") + f.write("!" + "\n") + f.write("@Grid HEADER, GRID, " + str(nodes_per_line) + "\n") + f.write(" " + str(field_width) + ", " + str(no_data) + ", , 1 , 1" + "\n") + f.write(" " + str(ny) + ", " + str(nx) + ", " + str(xllcenter) + ", " + str(hix) + ", " + str( + yllcenter) + ", " + str(hiy) + "\n") + f.write(" " + str(dx) + ", 0.0, 0.0 " + "\n") + f.write("@" + "\n") + + for n in range(z.shape[1]): + count = 0 + for m in range(z.shape[0] - 1, -1, -1): + count += 1 + if np.isnan(z[m, n]): + f.write(space_back_to_front(format(no_data, "13.7E") + ' ')) + else: + if abs(z[m, n]) >= 1E100: + f.write(space_back_to_front(format(z[m, n], "13.7E") + ' ')) + elif abs(z[m, n]) >= 1E6: + f.write(space_back_to_front(format(z[m, n], "13.7E") + ' ')) + else: + f.write(space_back_to_front("{:<13.4f}".format(z[m, n]) + ' ')) + if count % nodes_per_line == 0 or m == 0: + f.write("\n") + + +def read_zmap_grid(filename): + r"""Reads ASCII grid file in zmap format (\*.zmap). + https://gdal.org/drivers/raster/zmap.html + + Parameters + ---------- + filename : str + Name of \*.zmap file. + + Returns + ------- + grid_array : numpy array, shape (M, N) + (M, N) array of grid values, where M is number of Y-coordinates and + N is number of X-coordinates. The array entry corresponding to + the lower-left coordinates is at index [M, 0], so that + the array is oriented as it would be in X-Y space. + x : numpy array, shape (N,) + 1D array of N X-coordinates. + y : numpy array, shape (M,) + 1D array of M Y-coordinates. + CELLSIZE : tuple or float + Either a two-tuple of (x-cell size, y-cell size), + or a float that specifies the uniform cell size. + NODATA : float + Value that specifies which entries are not actual data. + COORD_SYS : String + Coordinate system name + """ + + no_data_value, nx, ny, originx, originy, maxx, maxy, dx, dy = 0, 0, 0, 0, 0, 0, 0, 0, 0 + data_values = np.empty(1) + coord_sys = '' + + i_header_line, i_value = 0, 0 + with io.open(filename, "r") as f: + while True: + line = f.readline() + if line.startswith('!'): + line_strings = line.split(":") + if line_strings[0].__contains__('COORDINATE REFERENCE SYSTEM'): + coord_sys = line_strings[1].replace('\n', '') + else: + line_strings = line.split() + line_strings = [string.replace(',', '') for string in line_strings] + + if len(line_strings) == 0: + break + + if i_header_line == -1 and not line_strings[0].startswith('!'): + for i_string in range(len(line_strings)): + data_values[i_value] = float(line_strings[i_string]) + i_value += 1 + + if line_strings[0].startswith('@'): + if i_header_line == 0: + i_header_line += 1 + else: + i_header_line = -1 + + if i_header_line > 0: + if i_header_line == 2: + no_data_value = float(line_strings[1]) + elif i_header_line == 3: + ny = int(line_strings[0]) + nx = int(line_strings[1]) + originx = float(line_strings[2]) + maxx = float(line_strings[3]) + originy = float(line_strings[4]) + maxy = float(line_strings[5]) + data_values = np.empty(ny * nx) + i_header_line += 1 + + if nx * ny != len(data_values): + raise IOError( + "Error reading *.zmap file. Encountered problem " + "with header: (nx * ny) does not match with the " + "number items in data file body." + ) + + z = np.empty([ny, nx]) + i_value = 0 + for n in range(z.shape[1]): + for m in range(z.shape[0] - 1, -1, -1): + z[m, n] = data_values[i_value] + i_value += 1 + + dx = (maxx - originx) / (nx - 1) + dy = (maxy - originy) / (ny - 1) + + gridx = np.arange(originx, originx + nx * dx, dx) + gridy = np.arange(originy, originy + ny * dy, dy) + + cellsize = (dx, dy) + + return z, gridx, gridy, cellsize, no_data_value, coord_sys + + +def space_back_to_front(string): + net = string.replace(' ', '') + return "".join(string.rsplit(net)) + net From 7e41a0d51c0b99283c0a90782500fa173f45d340 Mon Sep 17 00:00:00 2001 From: Mark Vrijlandt Date: Mon, 21 Jun 2021 10:34:15 +0200 Subject: [PATCH 2/4] #199 requests --- pykrige/kriging_tools.py | 20 +++++++++++----- tests/test_core.py | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 6 deletions(-) diff --git a/pykrige/kriging_tools.py b/pykrige/kriging_tools.py index b2174ad..8080ab7 100755 --- a/pykrige/kriging_tools.py +++ b/pykrige/kriging_tools.py @@ -75,8 +75,8 @@ def write_asc_grid(x, y, z, filename="output.asc", no_data=-999.0, style=1): dx = abs(x[1] - x[0]) dy = abs(y[1] - y[0]) if ( - abs((x[-1] - x[0]) / (x.shape[0] - 1)) != dx - or abs((y[-1] - y[0]) / (y.shape[0] - 1)) != dy + not np.isclose(abs((x[-1] - x[0]) / (x.shape[0] - 1)), dx) + or not np.isclose(abs((y[-1] - y[0]) / (y.shape[0] - 1)), dy) ): raise ValueError( "X or Y spacing is not constant; *.asc grid cannot be written." @@ -287,6 +287,14 @@ def write_zmap_grid(x, y, z, filename="output.zmap", no_data=-999.0, coord_sys=' dx = abs(x[1] - x[0]) dy = abs(y[1] - y[0]) + if ( + not np.isclose(abs((x[-1] - x[0]) / (x.shape[0] - 1)), dx) + or not np.isclose(abs((y[-1] - y[0]) / (y.shape[0] - 1)), dy) + ): + raise ValueError( + "X or Y spacing is not constant; *.asc grid cannot be written." + ) + xllcenter = x[0] yllcenter = y[0] @@ -316,7 +324,7 @@ def write_zmap_grid(x, y, z, filename="output.zmap", no_data=-999.0, coord_sys=' if np.isnan(z[m, n]): f.write(space_back_to_front(format(no_data, "13.7E") + ' ')) else: - if abs(z[m, n]) >= 1E100: + if abs(z[m, n]) >= 1E100: # one tailing space less f.write(space_back_to_front(format(z[m, n], "13.7E") + ' ')) elif abs(z[m, n]) >= 1E6: f.write(space_back_to_front(format(z[m, n], "13.7E") + ' ')) @@ -346,12 +354,12 @@ def read_zmap_grid(filename): 1D array of N X-coordinates. y : numpy array, shape (M,) 1D array of M Y-coordinates. - CELLSIZE : tuple or float + cellsize : tuple or float Either a two-tuple of (x-cell size, y-cell size), or a float that specifies the uniform cell size. - NODATA : float + no_data_value : float Value that specifies which entries are not actual data. - COORD_SYS : String + coord_sys : String Coordinate system name """ diff --git a/tests/test_core.py b/tests/test_core.py index 6b07f7d..f29bfd0 100755 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1145,7 +1145,22 @@ def test_kriging_tools(sample_data_2d): assert_allclose(gridx, x_read) assert_allclose(gridy, y_read) + kt.write_zmap_grid( + gridx, + gridy, + z_write, + filename=os.path.join(BASE_DIR, "test_data/temp.zmap"), + no_data=1E30, + ) + z_read, x_read, y_read, cellsize, no_data = kt.read_zmap_grid( + os.path.join(BASE_DIR, "test_data/temp.zmap") + ) + assert_allclose(z_write, z_read, 0.01, 0.01) + assert_allclose(gridx, x_read) + assert_allclose(gridy, y_read) + z_write, ss_write = ok.execute("masked", gridx, gridy, mask=mask_ref) + kt.write_asc_grid( gridx, gridy, @@ -1166,6 +1181,26 @@ def test_kriging_tools(sample_data_2d): assert_allclose(gridx, x_read) assert_allclose(gridy, y_read) + kt.write_zmap_grid( + gridx, + gridy, + z_write, + filename=os.path.join(BASE_DIR, "test_data/temp.zmap"), + no_data=1E30, + ) + z_read, x_read, y_read, cellsize, no_data = kt.read_zmap_grid( + os.path.join(BASE_DIR, "test_data/temp.zmap") + ) + assert np.ma.allclose( + z_write, + np.ma.masked_where(z_read == no_data, z_read), + masked_equal=True, + rtol=0.01, + atol=0.01, + ) + assert_allclose(gridx, x_read) + assert_allclose(gridy, y_read) + ok = OrdinaryKriging(data[:, 0], data[:, 1], data[:, 2]) z_write, ss_write = ok.execute("grid", gridx_2, gridy) @@ -1183,7 +1218,21 @@ def test_kriging_tools(sample_data_2d): assert_allclose(gridx_2, x_read) assert_allclose(gridy, y_read) + kt.write_zmap_grid( + gridx_2, + gridy, + z_write, + filename=os.path.join(BASE_DIR, "test_data/temp.zmap"), + ) + z_read, x_read, y_read, cellsize, no_data = kt.read_zmap_grid( + os.path.join(BASE_DIR, "test_data/temp.zmap") + ) + assert_allclose(z_write, z_read, 0.01, 0.01) + assert_allclose(gridx_2, x_read) + assert_allclose(gridy, y_read) + os.remove(os.path.join(BASE_DIR, "test_data/temp.asc")) + os.remove(os.path.join(BASE_DIR, "test_data/temp.zmap")) # http://doc.pytest.org/en/latest/skipping.html#id1 From 93404e230d24a6ab3c86cd3e983d4d602878f193 Mon Sep 17 00:00:00 2001 From: Mark Vrijlandt Date: Tue, 22 Jun 2021 14:13:43 +0200 Subject: [PATCH 3/4] fix read zmap --- tests/test_core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index f29bfd0..d9f0352 100755 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1152,7 +1152,7 @@ def test_kriging_tools(sample_data_2d): filename=os.path.join(BASE_DIR, "test_data/temp.zmap"), no_data=1E30, ) - z_read, x_read, y_read, cellsize, no_data = kt.read_zmap_grid( + z_read, x_read, y_read, cellsize, no_data, _ = kt.read_zmap_grid( os.path.join(BASE_DIR, "test_data/temp.zmap") ) assert_allclose(z_write, z_read, 0.01, 0.01) @@ -1188,7 +1188,7 @@ def test_kriging_tools(sample_data_2d): filename=os.path.join(BASE_DIR, "test_data/temp.zmap"), no_data=1E30, ) - z_read, x_read, y_read, cellsize, no_data = kt.read_zmap_grid( + z_read, x_read, y_read, cellsize, no_data, _ = kt.read_zmap_grid( os.path.join(BASE_DIR, "test_data/temp.zmap") ) assert np.ma.allclose( @@ -1224,7 +1224,7 @@ def test_kriging_tools(sample_data_2d): z_write, filename=os.path.join(BASE_DIR, "test_data/temp.zmap"), ) - z_read, x_read, y_read, cellsize, no_data = kt.read_zmap_grid( + z_read, x_read, y_read, cellsize, no_data, _ = kt.read_zmap_grid( os.path.join(BASE_DIR, "test_data/temp.zmap") ) assert_allclose(z_write, z_read, 0.01, 0.01) From b6b48586776c2a7428738b00801dbaaab53ac7a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Tue, 22 Jun 2021 23:42:06 +0200 Subject: [PATCH 4/4] apply black --- pykrige/kriging_tools.py | 91 ++++++++++++++++++++++++++-------------- tests/test_core.py | 4 +- 2 files changed, 61 insertions(+), 34 deletions(-) diff --git a/pykrige/kriging_tools.py b/pykrige/kriging_tools.py index 8080ab7..4f6dd1a 100755 --- a/pykrige/kriging_tools.py +++ b/pykrige/kriging_tools.py @@ -74,9 +74,8 @@ def write_asc_grid(x, y, z, filename="output.asc", no_data=-999.0, style=1): dx = abs(x[1] - x[0]) dy = abs(y[1] - y[0]) - if ( - not np.isclose(abs((x[-1] - x[0]) / (x.shape[0] - 1)), dx) - or not np.isclose(abs((y[-1] - y[0]) / (y.shape[0] - 1)), dy) + if not np.isclose(abs((x[-1] - x[0]) / (x.shape[0] - 1)), dx) or not np.isclose( + abs((y[-1] - y[0]) / (y.shape[0] - 1)), dy ): raise ValueError( "X or Y spacing is not constant; *.asc grid cannot be written." @@ -198,14 +197,14 @@ def read_asc_grid(filename, footer=0): raise IOError("could not read *.asc file. Error in header.") if ( - (ncols is not None) - and (nrows is not None) - and ( + (ncols is not None) + and (nrows is not None) + and ( ((xllcorner is not None) and (yllcorner is not None)) or ((xllcenter is not None) and (yllcenter is not None)) - ) - and ((cellsize is not None) or ((dx is not None) and (dy is not None))) - and (no_data is not None) + ) + and ((cellsize is not None) or ((dx is not None) and (dy is not None))) + and (no_data is not None) ): break @@ -250,7 +249,9 @@ def read_asc_grid(filename, footer=0): return grid_array, x, y, cellsize, no_data -def write_zmap_grid(x, y, z, filename="output.zmap", no_data=-999.0, coord_sys=''): +def write_zmap_grid( + x, y, z, filename="output.zmap", no_data=-999.0, coord_sys="" +): r"""Writes gridded data to ASCII grid file in zmap format (\*.zmap). This is useful for exporting data to a GIS program, or Petrel @@ -287,9 +288,8 @@ def write_zmap_grid(x, y, z, filename="output.zmap", no_data=-999.0, coord_sys=' dx = abs(x[1] - x[0]) dy = abs(y[1] - y[0]) - if ( - not np.isclose(abs((x[-1] - x[0]) / (x.shape[0] - 1)), dx) - or not np.isclose(abs((y[-1] - y[0]) / (y.shape[0] - 1)), dy) + if not np.isclose(abs((x[-1] - x[0]) / (x.shape[0] - 1)), dx) or not np.isclose( + abs((y[-1] - y[0]) / (y.shape[0] - 1)), dy ): raise ValueError( "X or Y spacing is not constant; *.asc grid cannot be written." @@ -306,14 +306,31 @@ def write_zmap_grid(x, y, z, filename="output.zmap", no_data=-999.0, coord_sys=' with io.open(filename, "w") as f: f.write("!" + "\n") f.write("! ZIMS FILE NAME : " + os.path.basename(filename) + "\n") - f.write("! FORMATTED FILE CREATION DATE: " + now.strftime("%d/%m/%Y") + "\n") - f.write("! FORMATTED FILE CREATION TIME: " + now.strftime("%H:%M:%S") + "\n") + f.write( + "! FORMATTED FILE CREATION DATE: " + now.strftime("%d/%m/%Y") + "\n" + ) + f.write( + "! FORMATTED FILE CREATION TIME: " + now.strftime("%H:%M:%S") + "\n" + ) f.write("! COORDINATE REFERENCE SYSTEM: " + coord_sys + "\n") f.write("!" + "\n") f.write("@Grid HEADER, GRID, " + str(nodes_per_line) + "\n") f.write(" " + str(field_width) + ", " + str(no_data) + ", , 1 , 1" + "\n") - f.write(" " + str(ny) + ", " + str(nx) + ", " + str(xllcenter) + ", " + str(hix) + ", " + str( - yllcenter) + ", " + str(hiy) + "\n") + f.write( + " " + + str(ny) + + ", " + + str(nx) + + ", " + + str(xllcenter) + + ", " + + str(hix) + + ", " + + str(yllcenter) + + ", " + + str(hiy) + + "\n" + ) f.write(" " + str(dx) + ", 0.0, 0.0 " + "\n") f.write("@" + "\n") @@ -322,14 +339,14 @@ def write_zmap_grid(x, y, z, filename="output.zmap", no_data=-999.0, coord_sys=' for m in range(z.shape[0] - 1, -1, -1): count += 1 if np.isnan(z[m, n]): - f.write(space_back_to_front(format(no_data, "13.7E") + ' ')) + f.write(space_back_to_front(format(no_data, "13.7E") + " ")) else: - if abs(z[m, n]) >= 1E100: # one tailing space less - f.write(space_back_to_front(format(z[m, n], "13.7E") + ' ')) - elif abs(z[m, n]) >= 1E6: - f.write(space_back_to_front(format(z[m, n], "13.7E") + ' ')) + if abs(z[m, n]) >= 1e100: # one tailing space less + f.write(space_back_to_front(format(z[m, n], "13.7E") + " ")) + elif abs(z[m, n]) >= 1e6: + f.write(space_back_to_front(format(z[m, n], "13.7E") + " ")) else: - f.write(space_back_to_front("{:<13.4f}".format(z[m, n]) + ' ')) + f.write(space_back_to_front("{:<13.4f}".format(z[m, n]) + " ")) if count % nodes_per_line == 0 or m == 0: f.write("\n") @@ -363,31 +380,41 @@ def read_zmap_grid(filename): Coordinate system name """ - no_data_value, nx, ny, originx, originy, maxx, maxy, dx, dy = 0, 0, 0, 0, 0, 0, 0, 0, 0 + no_data_value, nx, ny, originx, originy, maxx, maxy, dx, dy = ( + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ) data_values = np.empty(1) - coord_sys = '' + coord_sys = "" i_header_line, i_value = 0, 0 with io.open(filename, "r") as f: while True: line = f.readline() - if line.startswith('!'): + if line.startswith("!"): line_strings = line.split(":") - if line_strings[0].__contains__('COORDINATE REFERENCE SYSTEM'): - coord_sys = line_strings[1].replace('\n', '') + if line_strings[0].__contains__("COORDINATE REFERENCE SYSTEM"): + coord_sys = line_strings[1].replace("\n", "") else: line_strings = line.split() - line_strings = [string.replace(',', '') for string in line_strings] + line_strings = [string.replace(",", "") for string in line_strings] if len(line_strings) == 0: break - if i_header_line == -1 and not line_strings[0].startswith('!'): + if i_header_line == -1 and not line_strings[0].startswith("!"): for i_string in range(len(line_strings)): data_values[i_value] = float(line_strings[i_string]) i_value += 1 - if line_strings[0].startswith('@'): + if line_strings[0].startswith("@"): if i_header_line == 0: i_header_line += 1 else: @@ -432,5 +459,5 @@ def read_zmap_grid(filename): def space_back_to_front(string): - net = string.replace(' ', '') + net = string.replace(" ", "") return "".join(string.rsplit(net)) + net diff --git a/tests/test_core.py b/tests/test_core.py index d9f0352..5ae5a7e 100755 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1150,7 +1150,7 @@ def test_kriging_tools(sample_data_2d): gridy, z_write, filename=os.path.join(BASE_DIR, "test_data/temp.zmap"), - no_data=1E30, + no_data=1e30, ) z_read, x_read, y_read, cellsize, no_data, _ = kt.read_zmap_grid( os.path.join(BASE_DIR, "test_data/temp.zmap") @@ -1186,7 +1186,7 @@ def test_kriging_tools(sample_data_2d): gridy, z_write, filename=os.path.join(BASE_DIR, "test_data/temp.zmap"), - no_data=1E30, + no_data=1e30, ) z_read, x_read, y_read, cellsize, no_data, _ = kt.read_zmap_grid( os.path.join(BASE_DIR, "test_data/temp.zmap")