Skip to content

Commit

Permalink
refactor(expired deprecation): remove warning for third parameter of …
Browse files Browse the repository at this point in the history
…Grid.intersect (modflowpy#1883)
  • Loading branch information
mwtoews authored Aug 1, 2023
1 parent 54d6099 commit 70b9a37
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 50 deletions.
34 changes: 0 additions & 34 deletions flopy/discretization/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down Expand Up @@ -957,38 +955,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,
Expand Down
6 changes: 0 additions & 6 deletions flopy/discretization/structuredgrid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import copy
import inspect
import os.path
from typing import Union

Expand Down Expand Up @@ -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)

Expand Down
5 changes: 0 additions & 5 deletions flopy/discretization/unstructuredgrid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import copy
import inspect
import os
from typing import Union

Expand Down Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions flopy/discretization/vertexgrid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import copy
import inspect
import os

import numpy as np
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 70b9a37

Please sign in to comment.