Skip to content

Conversation

@lursz
Copy link
Member

@lursz lursz commented Jun 9, 2025

👽

emmacware and others added 18 commits May 26, 2025 22:58
* parallel v1

* thread count fix

* parallel

* small parallel fixes

* working multithread solution

* Multi-thread + vector plots

* black, black used everywhere

---------

Co-authored-by: Piotr Kubala <[email protected]>
* tests I guess

* uv fix

* planet impl

* ground truth

* gen plot function

* unit tests, monoticity tests, sanity tests

* tests are now in tests

* added ground truth files

* removed leftovers

* npy files

* tests tidyup

* tests adapted for current structure

but still useless

* renamed test to comply with pytest convention

* fix ground_truth generation script

* refactor unittests

* added accuracy tests

* Added saturation test for cloud base in unit tests

* Refactored imports and clean up unused code in simulation and parcel modules

* Enhanced accuracy tests by adding assertions for output completeness and consistency in unit tests

* Refactored calculation of simulated mass fraction evaporation point to initialize variable and improved error handling

---------

Co-authored-by: Hevagog <[email protected]>
Co-authored-by: Mateusz Mazur <[email protected]>
@lursz lursz changed the base branch from develop to main June 9, 2025 21:46

This comment was marked as outdated.

Copy link

@mzsuetam mzsuetam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but we need to address some of the changes proposed by Copilot

mzsuetam and others added 2 commits June 10, 2025 13:18
…gen_figure.py


Using dir shadowed the built-in dir() function. Renamed this variable (e.g., root_dir) to avoid confusion.

Co-authored-by: Copilot <[email protected]>
Copy link

@mzsuetam mzsuetam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, lets ship it! 🚢

Copy link

@piotrkubala piotrkubala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments

@mzsuetam mzsuetam requested a review from Copilot June 10, 2025 12:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates the Loftus & Wordsworth (2021) planetary raindrop example into the PySDM codebase, adding example modules and a comprehensive test suite.

  • Add new example package Loftus_and_Wordsworth_2021 with settings, planet definitions, parcel environment, and simulation driver
  • Introduce unit, accuracy, and ground-truth generation tests under tests/examples_tests/Loftus_and_Wordsworth_2021
  • Update conftest.py to discover the new example tests

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/examples_tests/conftest.py Include Loftus_and_Wordsworth_2021 in test-discovery patterns
tests/examples_tests/Loftus_and_Wordsworth_2021/unit_test.py Unit tests for planet classes, parcel init, and simulation API
tests/examples_tests/Loftus_and_Wordsworth_2021/accuracy_test.py Accuracy tests comparing simulation outputs to .npy ground truth
tests/examples_tests/Loftus_and_Wordsworth_2021/ground_truth/gen_figure.py Script to regenerate Figure 2 ground truth data
examples/PySDM_examples/Loftus_and_Wordsworth_2021/settings.py New Settings class for example configuration
examples/PySDM_examples/Loftus_and_Wordsworth_2021/simulation.py New Simulation wrapper around PySDM builder/dynamics pipeline
examples/PySDM_examples/Loftus_and_Wordsworth_2021/planet.py Planet‐specific dataclasses (EarthLike, Jupiter, etc.)
examples/PySDM_examples/Loftus_and_Wordsworth_2021/parcel.py Custom AlienParcel subclass for environment dynamics
examples/PySDM_examples/Loftus_and_Wordsworth_2021/init.py Package initialization and docstring
PySDM/physics/terminal_velocity/init.py Adjusted module docstring formatting
Comments suppressed due to low confidence (3)

tests/examples_tests/conftest.py:86

  • [nitpick] Directory and module names are uppercase and use underscores; consider renaming to a lowercase package path to follow PEP 8 package naming conventions.
"Loftus_and_Wordsworth_2021",

tests/examples_tests/Loftus_and_Wordsworth_2021/ground_truth/gen_figure.py:95

  • The variable dir is undefined here; it should use the previously defined root_dir to construct the path.
figs_path = os.path.join(dir, "figs")

examples/PySDM_examples/Loftus_and_Wordsworth_2021/settings.py:34

  • si.metres is not a valid attribute; the correct SI unit property is si.metre.
self.z_half = 150 * si.metres

@lursz lursz changed the base branch from main to rain-on-me June 10, 2025 14:42
@lursz lursz merged commit 4e00199 into rain-on-me Jun 10, 2025
23 of 28 checks passed
mzsuetam added a commit that referenced this pull request Jun 19, 2025
* simulation setup

* uv lock

* introduced all equations

* oblate spheroid impl

* AlienParcel class extending Parcel

* PySDM package internal imports fix

* Formulae bug fixes

* Planet is now dataclass instead of dict

* drop falling without pancake shape

* cloudbase fix

* figure settings

* multicore support for simulation (#2)

* parallel v1

* thread count fix

* parallel

* small parallel fixes

* working multithread solution

* Multi-thread + vector plots

* black, black used everywhere

---------

Co-authored-by: Piotr Kubala <[email protected]>

* pip install joblib

* Tests (#1)

* tests I guess

* uv fix

* planet impl

* ground truth

* gen plot function

* unit tests, monoticity tests, sanity tests

* tests are now in tests

* added ground truth files

* removed leftovers

* npy files

* tests tidyup

* tests adapted for current structure

but still useless

* renamed test to comply with pytest convention

* fix ground_truth generation script

* refactor unittests

* added accuracy tests

* Added saturation test for cloud base in unit tests

* Refactored imports and clean up unused code in simulation and parcel modules

* Enhanced accuracy tests by adding assertions for output completeness and consistency in unit tests

* Refactored calculation of simulated mass fraction evaporation point to initialize variable and improved error handling

---------

Co-authored-by: Hevagog <[email protected]>
Co-authored-by: Mateusz Mazur <[email protected]>

* Notebook not running fix - added back necessary imports

m8 u removed too much

* black formatter

* black for ipynb

* Update PySDM/physics/particle_shape_and_density/oblate_spheroid.py

Co-authored-by: Copilot <[email protected]>

* Updated tests/examples_tests/Loftus_and_Wordsworth_2021/ground_truth/gen_figure.py

Using dir shadowed the built-in dir() function. Renamed this variable (e.g., root_dir) to avoid confusion.

Co-authored-by: Copilot <[email protected]>

* Fixed pressure values in Planet subclasses to use correct scientific notation

* Updated method signature for proper binding.

Co-authored-by: Copilot <[email protected]>

* Refactored Settings class to remove unused 'coord' parameter and updated diffusion_coordinate assignment

* Removed unused Lofus et al. 2021 implementations from particle shape and density, terminal velocity, and ventilation modules

* plots warnings fixes

* removed files rogers and yau

* notebook rerun

* notebook fix

* minor linter fixes

---------

Co-authored-by: emmacware <[email protected]>
Co-authored-by: Piotr Kubala <[email protected]>
Co-authored-by: Hevagog <[email protected]>
Co-authored-by: Mateusz Mazur <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants