💄 Fix tf enhanced linting#4232
Open
chris-ashe wants to merge 4 commits intomainfrom
Open
Conversation
Co-authored-by: Copilot <copilot@github.com>
…l model Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on bringing the TF coil model modules in process/models/tfcoil/ into compliance with stricter linting by improving docstrings, reflowing long strings/comments, and converting several utility methods to @staticmethod where instance state isn’t used.
Changes:
- Added/standardized module/class/function docstrings and rewrapped long docstring/text lines.
- Converted multiple TF coil helper methods to
@staticmethodand added type annotations in a few enum/method signatures. - Minor formatting cleanups (multi-line f-strings, comment wrapping, removed stale TODO blocks).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
process/models/tfcoil/superconducting.py |
Docstring reformatting, multiple @staticmethod conversions, and small type/doc updates (one critical runtime issue found). |
process/models/tfcoil/resistive.py |
Added module/class/method docstrings, rewrapped long strings, and @staticmethod conversions for helper routines. |
process/models/tfcoil/quench.py |
Added module docstring and reflowed long docstring/comment lines for linting compliance. |
process/models/tfcoil/base.py |
Added module/method docstrings, @staticmethod conversions for pure helpers, and rewrapped long strings/comments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+651
to
655
| # Temperature margin (already calculated in superconductors.bi2212 for | ||
| # i_tf_superconductor=2) | ||
|
|
||
| if i_tf_superconductor in { | ||
| 1, |
Comment on lines
878
to
882
| dx_tf_wp_primary_toroidal: float, | ||
| dr_tf_wp_no_insulation: float, | ||
| r_tf_wp_inboard_centre: float, | ||
| b_tf_inboard_peak_symmetric: float, | ||
| ) -> tuple[float, int]: |
Comment on lines
1026
to
1030
| ------- | ||
| tuple[float, float, float, float, float, float, float, float, float, float] | ||
| Tuple containing: | ||
| - r_tf_wp_inboard_inner (float): WP inboard inner radius [m] | ||
| - r_tf_wp_inboard_outer (float): WP inboard outer radius [m] |
Comment on lines
+1049
to
+1051
| non-positive. | ||
| ProcessValueError | ||
| If i_tf_wp_geom is not a valid SuperconductingTFWPShapeType. |
Comment on lines
+2142
to
+2145
| ValueError | ||
| If an invalid superconductor type is selected. | ||
| ProcessValueError | ||
| If i_tf_superconductor is not a valid SuperconductorModel enum value. |
| @@ -267,7 +276,8 @@ def tf_global_geometry( | |||
| Returns | |||
| ------- | |||
| : | |||
| If i_tf_wp_geom or i_tf_case_geom are not valid SuperconductingTFWPShapeType | ||
| or TFPlasmaCaseType, respectively. | ||
|
|
||
| """ |
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.
Description
Checklist
I confirm that I have completed the following checks: