Skip to content

Expand fitted temperature range of impurities - #4521

Open
chris-ashe wants to merge 5 commits into
mainfrom
expand_impurity_data_range
Open

Expand fitted temperature range of impurities#4521
chris-ashe wants to merge 5 commits into
mainfrom
expand_impurity_data_range

Conversation

@chris-ashe

@chris-ashe chris-ashe commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Description

Updates the loss function data for impurities to comprise of 600 elements from 0.25 eV up to 500 keV

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.

… 200 to 600 to accommodate larger datasets. Updated relevant initialisation parameters in `impurity_radiation_variables.py` and `impurity_radiation.py`.
@chris-ashe chris-ashe added the Impurities Plasma impurities label Aug 13, 2026
@chris-ashe chris-ashe changed the title Increase array dimensions for impurity radiation data structures from… Expand fitted temperature range of impurities Aug 13, 2026
…date documentation

- Introduced `impurity_loss_functions.py` to plot Line and Bremsstrahlung loss function profiles.
- Updated the electron density in plasma radiation documentation from \(10^{19} \text{m}^{-3}\) to \(10^{20} \text{m}^{-3}\).
- Increased the source data points from 200 to 600 and adjusted the fitted temperature range.
@chris-ashe
chris-ashe force-pushed the expand_impurity_data_range branch from f233594 to 24adec2 Compare August 13, 2026 14:13
@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.32%. Comparing base (8fe9306) to head (ad4df7b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4521      +/-   ##
==========================================
+ Coverage   49.30%   49.32%   +0.01%     
==========================================
  Files         150      150              
  Lines       29769    29772       +3     
==========================================
+ Hits        14679    14685       +6     
+ Misses      15090    15087       -3     

☔ 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 marked this pull request as ready for review August 13, 2026 14:45
@chris-ashe
chris-ashe requested a review from a team as a code owner August 13, 2026 14:45
@chris-ashe
chris-ashe force-pushed the expand_impurity_data_range branch from 5ffc809 to a91ba5e Compare August 13, 2026 14:50
@@ -54,7 +54,7 @@ class ImpurityRadiationData:
)

n_charge_impurity_profile: list[float] = field(
default_factory=lambda: np.zeros((N_IMPURITIES, 200))
default_factory=lambda: np.zeros((N_IMPURITIES, 600))

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.

Could we make 600 a constant at the top of this file?

Comment thread process/models/physics/impurity_radiation.py
@timothy-nunn timothy-nunn self-assigned this Aug 14, 2026
@timothy-nunn
timothy-nunn requested a review from a team August 14, 2026 07:32
@timothy-nunn

Copy link
Copy Markdown
Collaborator

Requesting modeller review to confirm changes to unit tests and regression tests are acceptable

@mkovari

mkovari commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Requesting modeller review to confirm changes to unit tests and regression tests are acceptable

As long as you can confirm you have checked that Lz and are the close to the old values for the old temperature range I don't there will be a problem.

I find the high value of Lz for Fe below 1 eV surprising, but since we never use temperatures below 1 eV, and we never use Fe, this is hardly an issue.

@timothy-nunn

Copy link
Copy Markdown
Collaborator

@mkovari here is a plot of the old data and new data (only the new data on the old time range). There is very little difference.
adas_radiation

…s function points and update related calculations
Comment thread process/models/physics/impurity_radiation.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Impurities Plasma impurities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants