-
Notifications
You must be signed in to change notification settings - Fork 13
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
Set tf general methods 3 #3699
Conversation
861a2f0
to
8f7c5eb
Compare
Codecov ReportAttention: Patch coverage is
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. 🚀 New features to boost your workflow:
|
…conductingTFCoil for improved clarity and consistency
e59a23e
to
bce7dfe
Compare
There was a problem hiding this 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
bce7dfe
to
f964767
Compare
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
* 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>
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 methodtf_coil_self_inductance
to replace the previoustfcind
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
, andprocess/tf_coil.py
: Updated therun
method in each file to usetf_coil_self_inductance
instead of duplicating inductance calculation logic. [1] [2] [3]Unit Test Updates:
tests/unit/test_tfcoil.py
: Modified theTfcindParam
class to include new parameters required bytf_coil_self_inductance
. Added test cases for different TF coil configurations, including D-shaped and picture frame coils. Renamed the test function totest_tf_coil_self_inductance
to reflect the new method. [1] [2] [3] [4]## DescriptionChecklist
I confirm that I have completed the following checks: