Skip to content

Commit

Permalink
refactor(modpathfile): step toward generic particle tracking api
Browse files Browse the repository at this point in the history
* introduce particletracking module and ParticleTrackFile base class
* rename _ModpathSeries -> ModpathFile
* deduplicate shared logic in ModpathFile
* add dtypes as public class attributes
* clarify canonical (minimal) fields
* prep to support PRT output files
  • Loading branch information
wpbonelli committed Mar 21, 2024
1 parent b142b08 commit 27f80f6
Show file tree
Hide file tree
Showing 5 changed files with 758 additions and 1,218 deletions.
2 changes: 1 addition & 1 deletion autotest/test_modpathfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def test_write_shapefile(function_tmpdir, mp7_small, longfieldname):

# write the pathline recarray to shapefile
pathline_file.write_shapefile(
pathline_data=pathlines,
data=pathlines,
shpname=shp_file,
one_per_particle=False,
mg=grid,
Expand Down
12 changes: 2 additions & 10 deletions autotest/test_mp5.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import os

import numpy as np
import pandas as pd
from autotest.test_mp6 import eval_timeseries
from matplotlib import pyplot as plt
from modflow_devtools.markers import requires_pkg

from flopy.modflow import Modflow
from flopy.plot import PlotMapView
Expand Down Expand Up @@ -50,14 +48,8 @@ def test_mp5_load(function_tmpdir, example_data_path):
for n in pthobj.nid:
p = pthobj.get_data(partid=n)
e = endobj.get_data(partid=n)
try:
mm.plot_pathline(p, colors=colors[n], layer="all")
except:
assert False, f'could not plot pathline {n + 1} with layer="all"'
try:
mm.plot_endpoint(e)
except:
assert False, f'could not plot endpoint {n + 1} with layer="all"'
mm.plot_pathline(p, colors=colors[n], layer="all")
mm.plot_endpoint(e)

# plot the grid and ibound array
mm.plot_grid(lw=0.5)
Expand Down
1 change: 0 additions & 1 deletion flopy/utils/flopy_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ def loadtxt(
ra : np.recarray
Numpy record array of file contents.
"""
from ..utils import import_optional_dependency

if use_pandas:
if delimiter.isspace():
Expand Down
Loading

0 comments on commit 27f80f6

Please sign in to comment.