Skip to content

Remove unnecessary radius calculation in TFCoil class#4090

Merged
timothy-nunn merged 2 commits intomainfrom
1116-inconsistency-between-the-tf-coil-radial-build-in-machine_buildf90-and-sctfcoilf90
Feb 27, 2026
Merged

Remove unnecessary radius calculation in TFCoil class#4090
timothy-nunn merged 2 commits intomainfrom
1116-inconsistency-between-the-tf-coil-radial-build-in-machine_buildf90-and-sctfcoilf90

Conversation

@chris-ashe
Copy link
Collaborator

Description

This is a legacy issue and should be solved by #3748 . There was error checking in the output (should not be there...) that was missed in #3748 and so the $\cos\left(\frac{\pi}{N_{TF}}\right)$ has now been removed

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 chris-ashe self-assigned this Feb 10, 2026
@chris-ashe chris-ashe requested a review from a team as a code owner February 10, 2026 10:30
@chris-ashe chris-ashe added TF Coil Toroidal field coil Bug Something isnt working labels Feb 10, 2026
@timothy-nunn timothy-nunn requested a review from mkovari February 10, 2026 10:35
@timothy-nunn
Copy link
Collaborator

@mkovari you asked on the issue to be listed as a reviewer

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.19%. Comparing base (6d036d5) to head (5ebede1).

Files with missing lines Patch % Lines
process/models/tfcoil/base.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4090   +/-   ##
=======================================
  Coverage   47.18%   47.19%           
=======================================
  Files         138      138           
  Lines       29280    29275    -5     
=======================================
  Hits        13817    13817           
+ Misses      15463    15458    -5     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

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

As part of the PR can you also remove the outputting into the OUT.DAT.

If the dimensions are inconsistent, it should be done with logger.error not commenting/outputs to the MFile and OUTFile. No need to do anything if they are consistent.

@timothy-nunn timothy-nunn requested a review from ym1906 February 26, 2026 16:59
Copy link
Collaborator

@ym1906 ym1906 left a comment

Choose a reason for hiding this comment

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

This is unnecessary and can be removed. As @timothy-nunn pointed out, the output has to be removed too.

@timothy-nunn timothy-nunn force-pushed the 1116-inconsistency-between-the-tf-coil-radial-build-in-machine_buildf90-and-sctfcoilf90 branch from 08efbb3 to 5ebede1 Compare February 27, 2026 13:07
@timothy-nunn timothy-nunn requested a review from ym1906 February 27, 2026 13:07
@timothy-nunn
Copy link
Collaborator

Thanks @ym1906 for the review. I've removed the warning from the output and put it in the logger. Can you confirm that you're happy with this solution and, if so, approve it for me.

Cheers,
Tim

Copy link
Collaborator

@ym1906 ym1906 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@timothy-nunn timothy-nunn merged commit 6cb4d6d into main Feb 27, 2026
8 of 10 checks passed
@timothy-nunn timothy-nunn deleted the 1116-inconsistency-between-the-tf-coil-radial-build-in-machine_buildf90-and-sctfcoilf90 branch February 27, 2026 14:57
@mkovari
Copy link
Collaborator

mkovari commented Feb 27, 2026

And are the dimensions consistent?
@timothy-nunn

@timothy-nunn
Copy link
Collaborator

And are the dimensions consistent? @timothy-nunn

@mkovari removing this calculation stops the warning message from being displayed, so yes we believe they are consistent.

@mkovari
Copy link
Collaborator

mkovari commented Feb 27, 2026

Are you saying that having removed the error checking you now don't see the error message?
Or are you saying that there was an error in the mathematics which has now been corrected?

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

Labels

Bug Something isnt working TF Coil Toroidal field coil

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistency between the TF coil radial build in machine_build.f90 and sctfcoilf90

5 participants