feat: #990 - [M4-P8] Jupytext Migration: Dynamics/Coagulation Functional - Sync Existing (4 notebooks)#1007
Merged
Gorkowski merged 6 commits intouncscode:mainfrom Jan 31, 2026
Conversation
- Resync four coagulation functional notebooks with their paired percent scripts - Update markdown wrapping and clear stale execution metadata - Refresh backup notebooks after clean execution and linting Closes uncscode#990 ADW-ID: cd29178c
Successfully fixed: - Re-executed the four Dynamics/Coagulation/Functional notebooks, capturing execution metadata and keeping their paired `.py`/ `.ipynb` files synchronized so the `--check-sync` validation stays clean. - Updated the `.ipynb.bak` artifacts alongside the refreshed notebooks to mirror the new execution outputs and metadata. - Polished `Custom_Nucleation_Single_Species.py` to retain the required Jupytext header/formatting and match the refreshed notebook workflow. Closes uncscode#990 ADW-ID: cd29178c
Ensure the four Dynamics/Coagulation functional notebooks have percent Jupytext headers, linted/format the .py sources, resynced, and executed each notebook to confirm no API drift. Moved executed outputs and backups into .trash for audit while keeping the cleaned sources tracked. Closes uncscode#990 ADW-ID: cd29178c
Contributor
There was a problem hiding this comment.
Pull request overview
This PR completes part of the Jupytext migration for the coagulation functional examples and tightens up a nucleation example, ensuring .ipynb and .py remain in sync while cleaning up backup artifacts.
Changes:
- Updated four coagulation functional notebooks (
PMF,PDF,PMF vs PDF,ParticleResolved) and their.pycounterparts to usepy:percentformat, refreshed headers/metadata, and aligned plotting/summary cells. - Extended and clarified helper docstrings and minor loop style in
Custom_Nucleation_Single_Species.py. - Replaced generated backup/checkpoint artifacts in
.trash/cleanup/with lightweight.removedmarkers as part of repo hygiene.
Reviewed changes
Copilot reviewed 24 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/Examples/Nucleation/Notebooks/Custom_Nucleation_Single_Species.py | Clarifies single-species array helper docstrings, adjusts import order, and simplifies a time loop variable. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_1_PMF.py | Adds Jupytext formats: ipynb,py:percent header for consistent pairing with the notebook. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_1_PMF.ipynb | Reflows intro and summary text, adds Jupytext metadata, and keeps content aligned with the .py percent script. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_2_PDF.py | Adds Jupytext formats header for the PDF coagulation example script. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_2_PDF.ipynb | Tweaks markdown formatting, ensures consistent imports order, and adds Jupytext format metadata. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_3_compared.py | Adds Jupytext formats header for the PMF vs PDF comparison script. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_3_compared.ipynb | Updates explanatory markdown, normalizes import ordering, and adds Jupytext pairing metadata. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_4_ParticleResolved.py | Adds Jupytext formats header to the particle-resolved coagulation example script. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_4_ParticleResolved.ipynb | Small markdown/plot tweaks, bins now created as a list, and adds Jupytext pairing metadata. |
| docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_4_ParticleResolved.ipynb.bak | Removes a stale backup notebook now superseded by the synced primary notebook. |
| .trash/cleanup/Coagulation_Basic_4_ParticleResolved.py.touch.removed | Tracks removal of an intermediate .py.touch artifact for the particle-resolved notebook. |
| .trash/cleanup/Coagulation_Basic_4_ParticleResolved.py.tmp.removed | Tracks removal of a temporary .py.tmp artifact for the particle-resolved notebook. |
| .trash/cleanup/Coagulation_Basic_4_ParticleResolved.ipynb.bak.removed | Tracks removal of a backup .ipynb.bak for the particle-resolved notebook. |
| .trash/cleanup/Coagulation_Basic_4_ParticleResolved-executed.ipynb/Coagulation_Basic_4_ParticleResolved.ipynb.removed | Tracks removal of an executed copy of the particle-resolved notebook used during validation. |
| .trash/cleanup/Coagulation_Basic_3_compared.py.touch.removed | Tracks removal of an intermediate .py.touch artifact for the PMF vs PDF notebook. |
| .trash/cleanup/Coagulation_Basic_3_compared.py.tmp.removed | Tracks removal of a temporary .py.tmp artifact for the PMF vs PDF notebook. |
| .trash/cleanup/Coagulation_Basic_3_compared.ipynb.bak.removed | Tracks removal of a backup .ipynb.bak for the PMF vs PDF notebook. |
| .trash/cleanup/Coagulation_Basic_2_PDF.py.touch.removed | Tracks removal of an intermediate .py.touch artifact for the PDF notebook. |
| .trash/cleanup/Coagulation_Basic_2_PDF.py.tmp.removed | Tracks removal of a temporary .py.tmp artifact for the PDF notebook. |
| .trash/cleanup/Coagulation_Basic_2_PDF.ipynb.bak.removed | Tracks removal of a backup .ipynb.bak for the PDF notebook. |
| .trash/cleanup/Coagulation_Basic_1_PMF.py.touch.removed | Tracks removal of an intermediate .py.touch artifact for the PMF notebook. |
| .trash/cleanup/Coagulation_Basic_1_PMF.py.tmp.removed | Tracks removal of a temporary .py.tmp artifact for the PMF notebook. |
| .trash/cleanup/Coagulation_Basic_1_PMF.ipynb.bak.removed | Tracks removal of a backup .ipynb.bak for the PMF notebook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
docs/Examples/Nucleation/Notebooks/Custom_Nucleation_Single_Species.py
Outdated
Show resolved
Hide resolved
docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_1_PMF.ipynb
Outdated
Show resolved
Hide resolved
…ecies.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…c_1_PMF.ipynb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 #990 | Workflow:
cd29178cSummary
Ensures the four Dynamics/Coagulation/Functional notebooks keep their paired
.pyfiles in sync via the requiredpy:percentformat, cleans up stale backup artifacts, and reruns the notebook validation/execution workflow so the checked-in examples stay current with the publicparticulaAPI.What Changed
Updated Notebooks
docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_1_PMF.*,Coagulation_Basic_2_PDF.*,Coagulation_Basic_3_compared.*,Coagulation_Basic_4_ParticleResolved.*– refreshed headers, outputs, and metadata so each.pyis inpy:percentformat, linted/rerun, and fully synced with its.ipynbcounterpart.Repository Cleanup
.trash/cleanup/*files that were generated during validation and execution runs have been removed so only the relevant examples remain under version control.How It Works
The workflow for each notebook now follows the verified edit/format/sync/execute cycle:
This cycle guarantees the
.pysources stay in percent format, match the executed notebooks, and run successfully with the current API.Implementation Notes
.pyfiles that are formally synced to their notebooks; doing the whole lint→sync→execute pipeline proves the examples remain reproducible and API-compatible..trash/cleanupfiles keeps the repository clean after the tool-based validation/execution runs.Testing
python3 .opencode/tool/validate_notebook.py docs/Examples/Dynamics/Coagulation/Functional --recursive --check-syncruff check docs/Examples/Dynamics/Coagulation/Functional/*.py --fixruff format docs/Examples/Dynamics/Coagulation/Functional/*.pyruff check docs/Examples/Dynamics/Coagulation/Functional/*.pypython3 .opencode/tool/validate_notebook.py docs/Examples/Dynamics/Coagulation/Functional --recursive --syncpython3 .opencode/tool/run_notebook.py docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_1_PMF.ipynbpython3 .opencode/tool/run_notebook.py docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_2_PDF.ipynbpython3 .opencode/tool/run_notebook.py docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_3_compared.ipynbpython3 .opencode/tool/run_notebook.py docs/Examples/Dynamics/Coagulation/Functional/Coagulation_Basic_4_ParticleResolved.ipynb