fix: #983 - [M4-P1] Jupytext Migration: Aerosol + Equilibria (3 notebooks)#998
Merged
Gorkowski merged 1 commit intouncscode:mainfrom Jan 30, 2026
Merged
Conversation
Successfully fixed: - Documented M4 phase plan restructure and readiness status for the Jupytext migration - Converted the Aerosol and Equilibria notebooks to py:percent scripts with preserved kernelspec metadata and execution markers - Added the generated .py scripts alongside their synced .ipynb counterparts to keep them linted and executable Still failing (if any): - None ADW-ID: 24208117
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements Phase 1 of the M4 Jupytext migration plan, converting 3 example notebooks (Aerosol_Tutorial, equilibria_part1, and activity_part1) to Jupytext paired-sync format. Each notebook now has a paired Python source file in py:percent format that has been linted with Ruff and re-executed to ensure functionality.
Changes:
- Converts 3 notebooks to Jupytext paired sync (py:percent format)
- Adds linted Python source files for IDE-friendly editing
- Refreshes notebook outputs after clean execution
- Updates M4 migration plan to reflect phase structure
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/Examples/Equilibria/Notebooks/equilibria_part1.py | New paired Python source for equilibria Part 1 notebook in percent format |
| docs/Examples/Equilibria/Notebooks/equilibria_part1.ipynb | Synced notebook with updated metadata and refreshed outputs |
| docs/Examples/Equilibria/Notebooks/activity_part1.py | New paired Python source for Activity Part 1 with proper Jupytext headers |
| docs/Examples/Aerosol/Aerosol_Tutorial.py | New paired Python source for Aerosol tutorial |
| docs/Examples/Aerosol/Aerosol_Tutorial.ipynb | Synced notebook with cell IDs and execution timestamps |
| adw-docs/dev-plans/maintenance/M4-jupytext-full-migration.md | Updated maintenance plan with revised phase structure (max 3 notebooks per phase) |
💡 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 #983 | Workflow:
24208117Summary
Converted the three remaining Aerosol and Equilibria example notebooks listed in the M4 migration plan to Jupytext
py:percentpaired-sync scripts. Each notebook now has a linted Python source, synced metadata that preserves the original kernelspecs, and a clean execution run so the examples remain up to date.What Changed
New Components
docs/Examples/Aerosol/Aerosol_Tutorial.py- Percent-format script paired with the Aerosol tutorial notebook, mirroring cell structure and metadata.docs/Examples/Equilibria/Notebooks/equilibria_part1.py- New paired Python source for the equilibria Part 1 notebook, enabling IDE-friendly edits.docs/Examples/Equilibria/Notebooks/activity_part1.py- New paired Python source for Activity Part 1 with matching cell markers and metadata headers.Modified Components
docs/Examples/Aerosol/Aerosol_Tutorial.ipynb- Synced cells, updated metadata, and outputs refreshed after executing the linted script.docs/Examples/Equilibria/Notebooks/equilibria_part1.ipynb- Synced with the new.pyfile and rerun to confirm outputs.docs/Examples/Equilibria/Notebooks/activity_part1.ipynb- Synced with the new.pyfile, keeping kernelspec/time stamps in lock-step.maintenance/M4-jupytext-full-migration.md- Notes progress for the Phase 1 migration batch.Tests Added/Updated
ruff check docs/Examples/Aerosol/Aerosol_Tutorial.py --fix && ruff format docs/Examples/Aerosol/Aerosol_Tutorial.pyruff check docs/Examples/Equilibria/Notebooks/equilibria_part1.py --fix && ruff format docs/Examples/Equilibria/Notebooks/equilibria_part1.pyruff check docs/Examples/Equilibria/Notebooks/activity_part1.py --fix && ruff format docs/Examples/Equilibria/Notebooks/activity_part1.pypython3 .opencode/tool/validate_notebook.py <notebook>.ipynb --syncand--check-syncfor each pair.python3 .opencode/tool/run_notebook.py <notebook>.ipynbfor all three notebooks.How It Works
Each notebook was converted using
validate_notebook --convert-to-py, producing apy:percentscript with the required jupytext header (format 1.3 and the original kernelspec display name). The scripts were linted and formatted with Ruff, then synced back to the.ipynbfiles and validated (--check-sync) before executing them withrun_notebook.py. This workflow keeps markdown/code cells, metadata, and outputs aligned between the notebook and its paired script, making future edits possible directly in the Python sources.Implementation Notes
format_name: percent/format_version: '1.3'/jupytext_version: 1.17.3and the kernelspec display names observed in each notebook.ruff check --fixfollowed byruff formatensures the paired scripts match repository style rules before syncing.Testing
.pyscript..ipynbfiles sync-validated viavalidate_notebook --sync/--check-sync.run_notebook.pyexecuted each notebook successfully to refresh outputs and confirm there are no runtime/API issues.