Skip to content

Improve interface to radas data#126

Merged
tbody-cfs merged 14 commits intomainfrom
update_radas
Jun 17, 2025
Merged

Improve interface to radas data#126
tbody-cfs merged 14 commits intomainfrom
update_radas

Conversation

@tbody-cfs
Copy link
Collaborator

@tbody-cfs tbody-cfs commented Jun 16, 2025

Updates atomic data handling to work with https://github.com/cfs-energy/radas/tree/v2025.6.1.

Main fix

By default, radas@v2025.6.1 computes only a single ne_tau value. This breaks a line of logic in the AtomicData class. Although this can be fixed with a small patch, I decided it was worth refactoring some of the code to use a neater CoeffInterpolator extending RectBivariateSpline to handle the log-space interpolation.

Related fixes

  • radas_config.yaml added to cfspopcon to make it clearer how radas is being configured.
  • calc_impurity_charge_state and calc_impurity_radiated_power_radas simplified and made unit-aware, using the .groupby(dimension).map(function) xarray functionality.
  • The latest version of radas updates several packages, which led to a number of mypy changes.
  • Changed ne_tau for the SPARC PRD to 0.5 * ms * n20 from 1 * ms * n20, matching the value evaluated by radas
  • Updates test_atomic_data for new implementation

Drive-by fixes

  • poetry was updated to version 2.1.3 (locally and in Github actions)
  • get_item and get_values helper methods used to replace common patterns
  • type hints for evaluate_density_and_temperature_profile_fits simplified
  • Fixed an error where wraps_ufunc error handling would fail if function is unnamed.
  • Updates setuptools (closes build(deps-dev): bump setuptools from 71.1.0 to 78.1.1 #124)

@tbody-cfs tbody-cfs requested a review from MishaVeldhoen June 16, 2025 21:04
@tbody-cfs tbody-cfs changed the title Update radas Improve interface to radas data Jun 17, 2025
tbody-cfs and others added 2 commits June 17, 2025 14:32
Co-authored-by: Misha Veldhoen <misha.veldhoen@gmail.com>
Co-authored-by: Misha Veldhoen <misha.veldhoen@gmail.com>
Copy link
Collaborator

@MishaVeldhoen MishaVeldhoen left a comment

Choose a reason for hiding this comment

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

Looks good! Left a couple of small comments, mostly nit.

@tbody-cfs tbody-cfs merged commit 57baea2 into main Jun 17, 2025
6 checks passed
@tbody-cfs tbody-cfs deleted the update_radas branch June 17, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants