4400 remove hardcoded bc20m and tc0m - #4478
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4478 +/- ##
==========================================
+ Coverage 49.32% 49.42% +0.10%
==========================================
Files 150 150
Lines 29802 29884 +82
==========================================
+ Hits 14700 14771 +71
- Misses 15102 15113 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
clmould
left a comment
There was a problem hiding this comment.
Found a few remaining hard-coded values to be updated to use the SuperconductorModel values instead. Also 2 more things:
- There are some hard coded values in documentation/plotting_scripts - could these be updated to use the
SuperconductorModeltoo please?
- Also one instance of
jcrit_rebconeeds the new args adding still in 2nd_gen_rebco_critical_surface.py (can they be done as keyword args please):
32d48ff to
fef6f55
Compare
3df6d11 to
3e90a55
Compare
…e parameters for improved flexibility
…SuperconductorModel
…SuperconductorModel
…field and temperature
… replacing them with dynamic properties from SuperconductorModel
…them with dynamic properties from SuperconductorModel
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
… temperature values for REBCO
… temperature values
…namic values from SuperconductorModel
…rface.py Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
…surface.py Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
…surface.py Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
…surface.py Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
…rModel parameters
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
3e90a55 to
4b59b1e
Compare
…d superconductors
clmould
left a comment
There was a problem hiding this comment.
Some changes to the variable check, but all good otherwise :)
| for field_name in ("bcritsc", "tcritsc"): | ||
| field_definition = tfcoil_fields.get(field_name) | ||
| if field_definition is None: | ||
| continue | ||
|
|
||
| if field_definition.default is not MISSING: | ||
| default_value = field_definition.default | ||
| elif field_definition.default_factory is not MISSING: | ||
| default_value = field_definition.default_factory() | ||
| else: | ||
| continue | ||
| if getattr(data.tfcoil, field_name) != default_value: | ||
| raise ProcessValidationError( | ||
| f"Cannot set {field_name} for non-user-defined superconductors" | ||
| ) |
There was a problem hiding this comment.
| for field_name in ("bcritsc", "tcritsc"): | |
| field_definition = tfcoil_fields.get(field_name) | |
| if field_definition is None: | |
| continue | |
| if field_definition.default is not MISSING: | |
| default_value = field_definition.default | |
| elif field_definition.default_factory is not MISSING: | |
| default_value = field_definition.default_factory() | |
| else: | |
| continue | |
| if getattr(data.tfcoil, field_name) != default_value: | |
| raise ProcessValidationError( | |
| f"Cannot set {field_name} for non-user-defined superconductors" | |
| ) | |
| for field_name in ("bcritsc", "tcritsc"): | |
| field_definition = tfcoil_fields.get(field_name) | |
| if field_definition is not None: | |
| if field_definition.default is not MISSING: | |
| default_value = field_definition.default | |
| if getattr(data.tfcoil, field_name) != default_value: | |
| raise ProcessValidationError( | |
| f"Cannot set {field_name} for non-user-defined superconductors" | |
| ) |
Hopefully formats correctly! Just a shorter way of doing the same thing - the else was never getting hit, so can be removed, and the default_factory was not needed since bcritsc and tcritsc are always floats so the elif would never be hit either

Description
Checklist
I confirm that I have completed the following checks: