Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(expired deprecation): remove warning for third parameter of Grid.intersect #1883

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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,
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