Skip to content

fix: #921 - [M2-P7] Coagulation charge notebooks - API migration#939

Merged
Gorkowski merged 1 commit intouncscode:mainfrom
Gorkowski:issue-921-adw-d7a24969
Jan 22, 2026
Merged

fix: #921 - [M2-P7] Coagulation charge notebooks - API migration#939
Gorkowski merged 1 commit intouncscode:mainfrom
Gorkowski:issue-921-adw-d7a24969

Conversation

@Gorkowski
Copy link
Collaborator

Target Branch: main

Fixes #921 | Workflow: d7a24969

Summary

Updates both charge coagulation notebooks to the current builder/factory APIs to keep the tutorials aligned with the public particula.dynamics namespace. Markdown calling out the learning objectives was refreshed, outputs were cleared, and the notebooks were validated via run_notebook so CI can continue to exercise them.

What Changed

Updated Notebooks

  • docs/Examples/Dynamics/Coagulation/Charge/Coagulation_with_Charge_objects.ipynb - Imports particula as par, builds ChargedCoagulationStrategy via ChargedCoagulationBuilder with an explicit ChargedKernelStrategy, and narrates how the builder wires the kernel into the charged coagulation pipeline.
  • docs/Examples/Dynamics/Coagulation/Charge/Coagulation_with_Charge_functional.ipynb - Uses CoagulationFactory (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 particula through the public namespace (import particula as par). The object-oriented example builds the charged coagulation strategy via ChargedCoagulationBuilder().set_distribution_type("discrete").set_charged_kernel_strategy(kernel).build(), while the functional notebook obtains the same strategy through CoagulationFactory().get_strategy("charged", parameters={...}). Kernel strategies such as CoulombGatti2008KernelStrategy are instantiated once and fed into the builder/factory, keeping the class composition explicit and the downstream calculations unchanged.

Implementation Notes

  • Why this approach: Using the builder/factory surfaces the public API, aligns the notebooks with the documented patterns from M2, and keeps the kernel selection explicit for learners.
  • Learning objectives: Both notebooks now mention the migration to builder/factory compositions so the narrative matches the code.
  • Outputs: All output cells were cleared to keep diffs clean before committing.

Testing

  • run_notebook: Coagulation_with_Charge_objects.ipynb (pass, 3.84s)
  • run_notebook: Coagulation_with_Charge_functional.ipynb (pass, 3.48s)

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
Copilot AI review requested due to automatic review settings January 22, 2026 02:07
@Gorkowski Gorkowski added agent Created or managed by ADW automation blocked Blocked - review required before ADW can process labels Jan 22, 2026
Copy link
Contributor

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.

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.

@Gorkowski Gorkowski merged commit 5b2ed7f into uncscode:main Jan 22, 2026
8 checks passed
@Gorkowski Gorkowski deleted the issue-921-adw-d7a24969 branch January 22, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Created or managed by ADW automation blocked Blocked - review required before ADW can process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M2-P7] Coagulation charge notebooks - API migration

1 participant