From b0fdb11a6689bd025315120f2a3af5de034fba80 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Fri, 28 Jul 2023 10:14:21 +1200 Subject: [PATCH] refactor(expired deprecation): remove warning for third parameter of Grid.intersect --- flopy/discretization/grid.py | 34 ------------------------ flopy/discretization/structuredgrid.py | 6 ----- flopy/discretization/unstructuredgrid.py | 5 ---- flopy/discretization/vertexgrid.py | 5 ---- 4 files changed, 50 deletions(-) diff --git a/flopy/discretization/grid.py b/flopy/discretization/grid.py index cfa72af05e..7350b9b0da 100644 --- a/flopy/discretization/grid.py +++ b/flopy/discretization/grid.py @@ -147,8 +147,6 @@ class Grid: 1D array of x and y coordinates of cell vertices for whole grid (single layer) in C-style (row-major) order (same as np.ravel()) - intersect(x, y, local) - returns the row and column of the grid that the x, y point is in See Also -------- @@ -985,38 +983,6 @@ def intersect(self, x, y, local=False, forgive=False): else: return x, y - def _warn_intersect(self, module, lineno): - """ - Warning for modelgrid intersect() interface change. - - Should be be removed after a couple of releases. Added in 3.3.5 - - Updated in 3.3.6 to raise an error and exit if intersect interface - is called incorrectly. - - Should be removed in flopy 3.3.7 - - Parameters - ---------- - module : str - module name path - lineno : int - line number where warning is called from - - Returns - ------- - None - """ - module = os.path.split(module)[-1] - warning = ( - "The interface 'intersect(self, x, y, local=False, " - "forgive=False)' has been deprecated. Use the " - "intersect(self, x, y, z=None, local=False, " - "forgive=False) interface instead." - ) - - raise UserWarning(warning) - def set_coord_info( self, xoff=None, diff --git a/flopy/discretization/structuredgrid.py b/flopy/discretization/structuredgrid.py index feb9696b05..c7c6246f48 100644 --- a/flopy/discretization/structuredgrid.py +++ b/flopy/discretization/structuredgrid.py @@ -1,5 +1,4 @@ import copy -import inspect import os.path from typing import Union @@ -875,11 +874,6 @@ def intersect(self, x, y, z=None, local=False, forgive=False): The column number """ - if isinstance(z, bool): - # trigger interface change warning - frame_info = inspect.getframeinfo(inspect.currentframe()) - self._warn_intersect(frame_info.filename, frame_info.lineno) - # transform x and y to local coordinates x, y = super().intersect(x, y, local, forgive) diff --git a/flopy/discretization/unstructuredgrid.py b/flopy/discretization/unstructuredgrid.py index 21f52a6c0b..2ebef4f9ff 100644 --- a/flopy/discretization/unstructuredgrid.py +++ b/flopy/discretization/unstructuredgrid.py @@ -1,5 +1,4 @@ import copy -import inspect import os from typing import Union @@ -581,10 +580,6 @@ def intersect(self, x, y, z=None, local=False, forgive=False): The CELL2D number """ - if isinstance(z, bool): - frame_info = inspect.getframeinfo(inspect.currentframe()) - self._warn_intersect(frame_info.filename, frame_info.lineno) - if local: # transform x and y to real-world coordinates x, y = super().get_coords(x, y) diff --git a/flopy/discretization/vertexgrid.py b/flopy/discretization/vertexgrid.py index 9679b4a334..ed516e5710 100644 --- a/flopy/discretization/vertexgrid.py +++ b/flopy/discretization/vertexgrid.py @@ -1,5 +1,4 @@ import copy -import inspect import os import numpy as np @@ -321,10 +320,6 @@ def intersect(self, x, y, z=None, local=False, forgive=False): The CELL2D number """ - if isinstance(z, bool): - frame_info = inspect.getframeinfo(inspect.currentframe()) - self._warn_intersect(frame_info.filename, frame_info.lineno) - if local: # transform x and y to real-world coordinates x, y = super().get_coords(x, y)