8000 Set tf general methods 3 by chris-ashe · Pull Request #3699 · ukaea/PROCESS · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Set tf general methods 3 #3699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2025
Merged

Set tf general methods 3 #3699

merged 4 commits into from
Jul 1, 2025

Conversation

chris-ashe
Copy link
Collaborator
@chris-ashe chris-ashe commented Jun 26, 2025

This pull request refactors the calculation of the self-inductance of toroidal field (TF) coils by introducing a new, unified method tf_coil_self_inductance. The changes streamline the codebase by replacing duplicated logic with a single implementation, improving maintainability and readability. Additionally, corresponding updates have been made to unit tests to ensure correctness and compatibility with the new method.

Refactoring and Code Consolidation:

  • process/tf_coil.py: Added a new method tf_coil_self_inductance to replace the previous tfcind method. The new implementation consolidates the logic for calculating self-inductance, supports multiple TF coil configurations, and improves clarity with detailed parameter descriptions.
  • process/resistive_tf_coil.py, process/superconducting_tf_coil.py, and process/tf_coil.py: Updated the run method in each file to use tf_coil_self_inductance instead of duplicating inductance calculation logic. [1] [2] [3]

Unit Test Updates:

  • tests/unit/test_tfcoil.py: Modified the TfcindParam class to include new parameters required by tf_coil_self_inductance. Added test cases for different TF coil configurations, including D-shaped and picture frame coils. Renamed the test function to test_tf_coil_self_inductance to reflect the new method. [1] [2] [3] [4]## 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 chris-ashe self-assigned this Jun 26, 2025
@chris-ashe chris-ashe added TF Coil Toroidal field coil Refactor labels Jun 26, 2025
@chris-ashe chris-ashe force-pushed the set_tf_general_methods_3 branch 2 times, most recently from 861a2f0 to 8f7c5eb Compare June 26, 2025 08:35
@codecov-commenter
Copy link
codecov-commenter commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 3 lines in your changes missing coverage. Please review.

Project coverage is 37.95%. Comparing base (b51b396) to head (af27810).

Files with missing lines Patch % Lines
process/resistive_tf_coil.py 0.00% 1 Missing ⚠️
process/superconducting_tf_coil.py 0.00% 1 Missing ⚠️
process/tf_coil.py 97.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3699      +/-   ##
==========================================
+ Coverage   37.78%   37.95%   +0.16%     
==========================================
  Files          88       88              
  Lines       22618    22613       -5     
==========================================
+ Hits         8547     8583      +36     
+ Misses      14071    14030      -41     

☔ 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.

@chris-ashe chris-ashe force-pushed the set_tf_general_methods_3 branch from e59a23e to bce7dfe Compare June 26, 2025 15:21
@chris-ashe chris-ashe requested a review from clmould June 26, 2025 15:22
@chris-ashe chris-ashe marked this pull request as ready for review June 26, 2025 15:22
Copy link
Collaborator
@clmould clmould 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! One small thing - found a tfcind still in the tf coil docs, can this be updated please then will approve

@chris-ashe chris-ashe force-pushed the set_tf_general_methods_3 branch from bce7dfe to f964767 Compare June 27, 2025 12:54
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
@clmould clmould merged commit 48e3910 into main Jul 1, 2025
18 checks passed
OceanNuclear pushed a commit that referenced this pull request Jul 12, 2025
* Rename tfcind to tf_coil_self_inductance

* 🔄 Refactor tf_coil_self_inductance calls in ResistiveTFCoil and SuperconductingTFCoil for improved clarity and consistency

* 🔄 Update TfcindParam structure in test_tfcoil.py for improved clarity and consistency

* Update documentation/proc-pages/eng-models/tf-coil.md

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>

---------

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor TF Coil Toroidal field coil
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0