🧲 Refactor croco 3#4246
Conversation
2138251 to
ea3d05a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4246 +/- ##
==========================================
- Coverage 50.27% 50.11% -0.16%
==========================================
Files 151 151
Lines 29386 29705 +319
==========================================
+ Hits 14773 14886 +113
- Misses 14613 14819 +206 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fbb281a to
acb93f6
Compare
…Coil to use averaged turn geometry calculations
…removing unnecessary conditionals
…mprove cable geometry plotting
…ed cable and conductor information
…ucture with CroCo cable layout
… in CROCOSuperconductingTFCoil
…ulations and remove unused variable
…riable names and calculations
… parameter and adjusting plot parameters
…nt for improved maintainability
…ry object and update related variables in CROCOSuperconductingTFCoil
…geometry for improved cable geometry calculations
- Updated variable names related to HTS tape and CroCo strand in the input variables, iteration variables, and data structures to use the "tf_" prefix for clarity and consistency. - Adjusted references in the solver, models, and plotting functions to align with the new naming convention. - Ensured backward compatibility by updating obsolete variable mappings. - Modified documentation to reflect changes in variable names and their descriptions.
…ns in CROCOSuperconductingTFCoil
…erties handling in CICCSuperconductingTFCoil
…s and update related calculations in superconductor models
…ns in CROCOSuperconductingTFCoil
…lculations in CROCOSuperconductingTFCoil
…in CROCOSuperconductingTFCoil
… temperature margin calculation in CICCSuperconductingTFCoil
…fo for consistency
…rmal tf variables file
…arity and consistency
…l output method for superconducting TF coils
…ding detailed parameter reporting and improving clarity in output structure.
…ove output clarity for quench information in SuperconductingTFCoil.
…g TF coils, enhancing clarity and consistency in dimension reporting.
- Added section headers and separators in output for better readability. - Consolidated and organized output methods for cable in conduit geometry information. - Improved clarity of output parameters, including units and descriptions. - Removed redundant output lines and ensured consistent formatting across all output sections. - Added detailed reporting for critical current densities and temperature margins.
…clarity and consistency in reporting parameters and geometry.
…onductingTFCoil output methods for improved geometry reporting
…ting copper thickness factor
325c7eb to
3696bed
Compare
|
Bulk of main changes are done. Will get this reviewed and merged in now as it will start to conflict with data class conversion and papercut PR's. Will create breakout issues to iron out the remaining issues |
There was a problem hiding this comment.
Pull request overview
Refactors the superconducting TF coil (CroCo/CICC) output and data flow in process/models/tfcoil/superconducting.py: replaces the multi-tuple return of tf_cable_in_conduit_superconductor_properties with a new TFSuperconductorLimits dataclass, expands SuperconductingTFTurnType with a full_name attribute, splits/extends the output routines, moves e_tf_magnetic_stored_total to tfcoil_variables, and switches CroCo cable geometry consumers to the CroCoCableGeometry dataclass. Tests are updated to consume the new dataclasses and to rename the oacdcp label to j_tf_coil_full_area; the obsolete i_tf_sc_mat parameter is dropped from the averaged turn geometry test cases.
Changes:
- Introduce
TFSuperconductorLimitsdataclass and refactor superconductor property return values; addfull_nametoSuperconductingTFTurnType; restructure output routines (output_general_superconducting_tf_info, etc.). - Update CroCo geometry callers/tests to use the
CroCoCableGeometrydataclass and the new 4-value return signature ofjcrit_rebco. - Adjust imports (add
divertor_variables,numerics,pfcoil_variables,N_CROCO_STRANDS_TURN,CroCoCableGeometry,calculate_croco_cable_geometry; dropglobal_variables) and refresh test expectations/labels.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| process/models/tfcoil/superconducting.py | Major refactor: new dataclass, enum extension, output routine reorganisation, and updated imports/return-value plumbing. |
| tests/unit/models/test_superconductors.py | Update tests to consume CroCoCableGeometry dataclass and new 4-tuple return from jcrit_rebco. |
| tests/unit/models/tfcoil/test_sctfcoil.py | Adapt supercon test to TFSuperconductorLimits; remove obsolete i_tf_sc_mat from averaged-turn test params. |
| tests/unit/models/tfcoil/test_tfcoil.py | Rename oacdcp comment label to j_tf_coil_full_area in expectation tuples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -13,14 +13,22 @@ | |||
| from process.core import process_output as po | |||
| from process.core.exceptions import ProcessValueError | |||
| from process.data_structure import ( | |||
| global_variables, | |||
| divertor_variables, | |||
| @dataclass | ||
| class TFSuperconductorLimits: | ||
| j_tf_wp_critical: float | ||
| j_superconductor_critical: float | ||
| f_c_tf_turn_operating_critical: float | ||
| j_superconductor: float | ||
| j_tf_coil_turn: float | ||
| bc20m: float | ||
| tc0m: float | ||
| c_turn_cables_critical: float |
|
|
||
| """ | ||
| po.oheadr(self.outfile, "General Superconducting TF Coil Parameters ") | ||
| # Turn/WP gemoetry |
This pull request implements a systematic renaming of several REBCO tape and CroCo cable variable names throughout the codebase to clarify their association with the toroidal field (TF) coil and improve code consistency. It also updates documentation and formulas to match these new conventions, and corrects a geometric formula for the CroCo cable. Additionally, units in docstrings are standardized for clarity.
Variable Renaming for Consistency and Clarity
dx_hts_tape_rebco→dx_tf_hts_tape_rebcodx_hts_tape_copper→dx_tf_hts_tape_copperdx_hts_tape_hastelloy→dx_tf_hts_tape_hastelloydx_croco_strand_copper→dx_tf_croco_strand_copperdx_hts_tape_total→dx_tf_hts_tape_totaldr_hts_tape→dr_tf_hts_tapecoppera_m2_max→tf_coppera_m2_maxoacdcp→j_tf_coil_full_areaDocumentation and Formula Corrections
Units and Docstring Standardization
[m2]to[m²]for clarity and consistency.Minor Technical Adjustments
plotting_scripts/2nd_gen_rebco_critical_surface.pyscript is updated to handle additional return values from thejcrit_rebcofunction, ensuring compatibility with its latest signature.These changes collectively improve code clarity, maintainability, and documentation accuracy, especially for users and developers working with TF coil and CroCo cable modeling.## Description
Checklist
I confirm that I have completed the following checks: