-
Notifications
You must be signed in to change notification settings - Fork 317
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
Add PRT support #1753
Add PRT support #1753
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #1753 +/- ##
=========================================
+ Coverage 72.8% 72.9% +0.1%
=========================================
Files 259 259
Lines 59040 59282 +242
=========================================
+ Hits 43004 43261 +257
+ Misses 16036 16021 -15
|
bd34690
to
d80bde9
Compare
ec81a80
to
ddbbd51
Compare
554293a
to
352aa3f
Compare
a5747db
to
264bb4f
Compare
7f56be9
to
2b24104
Compare
833eafa
to
8d9cd0f
Compare
3f7f376
to
7d4b0c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is all cleanly set up to go in. Will be good to get @jlarsen-usgs buy in.
data = data.sort_values(["imdl", "iprp", "irpt", "trelease"]) | ||
particles = data.groupby(["imdl", "iprp", "irpt", "trelease"]) | ||
seqn_key = "sequencenumber" | ||
data[seqn_key] = particles.ngroup() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just mimics a modpath sequencenumber — can't guarantee particles are indexed in the same order so this should be ignored when comparing prt and modpath results
It's possible to preserve particle identity by running modpath first, then setting prt PRP release point numbers or boundnames to modpath sequencenumbers
Could maybe add switches name_as_sequencenumber
/irpt_as_sequencenumber
or maybe simpler sequencenumber="irpt"
(or "name"
) to set sequencenumber to that property
@@ -699,7 +967,7 @@ class LRCParticleData: | |||
-------- | |||
|
|||
>>> import flopy | |||
>>> pg = flopy.modpath.LRCParticleData(lrcregions=[0, 0, 0, 3, 10, 10]) | |||
>>> pg = flopy.modpath.LRCParticleData(lrcregions=[[0, 0, 0, 3, 10, 10]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correction unrelated to PRT, lrcregions
needs to be 2D
e97a4cd
to
0c939fd
Compare
@langevin-usgs suggested adding functions to convert mp7 to PRT results (currently only the other way is supported) but otherwise that full correspondence between result formats is not necessary until there is a demonstrated need edit: added conversion functions |
01bac86
to
61b66d9
Compare
* to_coords() and to_prt() methods on particle data classes * to_[mp7/prt]_[pathlines/endpoints]() conversion functions * support plotting PRT pathlines in map/cross-section plots * add basic tests for flopy.utils.geometry.point_in_polygon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this PR look goods.
Is there anything else that needs to be added/modified for PRT export support (e.g., shapefiles, vtk)? If so, will that be included here or will there be a follow up PR?
Yes export functionality is still to come, planned in a separate PR after MF6 package classes are in |
Add basic support for MF6 PRT. #1940 and MODFLOW-USGS/modflow6#1389 depend on this. Some tests are skipped/left unimplemented until PRT classes are merged.
Features
to_coords()
andto_prp()
methods forParticleData
,LRCParticleData
,NodeParticleData
to_prt_pathlines()
,to_mp7_pathlines()
,to_mp7_endpoints()
adaptersFuture directions
create_prtsim()
function?Modpath6.create_mpsim()
, generate identical PRT simulationTrackFile
inbinaryfile.py
withget_[pathlines/endpoints]()
methods?sort_values("t").groupby(["imdl", "iprp", "irpt", "trelease"]).tail(1)