Skip to content

Apply match-case instead of if-elif - #4599

Open
chris-ashe wants to merge 29 commits into
mainfrom
apply_match_case
Open

chris-ashe wants to merge 29 commits into
mainfrom
apply_match_case

Conversation

@chris-ashe

Copy link
Copy Markdown
Member

Description

Since we now require Python >=3.10 we should use match-case statements over if-else because it supports structural pattern matching, avoids repeating the same variable name, and makes complex conditional checks much easier to read

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@codecov-commenter

codecov-commenter commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 35.45535% with 730 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.92%. Comparing base (5d2d7d5) to head (4c03360).

Files with missing lines Patch % Lines
process/models/tfcoil/superconducting.py 34.07% 118 Missing ⚠️
process/models/tfcoil/base.py 25.00% 105 Missing ⚠️
process/models/physics/plasma_geometry.py 1.23% 80 Missing ⚠️
process/models/pfcoil.py 40.74% 64 Missing ⚠️
process/models/physics/confinement_time.py 55.55% 60 Missing ⚠️
process/core/init.py 26.92% 38 Missing ⚠️
process/core/solver/objectives.py 0.00% 37 Missing ⚠️
process/models/physics/current_drive.py 62.19% 31 Missing ⚠️
process/models/blankets/hcpb.py 32.50% 27 Missing ⚠️
process/core/solver/constraints.py 37.50% 25 Missing ⚠️
... and 12 more
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…y in divertor configuration and tokamak aspect ratio logic
@chris-ashe
chris-ashe requested a review from clmould September 16, 2026 09:03
@chris-ashe
chris-ashe marked this pull request as ready for review September 16, 2026 09:04
@chris-ashe
chris-ashe requested a review from a team as a code owner September 16, 2026 09:04
@clmould clmould self-assigned this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants