Add pulse timings dataclass - #4497
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4497 +/- ##
==========================================
- Coverage 49.30% 49.22% -0.08%
==========================================
Files 151 152 +1
Lines 29611 29842 +231
==========================================
+ Hits 14599 14691 +92
- Misses 15012 15151 +139 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…operties for PF coil active phases
…roved timing management
…d timing management
…mproved pulse timing management
…nd integrate point abbreviations for improved clarity in timing management
…ings dataclass for improved clarity in timing representation
chris-ashe
marked this pull request as ready for review
August 4, 2026 12:31
clmould
reviewed
Aug 6, 2026
| return len(self.total_pulse_cumulative) | ||
|
|
||
| @property | ||
| def n_pulse_points_intervals_total(self) -> int: |
Collaborator
There was a problem hiding this comment.
This doesn't seem to be getting used anywhere ?
…naming and enhance validation in PulseTimings dataclass
clmould
requested changes
Aug 10, 2026
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
clmould
requested changes
Aug 11, 2026
clmould
left a comment
Collaborator
There was a problem hiding this comment.
Just 1 small change
Also could you fix the pre-commit failure too please?
… and POINT_ABBREVIATIONS for improved clarity and consistency
clmould
approved these changes
Aug 12, 2026
chris-ashe
added a commit
that referenced
this pull request
Aug 12, 2026
* Add PulseTimings dataclass for managing pulse timing parameters * Enhance PulseTimings class with timing interval properties and refactor PFCoil to utilize it * Refactor PulseTimings class to enhance timing calculations and add properties for PF coil active phases * Refactor PFCoil power model to utilize PulseTimings dataclass for improved timing management * Refactor plot functions to utilize PulseTimings dataclass for improved timing management * Refactor Power model and test to utilize PulseTimings dataclass for improved pulse timing management * Refactor TimesData and PulseTimings classes to remove unused labels and integrate point abbreviations for improved clarity in timing management * Refactor Power model and test to utilize PulseTimings dataclass for timing management * Refactor plot functions to utilize updated point labels from PulseTimings dataclass for improved clarity in timing representation * Remove unused t_pulse_cumulative field from TimesData dataclass for cleaner code * Refactor Power model and tests to standardize PulseTimings parameter naming and enhance validation in PulseTimings dataclass * Enhance PulseTimings dataclass validation and remove unused property for clarity * Update process/models/power.py Co-authored-by: clmould <86794332+clmould@users.noreply.github.com> * Refactor PulseTimings dataclass to standardize naming of POINT_LABELS and POINT_ABBREVIATIONS for improved clarity and consistency --------- Co-authored-by: clmould <86794332+clmould@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.
This pull request refactors how pulse timing and cumulative time points are handled throughout the codebase by introducing and consistently applying the
PulseTimingsclass. This change improves code clarity, reduces duplication, and centralizes pulse timing logic, making it easier to maintain and extend. The update affects plotting routines, model calculations, and output formatting for pulse-related data.Pulse timing refactor and centralization:
Replaced manual cumulative time calculations in plotting functions (e.g.,
plot_current_profiles_over_time,plot_system_power_profiles_over_time,plot_cs_stress_time_profile) with usage of the newPulseTimingsclass, ensuring consistent time axis generation and annotation across all plots.Updated model logic in
physics.pyandpfcoil.pyto usePulseTimingsfor all derived pulse timing values, such as total pulse time, plasma-present time, and no-burn time, removing duplicated cumulative sum logic.Modified power system models (
power.py) to passPulseTimingsas an argument to the PF coil power calculation routines (pfpwr), ensuring all power calculations use unified pulse timing data.Output and labeling improvements:
Standardized the use of pulse time labels and cumulative time points in output routines and plot annotations, using properties from
PulseTimingsfor axis tick labels and time column headers.Cleanup and removal of legacy code:
times_variables.pyand related model files, reducing code redundancy.Checklist
I confirm that I have completed the following checks: