Skip to content

Tf superconducting linting refactor - #4660

Open
je-cook wants to merge 4 commits into
ukaea:mainfrom
je-cook:tf_sc_lint
Open

je-cook wants to merge 4 commits into
ukaea:mainfrom
je-cook:tf_sc_lint

Conversation

@je-cook

@je-cook je-cook commented Oct 7, 2026

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.

@je-cook
je-cook requested a review from a team as a code owner October 7, 2026 14:56
@codecov-commenter

codecov-commenter commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.03509% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.41%. Comparing base (9576959) to head (c16527a).

Files with missing lines Patch % Lines
process/models/tfcoil/superconducting.py 48.71% 40 Missing ⚠️
process/models/tfcoil/resistive.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4660      +/-   ##
==========================================
+ Coverage   50.30%   50.41%   +0.10%     
==========================================
  Files         181      181              
  Lines       30660    30698      +38     
==========================================
+ Hits        15424    15476      +52     
+ Misses      15236    15222      -14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -24,6 +24,35 @@
from process.models.tfcoil import quench
from process.models.tfcoil.base import TFCoil, TFPlasmaCaseType


@dataclass
class _TFStressResults:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stresscl is defined in base.py so how come we have defined this here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it was a numba wrapped function. I have done a wrapper, see what you think

a_tf_turn_steel=self.data.tfcoil.a_tf_turn_steel,
a_cs_poloidal=self.data.pf_coil.a_cs_poloidal,
try:
stress = _TFStressResults(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we return a _TFStressResults from the method itself rather than doing this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same reason

@je-cook
je-cook requested a review from timothy-nunn November 6, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants