Skip to content

♻️ Refactor some radiation methods for clarity#4219

Open
chris-ashe wants to merge 15 commits into
mainfrom
line_brem_profile_bug
Open

♻️ Refactor some radiation methods for clarity#4219
chris-ashe wants to merge 15 commits into
mainfrom
line_brem_profile_bug

Conversation

@chris-ashe

Copy link
Copy Markdown
Collaborator

Description

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 Radiation Plasma radiated power Bug Something isnt working labels May 5, 2026
@codecov-commenter

codecov-commenter commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.05405% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.86%. Comparing base (d587ca8) to head (3581eea).
⚠️ Report is 40 commits behind head on main.

Files with missing lines Patch % Lines
process/models/physics/impurity_radiation.py 52.94% 16 Missing ⚠️
process/models/physics/physics.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4219      +/-   ##
==========================================
- Coverage   48.86%   48.86%   -0.01%     
==========================================
  Files         151      151              
  Lines       29461    29431      -30     
==========================================
- Hits        14397    14382      -15     
+ Misses      15064    15049      -15     

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

@chris-ashe chris-ashe force-pushed the line_brem_profile_bug branch from 439cbc9 to 4c7c3ce Compare May 28, 2026 14:09
chris-ashe and others added 13 commits June 17, 2026 11:17
…nd improve comments

Co-authored-by: Copilot <copilot@github.com>
…n imprad_profile method

Co-authored-by: Copilot <copilot@github.com>
… accuracy in parameter types and documentation

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…mathematical notation

Co-authored-by: Copilot <copilot@github.com>
…ions

Co-authored-by: Copilot <copilot@github.com>
@chris-ashe chris-ashe force-pushed the line_brem_profile_bug branch from 03ddd71 to e4e975a Compare June 17, 2026 10:17
@chris-ashe chris-ashe changed the title 🐛 Line brem profile bug ♻️ Refactor some radiation methods for clarity Jul 10, 2026
@chris-ashe chris-ashe added Refactor and removed Bug Something isnt working labels Jul 10, 2026
@chris-ashe chris-ashe marked this pull request as ready for review July 10, 2026 13:22
@chris-ashe chris-ashe requested a review from a team as a code owner July 10, 2026 13:22
@chris-ashe chris-ashe requested a review from timothy-nunn July 10, 2026 14:40
@timothy-nunn timothy-nunn self-assigned this Jul 10, 2026

@njit(cache=True)
def _zav_of_te_compiled(
def calculate_average_charge_at_temp_compiled(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def calculate_average_charge_at_temp_compiled(
def _calculate_average_charge_at_temp_compiled(

I would prefer to keep this hidden

Comment on lines +477 to 478
indices = np.digitize(temp_electron_kev, bins)
indices[indices >= bins.shape[0]] = bins.shape[0] - 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

temp_electron_kev is typed as allowed to be a float but this function would fail here because indices will be a np.int64 which you cannot do item assignment to

Comment on lines +517 to +518
nd_electron_profile: np.array | float,
temp_electron_profile_kev: np.array | float,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Again, I don't think these will work as floats because indexing wont work

@chris-ashe chris-ashe requested a review from timothy-nunn July 10, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Radiation Plasma radiated power Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Incorrect calculation of line and Bremsstrahlung plasma radiation components

3 participants