-
Notifications
You must be signed in to change notification settings - Fork 34
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
Seeding dynamic and associated initialisation logic (super-droplet injection during simulation) #1367
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1367 +/- ##
==========================================
+ Coverage 84.30% 84.61% +0.30%
==========================================
Files 373 375 +2
Lines 9160 9247 +87
==========================================
+ Hits 7722 7824 +102
+ Misses 1438 1423 -15 ☔ View full report in Codecov by Sentry. |
Some sanity check tests to add in might be 1) checking that turning on Seeding dynamic but having time_window=0 yields the same results as no seeding, 2) checking that all particles have multiplicity > 0 by end of seeding window, and then a more physical check would be to check that the droplet number concentrations are larger and the droplet sizes are smaller when you have seeding. Hopefully these will address the warnings from Codecov :) |
In 292d4fb, there is a seeding/no-seeding plot layout depicting what happens also without seeding |
@slayoo I tried to write a unit test for the Seeding dynamic. It's here. https://github.com/claresinger/PySDM/blob/sd_injection/tests/unit_tests/dynamics/seeding/test_parcel_seeding_sanity_checks.py |
@claresinger, thanks! To push to this PR's branch, you should be able to do:
|
great that the push worked, thanks! |
BTW, adding a new folder in smoke tests requires also adding an entry here:
|
Looking close, I'd say we can better simplify the test to just use a Box env and a few timesteps, without invoking all the notebook machinery. But let me look at it tomorrow |
…on refactor, parallel=False for seeding backend method
…nt plot in the seeding hello world notebook
here it is: d3318e6 |
…ng shuffle. update todos.
Remaining items, to be handled in another PR, are documented in issue #1387 |
…g method in unit tests to retain similarity to real code.
Pylint is passing. ✅ |
Thank you, @claresinger ! |
I think the problem is that I think this is a valid case, so we should update the function and add a unit test for this case. |
Good point! Thank you! |
codecov reports that the only single line missing test coverage is now ( + if n_null == 0:
+ raise ValueError(
+ "No available seeds to inject. Please provide particles with nan filled attributes."
+ ) |
And here's a pattern we could use to actually check what type of exception is thrown in case of errors and if the exception message matches some expected string: https://stackoverflow.com/a/77005620/1487910 |
Does it make sense to include a case with both background and seed SDs in the backend test to ensure this coverage? |
working on the tests now... |
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.
Pending pylint fixes and passing the new tests, I think this looks great!
@claresinger, @jtbuch, we've made it! |
Just ran the code and everything looks good to me! |
… in multi_process_b now
No description provided.