fix: #921 - [M2-P7] Coagulation charge notebooks - API migration#939
Merged
Gorkowski merged 1 commit intouncscode:mainfrom Jan 22, 2026
Merged
fix: #921 - [M2-P7] Coagulation charge notebooks - API migration#939Gorkowski merged 1 commit intouncscode:mainfrom
Gorkowski merged 1 commit intouncscode:mainfrom
Conversation
Align functional charged coagulation example with CoagulationFactory and public particula imports. Migrate object-oriented example to ChargedCoagulationBuilder with explicit distribution type. Refresh markdown objectives, clear outputs, and re-execute notebooks to validate the workflow. Closes uncscode#921 ADW-ID: d7a24969
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Target Branch:
mainFixes #921 | Workflow:
d7a24969Summary
Updates both charge coagulation notebooks to the current builder/factory APIs to keep the tutorials aligned with the public
particula.dynamicsnamespace. Markdown calling out the learning objectives was refreshed, outputs were cleared, and the notebooks were validated viarun_notebookso CI can continue to exercise them.What Changed
Updated Notebooks
docs/Examples/Dynamics/Coagulation/Charge/Coagulation_with_Charge_objects.ipynb- Importsparticula as par, buildsChargedCoagulationStrategyviaChargedCoagulationBuilderwith an explicitChargedKernelStrategy, and narrates how the builder wires the kernel into the charged coagulation pipeline.docs/Examples/Dynamics/Coagulation/Charge/Coagulation_with_Charge_functional.ipynb- UsesCoagulationFactory(with the same kernel strategy) to obtain the charged coagulation strategy, cleanly replacing the previous direct kernel instantiations while preserving the functional storytelling.Tests Added/Updated
run_notebook({notebookPath: "docs/Examples/Dynamics/Coagulation/Charge/Coagulation_with_Charge_objects.ipynb", timeout: 300})run_notebook({notebookPath: "docs/Examples/Dynamics/Coagulation/Charge/Coagulation_with_Charge_functional.ipynb", timeout: 300})How It Works
Each notebook now sources
particulathrough the public namespace (import particula as par). The object-oriented example builds the charged coagulation strategy viaChargedCoagulationBuilder().set_distribution_type("discrete").set_charged_kernel_strategy(kernel).build(), while the functional notebook obtains the same strategy throughCoagulationFactory().get_strategy("charged", parameters={...}). Kernel strategies such asCoulombGatti2008KernelStrategyare instantiated once and fed into the builder/factory, keeping the class composition explicit and the downstream calculations unchanged.Implementation Notes
Testing
Coagulation_with_Charge_objects.ipynb(pass, 3.84s)Coagulation_with_Charge_functional.ipynb(pass, 3.48s)