Skip to content

Calculate CS area variables before they are used - #4652

Merged
je-cook merged 3 commits into
mainfrom
4635-bug-zerodivisionerror-in-stresscl-with-i_tf_bucking-in-2-3
Oct 13, 2026
Merged

je-cook merged 3 commits into
mainfrom
4635-bug-zerodivisionerror-in-stresscl-with-i_tf_bucking-in-2-3

Conversation

@timothy-nunn

Copy link
Copy Markdown
Collaborator

Calculates the CS area variables at the end of the Build model. This is the point where all of their dependencies have been calculated but they have not yet been used.

I have checked and the error no longer occurs and #4617 does not flag any variable calculate_cs_area as being edited after being used.

@timothy-nunn timothy-nunn linked an issue Oct 5, 2026 that may be closed by this pull request
@codecov-commenter

codecov-commenter commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.04%. Comparing base (8ed36d2) to head (789e0b8).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
process/models/build.py 11.11% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4652      +/-   ##
==========================================
- Coverage   49.97%   46.04%   -3.94%     
==========================================
  Files         151      151              
  Lines       30270    35693    +5423     
==========================================
+ Hits        15128    16434    +1306     
- Misses      15142    19259    +4117     

☔ 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.

@timothy-nunn
timothy-nunn marked this pull request as ready for review October 5, 2026 12:31
@timothy-nunn
timothy-nunn requested a review from a team as a code owner October 5, 2026 12:31

@chris-ashe chris-ashe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anyway to do this without ripping up the CS methods and putting them into build.py?

@timothy-nunn

Copy link
Copy Markdown
Collaborator Author

@chris-ashe I do not think so. I think other parts of that CS geometry calculation need variables that are calculated in the PF/CS model. To keep the geometry calculations all together could mean a large restructuring that is probably not worth it.

@chris-ashe chris-ashe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still some calcs in the pfcoil file that are also now in the build file, is this intentional?

@timothy-nunn

Copy link
Copy Markdown
Collaborator Author

There is still some calcs in the pfcoil file that are also now in the build file, is this intentional?

@chris-ashe I don't think so, can you point out which variables for me?

@chris-ashe

chris-ashe commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

There is still some calcs in the pfcoil file that are also now in the build file, is this intentional?

@chris-ashe I don't think so, can you point out which variables for me?

I can still see r_cs_coil_outer and r_cs_coil_inner in cs_coil.calculate_cs_geometry() but they are also calculated in calculate_cs_area()

@timothy-nunn

Copy link
Copy Markdown
Collaborator Author

@chris-ashe I've had a look and because of the weird ordering of operations with the CS geometry I cannot cleanly have these calculations only occur in one place. It would need to occur during a much larger restructuring of the PF and CS coils.

@timothy-nunn

Copy link
Copy Markdown
Collaborator Author

@chris-ashe given this are you happy to approve this so a maintainer can check and hopefully get this bug fixed

@je-cook je-cook closed this Oct 13, 2026
@je-cook je-cook reopened this Oct 13, 2026
@je-cook
je-cook enabled auto-merge (squash) October 13, 2026 08:14
@je-cook
je-cook merged commit 1e75954 into main Oct 13, 2026
19 of 22 checks passed
@je-cook
je-cook deleted the 4635-bug-zerodivisionerror-in-stresscl-with-i_tf_bucking-in-2-3 branch October 13, 2026 08:46
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.

🐛 ZeroDivisionError in stresscl with i_tf_bucking in {2, 3}

4 participants