Skip to content

Commit

Permalink
fix(modpath7): address #993 and #1053 (#1170)
Browse files Browse the repository at this point in the history
closes #993 
closes #1053
  • Loading branch information
jdhughes-usgs committed Aug 6, 2021
1 parent 090849e commit 9020bf3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
10 changes: 9 additions & 1 deletion flopy/modpath/mp7particledata.py
Expand Up @@ -340,9 +340,17 @@ def write(self, f=None):
d = np.recarray.copy(self.particledata)
lnames = [name.lower() for name in d.dtype.names]
# Add one to the kij and node indices
for idx in ["k", "i", "j", "node", "id"]:
for idx in (
"k",
"i",
"j",
"node",
):
if idx in lnames:
d[idx] += 1
# Add one to the particle id if required
if self.particleidoption == 0 and "id" in lnames:
d["id"] += 1

# write the particle data
fmt = self._fmt_string + "\n"
Expand Down
12 changes: 8 additions & 4 deletions flopy/utils/modpathfile.py
Expand Up @@ -204,7 +204,8 @@ def get_destination_data(self, dest_cells, to_recarray=True):
Parameters
----------
dest_cells : list or array of tuples
(k, i, j) of each destination cell (zero-based)
(k, i, j) of each destination cell for MODPATH versions less than
MODPATH 7 or node number of each destination cell. (zero based)
to_recarray : bool
Boolean that controls returned series. If to_recarray is True,
a single recarray with all of the pathlines that intersect
Expand Down Expand Up @@ -724,7 +725,8 @@ def get_destination_pathline_data(self, dest_cells, to_recarray=False):
Parameters
----------
dest_cells : list or array of tuples
(k, i, j) of each destination cell (zero-based)
(k, i, j) of each destination cell for MODPATH versions less than
MODPATH 7 or node number of each destination cell. (zero based)
to_recarray : bool
Boolean that controls returned pthldest. If to_recarray is True,
a single recarray with all of the pathlines that intersect
Expand Down Expand Up @@ -1180,7 +1182,8 @@ def get_destination_endpoint_data(self, dest_cells, source=False):
Parameters
----------
dest_cells : list or array of tuples
(k, i, j) or (node,) of each destination cell (zero-based)
(k, i, j) of each destination cell for MODPATH versions less than
MODPATH 7 or node number of each destination cell. (zero based)
source : bool
Boolean to specify is dest_cells applies to source or
destination cells (default is False).
Expand Down Expand Up @@ -1630,7 +1633,8 @@ def get_destination_timeseries_data(self, dest_cells):
Parameters
----------
dest_cells : list or array of tuples
(k, i, j) or nodes of each destination cell (zero-based)
(k, i, j) of each destination cell for MODPATH versions less than
MODPATH 7 or node number of each destination cell. (zero based)
Returns
-------
Expand Down

0 comments on commit 9020bf3

Please sign in to comment.