Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3606 +/- ##
==========================================
- Coverage 31.05% 31.01% -0.05%
==========================================
Files 86 87 +1
Lines 20350 20412 +62
==========================================
+ Hits 6319 6330 +11
- Misses 14031 14082 +51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3532617 to
de27ce0
Compare
There was a problem hiding this comment.
Pull Request Overview
- This PR refactors the TF coil structure to improve naming consistency and separate the implementation of superconducting and resistive models.
- Key changes include updating class names and imports in main.py, modifying model invocations in caller.py, and adjusting test documentation accordingly.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/unit/test_vacuum.py | Updated fixture parameter docstring to use standardized "TFCoil" capitalization. |
| process/main.py | Renamed and updated TF coil classes and added the resistive TF coil instantiation. |
| process/caller.py | Modified TF coil model calls to conditionally run the resistive model and update output. |
Comments suppressed due to low confidence (2)
tests/unit/test_vacuum.py:29
- [nitpick] Ensure consistent naming for TF coil objects across the code by using 'TFCoil' uniformly, as reflected in this diff.
:param tfcoil: fixture containing an initialised `TFCoil` object
process/caller.py:267
- Potential double invocation of tfcoil.run() when ft.tfcoil_variables.i_tf_sup equals 1; clarify whether the call with output=False and the subsequent call are both intended.
self.models.tfcoil.run(output=False)
d6c97d3 to
a2d242e
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the TF coil structure by introducing distinct classes for resistive and superconducting configurations, consolidating related methods under the new TFCoil hierarchy.
- Refactored imports and class initializations in process/main.py
- Updated conditional logic for executing resistive and superconducting TF coil models in process/output.py and process/caller.py
- Modified test documentation and plotting utilities to reflect the updated class names
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_vacuum.py | Updated docstring to reflect the new TFCoil class naming |
| process/output.py | Condition now selects the resistive model when appropriate |
| process/main.py | Updated imports and instance creation for the new TF coil classes |
| process/io/plot_proc.py | Changed constant used in plotting to reference superconducting types |
| process/caller.py | Adjusted model calls to conform with the refactored TF coil structure |
Comments suppressed due to low confidence (2)
process/main.py:661
- [nitpick] Consider renaming 'sctfcoil' to 'superconducting_tf_coil' for improved clarity and consistency with the updated class naming.
self.sctfcoil = SuperconductingTFCoil()
process/output.py:68
- The branch for the superconducting TF coil does not call an output or run method. If an output action is expected for superconducting coils similar to the resistive branch, please add the appropriate method call.
if ft.tfcoil_variables.i_tf_sup == 1:
… method to TFCoil class
…or improved structure and functionality
…l class and create new resistive tf coil test file
… and force dynamics
…ant code from SuperconductingTFCoil class
…mline logic and output handling
…endency; update related output and caller logic
a2d242e to
0fcf6dc
Compare
…istency. update references in plot_proc.py
0fcf6dc to
ef57263
Compare
This pull request is focussed around creating new classes for the the different kinds of TF coil configurations and have seperate callable instances of those models.
There is now a
TFCoilclass that holds the generic methods that all types of TF coils. Most of the TF coil calculations were split betweensctfcoil.pyandtfcoil.pywith not much structure or care. With even some resistive calculations being in the superconducting file....A new
resisitive_tf_coil.pyfile exists with a newResisitiveTFCoil(TFCoil)class that inherits fromTFCoilthe same is true forSuperconductingTFCoil(TFCoil).It is hoped for future PR's that the different run methods can be used with
super()and the output seperated from the functions. This will be done in other PR's to prevent this one becoming too large.process/caller.py: Added conditional execution of the resistive toroidal field coil model based oni_tf_supvariable and added a call toportszmethod from thebuildmodel.Class name updates for consistency:
process/main.py: Updated imports to useResistiveTFCoilandSuperconductingTFCoilinstead ofSctfcoilandTFcoil.process/main.py: Updated the__init__method to initializeResistiveTFCoilandSuperconductingTFCoilinstances.tests/unit/test_vacuum.py: Updated the docstring to reflect the new class nameTFCoil.## DescriptionChecklist
I confirm that I have completed the following checks: