Skip to content

Conversation

@AgnieszkaZaba
Copy link
Collaborator

@AgnieszkaZaba AgnieszkaZaba commented Dec 13, 2025

Changes taken from #1757

@slayoo
Copy link
Member

slayoo commented Dec 13, 2025

thanks!

@slayoo slayoo changed the title new droplet attribute: diffusional_growth_mass_change new droplet attribute: diffusional_growth_mass_change (a temporary kludge without support for collisional processes) Dec 13, 2025
@slayoo slayoo changed the title new droplet attribute: diffusional_growth_mass_change (a temporary kludge without support for collisional processes) new droplet attribute: diffusional_growth_mass_change (a temporary kludge without support for collisional processes); new initialisers mechanism in Particulator Dec 13, 2025
@AgnieszkaZaba
Copy link
Collaborator Author

I got this error:

FAILED [ 50%]
tests/unit_tests/attributes/test_diffusional_growth_mass_change.py:9 (test_diffusional_growth_mass_change[CPU])
backend_instance = <PySDM.backends.numba.Numba object at 0x108dbd490>

    def test_diffusional_growth_mass_change(backend_instance):
        """check diffusional growth mass change updated after Condensation"""
        # arrange
        n_sd = 1
        dt = 1 * si.s
    
        builder = Builder(
            backend=backend_instance, n_sd=n_sd, environment=MoistBox(dt=dt, dv=np.nan)
        )
        builder.add_dynamic(AmbientThermodynamics())
        builder.add_dynamic(Condensation())
        builder.request_attribute("diffusional growth mass change")
        particulator = builder.build(
            attributes={
                "water mass": np.ones(n_sd) * si.ng,
                "multiplicity": np.ones(n_sd),
                "dry volume": (dry_volume := np.ones(n_sd) * si.nm**3),
                "kappa times dry volume": np.ones(n_sd) * dry_volume * 0.6,
            }
        )
        particulator.environment["rhod"] = 1 * si.kg / si.m**3
        particulator.environment["thd"] = 300 * si.K
        particulator.environment["water_vapour_mixing_ratio"] = 10 * si.g / si.kg
    
        # act
>       particulator.run(steps=1)

tests/unit_tests/attributes/test_diffusional_growth_mass_change.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
PySDM/particulator.py:59: in run
    dynamic()
PySDM/dynamics/condensation.py:104: in __call__
    self.particulator.condensation(
PySDM/particulator.py:153: in condensation
    v_cr=self.attributes["critical volume"],
PySDM/impl/particle_attributes.py:93: in __getitem__
    return self.__attributes[item].get()
PySDM/attributes/impl/attribute.py:32: in get
    self.update()
PySDM/attributes/impl/derived_attribute.py:23: in update
    self.recalculate()
PySDM/attributes/physics/critical_volume.py:35: in recalculate
    else self.environment["T"]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.unit_tests.dynamics.test_vapour_deposition_on_ice.MoistBox object at 0x112b73cb0>
item = 'T'

    def __getitem__(self, item):
>       return self._ambient_air[item]
E       KeyError: 'T'

PySDM/environments/box.py:20: KeyError

@slayoo Do you know what else I should fix/update?

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.76%. Comparing base (a7b61bc) to head (9bf7a5e).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1767      +/-   ##
==========================================
+ Coverage   86.68%   86.76%   +0.07%     
==========================================
  Files         413      414       +1     
  Lines       10454    10485      +31     
==========================================
+ Hits         9062     9097      +35     
+ Misses       1392     1388       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AgnieszkaZaba AgnieszkaZaba self-assigned this Dec 20, 2025
@slayoo slayoo enabled auto-merge December 20, 2025 23:01
@slayoo slayoo added this pull request to the merge queue Dec 21, 2025
Merged via the queue into open-atmos:main with commit e8a464b Dec 21, 2025
176 of 178 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants