Skip to content

feat(rf-commissioning): Add RF commissioning data models and phase tracking#221

Merged
lisazacarias merged 13 commits intoslaclab:mainfrom
lisazacarias:pr1-rf-commissioning-data-models
Apr 17, 2026
Merged

feat(rf-commissioning): Add RF commissioning data models and phase tracking#221
lisazacarias merged 13 commits intoslaclab:mainfrom
lisazacarias:pr1-rf-commissioning-data-models

Conversation

@lisazacarias
Copy link
Copy Markdown
Collaborator

Summary

Adds foundational data models for RF commissioning workflow tracking.

What's Included

  • 7-phase commissioning workflow: PIEZO_PRE_RFCOLD_LANDINGSSA_CHARCAVITY_CHARPIEZO_WITH_RFHIGH_POWERCOMPLETE
  • Phase-specific data models for storing measurements at each step
  • CommissioningRecord with automatic phase ordering validation
  • PhaseCheckpoint for detailed audit trails
  • Comprehensive test coverage (1463 test lines, 100% coverage)

Key Features

  • ✅ Enforced sequential phase execution with can_start_phase() validation
  • ✅ Resume capability via advance_to_next_phase()
  • ✅ Immutable checkpoint history for audit compliance
  • ✅ Type-safe with Python dataclasses

Testing

pytest tests/applications/rf_commissioning/test_data_models.py -v

All 95 tests pass ✓

Dependencies

None - this is the foundation layer

Next Steps

  • Database persistence layer (SQLite)
  • Hardware integration (CommissioningPiezo)
  • Phase execution framework

…acking

- Add CommissioningPhase enum with 7-phase workflow
- Add PhaseStatus enum for tracking phase state
- Add phase-specific data models (PiezoPreRFCheck, ColdLandingData, etc.)
- Add CommissioningRecord with phase ordering validation
- Add PhaseCheckpoint for audit trail
- Include comprehensive test suite (1463 lines of tests)

This is the foundation for the RF commissioning workflow system.
Future PRs will add database persistence, phase execution framework,
and UI components.
Copy link
Copy Markdown

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.

Pull request overview

Adds a new rf_commissioning application foundation layer with dataclass-based RF commissioning workflow models (7 phases) plus a large, dedicated unit test suite to validate phase tracking, checkpointing, and serialization.

Changes:

  • Introduces RF commissioning enums and phase-specific dataclass models with to_dict() serialization.
  • Adds CommissioningRecord for phase progression/status tracking and checkpoint history.
  • Adds comprehensive pytest coverage for the new models.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/sc_linac_physics/applications/rf_commissioning/models/data_models.py New core data model definitions (phases, statuses, per-phase data, checkpoints, record/phase tracking).
src/sc_linac_physics/applications/rf_commissioning/models/__init__.py Exposes model symbols via package exports.
src/sc_linac_physics/applications/rf_commissioning/__init__.py Introduces RF commissioning application package and re-exports core model symbols.
tests/applications/rf_commissioning/test_data_models.py Adds extensive unit tests for enums, models, serialization, and phase ordering/advancement.
tests/applications/rf_commissioning/__init__.py Declares RF commissioning test package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
lisazacarias added a commit to lisazacarias/sc_linac_physics that referenced this pull request Feb 26, 2026
- Add CommissioningDatabase with SQLite backend
- Implement save/load/query methods for CommissioningRecord
- Add support for resume capability (get_active_records)
- Include complete JSON serialization of phase data
- Add database statistics and cleanup methods
- Comprehensive test suite (1188 lines, 100% coverage)

Builds on PR slaclab#221 (data models).
Next: Hardware integration layer.
@lisazacarias lisazacarias requested a review from Copilot February 26, 2026 02:07
Copy link
Copy Markdown

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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread tests/applications/rf_commissioning/test_data_models.py Outdated
@lisazacarias lisazacarias force-pushed the pr1-rf-commissioning-data-models branch from c8e8b39 to 5d38d3b Compare February 26, 2026 02:22
@lisazacarias lisazacarias marked this pull request as ready for review February 26, 2026 02:29
@lisazacarias lisazacarias enabled auto-merge (squash) February 26, 2026 06:16
@lisazacarias lisazacarias requested a review from RDPorter March 2, 2026 21:16
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
Comment thread src/sc_linac_physics/applications/rf_commissioning/models/data_models.py Outdated
@lisazacarias lisazacarias disabled auto-merge March 25, 2026 21:14
… commissioning workflow

- Add CommissioningPhase enum with 8-phase workflow (piezo pre-rf → complete)
- Implement phase-specific data models: PiezoPreRFCheck, ColdLandingData,
  SSACharacterization, PiModeMeasurement, CavityCharacterization,
  PiezoWithRFTest, HighPowerRampData
- Add CommissioningRecord for tracking multi-phase cavity commissioning state
- Implement PhaseCheckpoint for audit trail of commissioning steps
- Create phase registry system for automatic UI/DB schema generation
- Add serialization/deserialization helpers with enum, datetime, and nested
  dataclass support
- Implement phase_display_field decorator for UI metadata binding
- Add comprehensive test coverage for models, registry, and serialization
- Support phase validation, prerequisite checking, and workflow advancement
…arias/sc_linac_physics into pr1-rf-commissioning-data-models
@lisazacarias lisazacarias enabled auto-merge (squash) April 17, 2026 22:52
@lisazacarias lisazacarias merged commit f380f8b into slaclab:main Apr 17, 2026
3 checks passed
@lisazacarias lisazacarias deleted the pr1-rf-commissioning-data-models branch April 17, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants