Add optional parameters to walk data and a new function related to seeding#60
Conversation
…alk data corresponding to the optional ROI boundary raster. If no ROI is input, all particle flags will be 0.
…ude an optional ROI raster for island flagging.
…ss. also added a function to particle_track to flux normalize seeding of particles in unsteady conditions
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #60 +/- ##
==========================================
- Coverage 95.64% 95.03% -0.61%
==========================================
Files 4 4
Lines 712 786 +74
==========================================
+ Hits 681 747 +66
- Misses 31 39 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hello, all. I believe I have addressed the original issues in the I am not sure what the two codecov/ failing checks are referring to. Aside from that, @elbeejay I just chatted with @wrightky about the final update remaining, which would be adjusting One other small thing I noticed in Thanks! |
They are tracking the test "coverage" which is defined by codecov as the fraction of lines of code that the unit tests execute. Those two are failing because because the altered code in the diff is 73.25% covered by the tests while the pre-existing version of the code is 95.65% covered by the tests. The second one just indicates the merging the changes would drop coverage 2.45%. All that being said, fraction of lines covered by the tests isn't necessarily the "best" measure of software testing; it is entirely possible to "cover" 100% of the codebase with meaningless tests. Just wanted to give you the context on those checks.
If you have the time that sounds great!
Yep if you're in there and want to make that update so the keys are consistent across the serial and parallel implementations that would be fantastic. 👍 |
elbeejay
left a comment
There was a problem hiding this comment.
Looks like a positive addition to the package @eghenson. Definitely some nice new functionality. I have a couple of questions in addition to my review comments:
-
What do you think about adding tests for the new
flux_proportional_seedingfunction to thetest_particle_track.pyscript? -
Are you planning to add or expand on any example scripts to showcase how this new functionality can be used?
Also as a note, before this is merged (once ready) we need to remember to increment the version number of the package in the __init__.py and pyproject.toml files (#51)
I added some tests here - let me know if you think there should be a more advanced one, @elbeejay !
I also added a short example script called
|
|
Not going to hold this up any longer... |
|
Thanks @elbeejay! Apologies for not following up on this, I've looked it over a few times now and kept getting distracted before finishing the merge, but everything looks good to me. |
This PR includes 3 adjustments to dorado.
modelParamsclass (e.g.,depth,stage,qx,v, etc.) to be recorded in walk data.These variables can now be selected as particle outputs by specifying them in
params.particle_variableswhen initializing the model.roi_flag— a binary flag (0/1) indicating whether a particle step occurs within a specified roi grid, set byparams.roi_gridflux_proportional_seedinginparticle_track.pyThis function supports unsteady particle seeding by allocating the number of particles seeded at each timestep proportional to the discharge magnitude at that timestep. It requires a discharge array preprocessed to match the seeding timesteps at the seeding location.
These additions allow users to record additional variables along particle trajectories for various purposes. If no
params.particle_variablesare set, the default should be the normal walk data comprised ofxinds,yinds,travel_times.I have used these functionalities to output depth and roi_flag at each particle step to estimate potential nutrient processing within selected regions of a domain.
Looking forward to feedback!