Apply match-case instead of if-elif - #4599
Open
chris-ashe wants to merge 29 commits into
Open
chris-ashe wants to merge 29 commits into
chris-ashe wants to merge 29 commits into
Conversation
… improve error handling for illegal model types
…mproved readability and maintainability
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4599 +/- ##
==========================================
- Coverage 49.99% 49.92% -0.07%
==========================================
Files 151 151
Lines 29916 30036 +120
==========================================
+ Hits 14956 14996 +40
- Misses 14960 15040 +80 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…s.py, pfcoil.py, and superconducting.py
…d TF conductor model
…constraints.py, hcpb.py, confinement_time.py, profiles.py, power.py, and base.py
…lity in superconductor model logic and process checks
…y in divertor configuration and tokamak aspect ratio logic
chris-ashe
force-pushed
the
apply_match_case
branch
from
September 16, 2026 09:03
7558d0c to
4c03360
Compare
chris-ashe
marked this pull request as ready for review
September 16, 2026 09:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Since we now require Python
>=3.10we should usematch-casestatements overif-elsebecause it supports structural pattern matching, avoids repeating the same variable name, and makes complex conditional checks much easier to readChecklist
I confirm that I have completed the following checks: