Skip to content

Create bootstrap current class#4091

Open
chris-ashe wants to merge 7 commits intomainfrom
create_bootstrap_current_class
Open

Create bootstrap current class#4091
chris-ashe wants to merge 7 commits intomainfrom
create_bootstrap_current_class

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Feb 10, 2026

This pull request refactors how the plasma bootstrap current calculations are integrated and tested in the codebase. The main improvement is the explicit use and injection of the PlasmaBootstrapCurrent class throughout the main process and test modules, rather than relying on methods attached to the Physics class. This enhances clarity, modularity, and testability of bootstrap current calculations.

Core integration and dependency injection:

  • The PlasmaBootstrapCurrent class is now explicitly instantiated and injected as a dependency into the main process (process/main.py) and the Stellarator model, ensuring that bootstrap current calculations are managed as a separate, dedicated component.

Test suite refactoring:

  • All unit tests for bootstrap current fractions in tests/unit/test_physics.py have been updated to directly instantiate and use PlasmaBootstrapCurrent, removing reliance on the Physics class for these calculations. This clarifies test intent and decouples bootstrap current tests from unrelated physics logic.

Stellarator model and test updates:

  • The Stellarator model and its corresponding test fixture now accept and use the PlasmaBootstrapCurrent class as a parameter, maintaining consistency with the main process and supporting improved modularity in the stellarator workflow.

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.

@chris-ashe chris-ashe added Bootstrap Current Bootstrap current generated by the plasma Refactor labels Feb 10, 2026
@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 68.05556% with 92 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.09%. Comparing base (4741c15) to head (4f9aa32).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
process/models/physics/bootstrap_current.py 68.07% 91 Missing ⚠️
process/main.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4091      +/-   ##
==========================================
+ Coverage   46.88%   47.09%   +0.21%     
==========================================
  Files         136      137       +1     
  Lines       29253    29290      +37     
==========================================
+ Hits        13715    13794      +79     
+ Misses      15538    15496      -42     

☔ View full report in Codecov by Sentry.
📢 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.

@chris-ashe chris-ashe force-pushed the create_bootstrap_current_class branch 2 times, most recently from 8717f2a to e90a20a Compare February 12, 2026 13:48
@chris-ashe chris-ashe force-pushed the create_bootstrap_current_class branch from e90a20a to 30b5ca0 Compare February 26, 2026 08:54
- Modified the Stellarator class to include plasma_bootstrap as a parameter.
- Updated the physics fixture in unit tests to instantiate PlasmaBootstrapCurrent.
- Refactored multiple test cases to utilize PlasmaBootstrapCurrent for bootstrap fraction calculations.
- Ensured all relevant tests in test_physics.py and test_stellarator.py are updated to reflect the new structure.
@chris-ashe chris-ashe force-pushed the create_bootstrap_current_class branch from 30b5ca0 to 7683fcb Compare February 26, 2026 10:18
@chris-ashe chris-ashe marked this pull request as ready for review February 26, 2026 11:46
@chris-ashe chris-ashe requested a review from a team as a code owner February 26, 2026 11:46
@chris-ashe chris-ashe force-pushed the create_bootstrap_current_class branch from 6c9caa6 to 7021d17 Compare February 26, 2026 13:37
@chris-ashe chris-ashe force-pushed the create_bootstrap_current_class branch from 7021d17 to 4f9aa32 Compare February 26, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bootstrap Current Bootstrap current generated by the plasma Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants