-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Dependencies:
#990 [M4-P8] ──► #THIS [M4-P9]
Dependencies:
- M4-P8: [M4-P8] Jupytext Migration: Dynamics/Coagulation Functional - Sync Existing (4 notebooks) #990
Description
Convert 3 notebooks from the Dynamics/Condensation directory to Jupytext paired sync format (.py:percent). This is Phase 9 of the M4 Jupytext Full Migration maintenance plan, covering core condensation tutorials.
Important: The condensation API was recently updated. If any notebooks contain outdated API calls, update them to use the current API before completing the conversion.
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-P8 which validated Coagulation Functional notebooks.
Value:
- Enables editing notebooks as plain Python files (better diffs, linting, IDE support)
- Validates notebook content through linting
- Covers bin, mass bin, and mass resolved condensation patterns
- Ensures notebooks use current condensation API (no deprecated calls)
Scope
Estimated Lines of Code: ~50-150 lines (metadata + formatting + any API updates)
Complexity: Low-Medium
Notebooks to Convert (3):
docs/Examples/Dynamics/Condensation/Condensation_1_Bin.ipynbdocs/Examples/Dynamics/Condensation/Condensation_2_MassBin.ipynbdocs/Examples/Dynamics/Condensation/Condensation_3_MassResolved.ipynb
Files Created:
docs/Examples/Dynamics/Condensation/Condensation_1_Bin.py(~100-200 LOC)docs/Examples/Dynamics/Condensation/Condensation_2_MassBin.py(~100-200 LOC)docs/Examples/Dynamics/Condensation/Condensation_3_MassResolved.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
API Updates (REQUIRED if outdated)
- Review execution output for deprecation warnings or API errors
- Update any outdated import paths to current API
- Update any deprecated function calls to current equivalents
- Update any changed function signatures (parameters renamed/added/removed)
- Verify updated code produces equivalent results
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 in output
- No errors or exceptions during execution
Technical Notes
Conversion Workflow
For each notebook:
# 1. Convert to .py:percent format
python3 .opencode/tool/validate_notebook.py docs/Examples/Dynamics/Condensation/Condensation_1_Bin.ipynb --convert-to-py
# 2. Lint the new .py file
ruff check docs/Examples/Dynamics/Condensation/Condensation_1_Bin.py --fix
ruff format docs/Examples/Dynamics/Condensation/Condensation_1_Bin.py
# 3. Sync linted .py back to .ipynb
python3 .opencode/tool/validate_notebook.py docs/Examples/Dynamics/Condensation/Condensation_1_Bin.ipynb --sync
# 4. Execute to check for API issues
python3 .opencode/tool/run_notebook.py docs/Examples/Dynamics/Condensation/Condensation_1_Bin.ipynb
# 5. If deprecation warnings or errors found:
# - Edit the .py file to update API calls
# - Re-lint and re-sync
# - Re-execute to verify fix
# 6. Validate sync status
python3 .opencode/tool/validate_notebook.py docs/Examples/Dynamics/Condensation/Condensation_1_Bin.ipynb --check-syncAPI Update Guidelines
When updating outdated API calls:
- Import path changes: Update
from particula.old.path import Xtofrom particula.new.path import X - Function renames: Replace
old_function()withnew_function() - Parameter changes: Update function calls with renamed/new parameters
- Class changes: Update class instantiation if constructors changed
- Return type changes: Adjust any code that depends on return values
Reference current API: Check particula/dynamics/condensation/ source code for current function signatures and import paths.
References
Maintenance Plan:
adw-docs/dev-plans/maintenance/M4-jupytext-full-migration.md- Full migration plan
Related:
- [M4-P8] Jupytext Migration: Dynamics/Coagulation Functional - Sync Existing (4 notebooks) #990 - M4-P8 (dependency)
adw-docs/documentation_guide.md- Notebook editing guidelines