diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 9264d2ac10..569e4ab2dd 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -302,7 +302,7 @@ jobs: uses: actions/cache@v2.1.0 with: path: ~/conda_pkgs_dir - key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ hashFiles('etc/environment.yml', 'flopy') }} + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ hashFiles('etc/environment.yml') }} # Standard python fails on windows without GDAL installation # Using custom bash shell ("shell: bash -l {0}") with Miniconda diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 7015e65f18..eb624e4a83 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -291,7 +291,7 @@ jobs: uses: actions/cache@v2.1.0 with: path: ~/conda_pkgs_dir - key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ hashFiles('etc/environment.yml', 'flopy') }} + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ hashFiles('etc/environment.yml') }} # Standard python fails on windows without GDAL installation # Using custom bash shell ("shell: bash -l {0}") with Miniconda diff --git a/flopy/discretization/grid.py b/flopy/discretization/grid.py index 80d259e468..de66e32b06 100644 --- a/flopy/discretization/grid.py +++ b/flopy/discretization/grid.py @@ -680,6 +680,11 @@ def _warn_intersect(self, module, lineno): 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 @@ -698,7 +703,8 @@ def _warn_intersect(self, module, lineno): "intersect(self, x, y, z=None, local=False, " "forgive=False) interface instead." ) - warnings.warn_explicit(warning, UserWarning, module, lineno) + + raise UserWarning(warning) def set_coord_info( self, diff --git a/flopy/discretization/structuredgrid.py b/flopy/discretization/structuredgrid.py index e923b7d521..ba42de2ee5 100644 --- a/flopy/discretization/structuredgrid.py +++ b/flopy/discretization/structuredgrid.py @@ -773,9 +773,10 @@ def intersect(self, x, y, z=None, local=False, forgive=False): The column number """ - # trigger interface change warning - frame_info = inspect.getframeinfo(inspect.currentframe()) - self._warn_intersect(frame_info.filename, frame_info.lineno) + 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 902cf3995f..329718f2c3 100644 --- a/flopy/discretization/unstructuredgrid.py +++ b/flopy/discretization/unstructuredgrid.py @@ -538,8 +538,9 @@ def intersect(self, x, y, z=None, local=False, forgive=False): The CELL2D number """ - frame_info = inspect.getframeinfo(inspect.currentframe()) - self._warn_intersect(frame_info.filename, frame_info.lineno) + 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 diff --git a/flopy/discretization/vertexgrid.py b/flopy/discretization/vertexgrid.py index 251a14db1b..9ee51a0caa 100644 --- a/flopy/discretization/vertexgrid.py +++ b/flopy/discretization/vertexgrid.py @@ -283,8 +283,9 @@ def intersect(self, x, y, z=None, local=False, forgive=False): The CELL2D number """ - frame_info = inspect.getframeinfo(inspect.currentframe()) - self._warn_intersect(frame_info.filename, frame_info.lineno) + 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