Skip to content

💄 Fix tf enhanced linting#4232

Open
chris-ashe wants to merge 4 commits intomainfrom
fix_tf_enhanced_linting
Open

💄 Fix tf enhanced linting#4232
chris-ashe wants to merge 4 commits intomainfrom
fix_tf_enhanced_linting

Conversation

@chris-ashe
Copy link
Copy Markdown
Collaborator

Description

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

chris-ashe and others added 4 commits May 7, 2026 13:32
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>
Copilot AI review requested due to automatic review settings May 7, 2026 14:16
@chris-ashe chris-ashe requested a review from a team as a code owner May 7, 2026 14:16
@chris-ashe chris-ashe added TF Coil Toroidal field coil Repository management Related to repository management and metadata Linting labels May 7, 2026
Copy link
Copy Markdown
Contributor

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

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 @staticmethod and 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.

"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Linting Repository management Related to repository management and metadata TF Coil Toroidal field coil

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants