-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Dependencies:
#986 [M4-P4] ──► #THIS [M4-P5]
Dependencies:
- M4-P4: [M4-P4] Jupytext Migration: Particle_Phase Functional + Chamber_Wall_Loss Part 1 (3 notebooks) #986
Description
Convert 3 notebooks from the Chamber_Wall_Loss directory to Jupytext paired sync format (.py:percent). This is Phase 5 of the M4 Jupytext Full Migration maintenance plan, completing the wall loss tutorials.
Context
This is part of the M4 maintenance plan to complete Jupytext paired sync migration for all remaining notebooks in docs/Examples/. Continues from M4-P4 which started Chamber_Wall_Loss notebooks.
Value:
- Enables editing notebooks as plain Python files (better diffs, linting, IDE support)
- Validates notebook content through linting
- Completes wall loss tutorial coverage including rectangular geometry and forward simulation
Note: Wall loss API was recently updated - watch for any API changes during execution.
Scope
Estimated Lines of Code: ~50 lines (metadata + formatting changes per .py file)
Complexity: Low
Notebooks to Convert (3):
docs/Examples/Chamber_Wall_Loss/Notebooks/Rectangular_Wall_Loss_Strategy.ipynbdocs/Examples/Chamber_Wall_Loss/Notebooks/wall_loss_builders_factory.ipynbdocs/Examples/Chamber_Wall_Loss/Notebooks/Chamber_Forward_Simulation.ipynb
Files Created:
docs/Examples/Chamber_Wall_Loss/Notebooks/Rectangular_Wall_Loss_Strategy.py(~100-200 LOC)docs/Examples/Chamber_Wall_Loss/Notebooks/wall_loss_builders_factory.py(~100-200 LOC)docs/Examples/Chamber_Wall_Loss/Notebooks/Chamber_Forward_Simulation.py(~100-200 LOC)
Acceptance Criteria
Conversion
- All 3 notebooks converted to
.py:percentformat usingvalidate_notebook --convert-to-py - Each
.pyfile has proper Jupytext header withpy:percentformat
Linting
- Run
ruff check --fixon all new.pyfiles - Run
ruff formaton all new.pyfiles - Final
ruff checkpasses with no errors
Sync Validation
- Sync
.pychanges back to.ipynbusingvalidate_notebook --sync - Validate sync status with
validate_notebook --check-sync(must pass)
Execution
- All 3 notebooks execute successfully using
run_notebook - No API deprecation warnings or errors in output
- Review output for any wall loss API issues (document if found)
Technical Notes
Conversion Workflow
For each notebook:
# 1. Convert to .py:percent format
python3 .opencode/tool/validate_notebook.py docs/Examples/Chamber_Wall_Loss/Notebooks/Rectangular_Wall_Loss_Strategy.ipynb --convert-to-py
# 2. Lint the new .py file
ruff check docs/Examples/Chamber_Wall_Loss/Notebooks/Rectangular_Wall_Loss_Strategy.py --fix
ruff format docs/Examples/Chamber_Wall_Loss/Notebooks/Rectangular_Wall_Loss_Strategy.py
# 3. Sync linted .py back to .ipynb
python3 .opencode/tool/validate_notebook.py docs/Examples/Chamber_Wall_Loss/Notebooks/Rectangular_Wall_Loss_Strategy.ipynb --sync
# 4. Validate sync status
python3 .opencode/tool/validate_notebook.py docs/Examples/Chamber_Wall_Loss/Notebooks/Rectangular_Wall_Loss_Strategy.ipynb --check-sync
# 5. Execute to verify notebook works
python3 .opencode/tool/run_notebook.py docs/Examples/Chamber_Wall_Loss/Notebooks/Rectangular_Wall_Loss_Strategy.ipynbAPI Validation
During execution, watch especially for wall loss API changes:
- Import path changes (deprecation warnings)
- Function signature changes
- Builder/Factory pattern changes
- Rectangular geometry parameter changes
If API issues are found, fix them
References
Maintenance Plan:
adw-docs/dev-plans/maintenance/M4-jupytext-full-migration.md- Full migration plan
Related:
- [M4-P4] Jupytext Migration: Particle_Phase Functional + Chamber_Wall_Loss Part 1 (3 notebooks) #986 - M4-P4 (dependency)
adw-docs/documentation_guide.md- Notebook editing guidelines