Add the Long 1974 piecewise collision kernel#1785
Conversation
ekdejong
commented
Jan 8, 2026
- Includes additional functionality in pair methods to support comparison and "where"
- Adds a new option for collision kernel dynamics
- Includes a new unit test in collision kernels
|
thank you @ekdejong !!! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1785 +/- ##
==========================================
+ Coverage 86.85% 86.93% +0.08%
==========================================
Files 415 416 +1
Lines 10558 10625 +67
==========================================
+ Hits 9170 9237 +67
Misses 1388 1388 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@slayoo Can you help me understand the test that is currently failing? I made the linter happy, but it seems like black is still acting. Do I just need to run Black locally? |
black is executed automatically via a pre-commit hook after doing (this is mentioned in the README: https://github.com/open-atmos/PySDM/blob/main/README.md?plain=1#L131-L135, but any feedback on how to better explain the workflow warmly welcome!) |
|
Thank you, @slayoo ! It's been some time since I contributed, clearly...
And speaking of which, thank you for bringing to my attention that the README has some valuable information on contributing! My bad for overlooking this. |
|
(let me also clarify that from all the above comments, adding an example notebook reproducing a figure from the paper is by far my key suggestion here, and I'm happy to help with equipping it later with a smoke test executing the notebook code) |
Thank you @ekdejong ! BTW, fun fact (thanks to @emmacware): Golovin's solution was actually given a bit earlier in the same journal by Safranov, which is why it is called Safranov kernel/solution in astrophysical literature: Safranov, V. S. (1962). "A particular solution of the coagulation equation" [in Russian: "Частный случай решения уравнения коагуляции"]. Bull. Acad. Sci. SSSR Geophys. Ser., 147 (1), 64—67. https://mathnet.ru/dan27172 |
|
@slayoo The current failing test appears related to condensation, not the kernels. Would you mind giving this PR another look (or suggesting another reviewer) so we can work toward merging? |
hi @ekdejong, the job name is misleading here, but the failure is related to the changes here: fix on the way... |
|
for the record, the "failure" can be reproduced locally with: $ pytest tests/examples_tests/test_tests_completeness.py
============================= test session starts ==============================
platform linux -- Python 3.13.5, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/user/devel/PySDM
configfile: pyproject.toml
plugins: anyio-4.12.1
collected 3 items
tests/examples_tests/test_tests_completeness.py F.. [100%]
=================================== FAILURES ===================================
_________________________ test_all_cases_in_testsuites _________________________
def test_all_cases_in_testsuites():
"""raise error, e.g., if a newly added example is not within TEST_SUITES dict"""
tmp = findfiles(
pathlib.Path(__file__)
.parent.parent.parent.absolute()
.joinpath("examples")
.joinpath("PySDM_examples"),
r".*\.(py|ipynb)$",
)
all_files = list(
filter(
lambda x: pathlib.Path(x).name != "__init__.py",
tmp,
)
)
selected_paths_set = set()
for suite_name in TEST_SUITES:
selected_paths_set.update(
map(str, get_selected_test_paths(suite_name, all_files))
)
assert len(all_files) > 0
> assert selected_paths_set == set(all_files)
E AssertionError: assert {'/home/user/..._ARG.py', ...} == {'/home/user/..._ARG.py', ...}
E
E Extra items in the right set:
E '/home/user/devel/PySDM/examples/PySDM_examples/Long_1974/simulation.py'
E '/home/user/devel/PySDM/examples/PySDM_examples/Long_1974/settings.py'
E '/home/user/devel/PySDM/examples/PySDM_examples/Long_1974/fig10_11_13_14.ipynb'
E Use -v to get more diff
tests/examples_tests/test_tests_completeness.py:32: AssertionError
=========================== short test summary info ============================
FAILED tests/examples_tests/test_tests_completeness.py::test_all_cases_in_testsuites - AssertionError: assert {'/home/user/..._ARG.py', ...} == {'/home/user/..._A...
========================= 1 failed, 2 passed in 0.16s ========================== |
Fix k specification
…labels, include pyplot.close(fig) to avoid dangling figures