Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
db9e200
✨ Refactor load_grid function to support entry parameter and improve …
munechika-koyo Aug 3, 2026
81c58b7
🎨 Enhance grid loading and entry reference handling in plasma modules…
munechika-koyo Aug 3, 2026
590569b
✅ Add unit tests for grid loading and entry reference handling in pla…
munechika-koyo Aug 3, 2026
d4f57d2
🔧 Remove unused 'uv' dependency and add task to clean C source files
munechika-koyo Aug 3, 2026
6e0038e
🎨 Add logging for grid source resolution and remove unused lazy loadi…
munechika-koyo Aug 3, 2026
031abf6
📝 Update changelog for version 0.5.1: add IDS path utility helpers, u…
munechika-koyo Aug 3, 2026
1a1c854
➕ Add `rich` as a runtime dependency
munechika-koyo Aug 7, 2026
522c0e7
✨ Implement 2D cell geometry calculation for triangulated polygons
munechika-koyo Aug 10, 2026
562f5cc
🔧 Fix Cython compile and link arguments for macOS support
munechika-koyo Aug 10, 2026
6d2a11c
🎨 Enhance grid handling by adding CellConnectivity, CellData types an…
munechika-koyo Aug 11, 2026
2d81062
✨ Refactor UnstructGrid2D: Enhance valid data handling and integrate …
munechika-koyo Aug 11, 2026
1da7cf6
🎨 Update load_grid function signature to include boolean array in ret…
munechika-koyo Aug 11, 2026
d4c0475
✨ Enhance load_unstruct_grid_2d: Update return type to include validi…
munechika-koyo Aug 11, 2026
4cef96e
🔧 Fix num_cells calculation to correctly reference the first element …
munechika-koyo Aug 11, 2026
1f27c80
🎨 Update _create_rad_func_ggd: Enhance grid subset handling with vali…
munechika-koyo Aug 11, 2026
588e2d0
✨ Enhance species module: Add element styling, improve species type d…
munechika-koyo Aug 11, 2026
7608570
✨ Enhance load_profiles: Add support for MOLECULE and MOLECULAR_BUNDL…
munechika-koyo Aug 11, 2026
be78363
✨ Enhance plasma loading: Refactor grid subset handling and add profi…
munechika-koyo Aug 11, 2026
0e3dc72
✨ Add comprehensive tests for species and core/edge profiles: Impleme…
munechika-koyo Aug 11, 2026
4f88e5a
Edit edge plasma notebook to use ITER-SOLPS sample data
munechika-koyo Aug 11, 2026
dfc8c40
📝 Update changelog
munechika-koyo Aug 11, 2026
43bf231
✨ Add internal helpers for opening IMAS database entries: Implement _…
munechika-koyo Aug 11, 2026
a8417b7
♻️ Refactor database entry handling: Replace DBEntry with `_open_dben…
munechika-koyo Aug 11, 2026
25f5ab6
🔥 Remove "r" mode parameter
munechika-koyo Aug 11, 2026
bab3a7f
🔥 Remove unused phis parameter
munechika-koyo Aug 11, 2026
6ea5cfd
📝 Update changelog including "r" rejection
munechika-koyo Aug 11, 2026
d5547e2
📝 Add radiation 2d notebook
munechika-koyo Aug 11, 2026
3c9d729
🔧 Rearrange typos job in pre-commit hooks after nbstripout
munechika-koyo Aug 11, 2026
4369329
Merge branch 'master' into develop
munechika-koyo Aug 11, 2026
5e86f1f
Configure Dependabot for GitHub Actions
munechika-koyo Aug 11, 2026
caac005
Update GitHub Actions versions
munechika-koyo Aug 11, 2026
3161b0f
🔧 Update setup-uv action to version 9.0.0
munechika-koyo Aug 11, 2026
0f0803c
🔧 Update deploy-pypi workflow and pyproject.toml for macOS OpenMP sup…
munechika-koyo Aug 11, 2026
30ee51e
🔧 Update CIBW_SKIP settings for compatibility with newer CPython vers…
munechika-koyo Aug 11, 2026
939db38
🐛 Add missing marks to parameterized test for memory URI
munechika-koyo Aug 11, 2026
fae8815
🐛 Fix exterior mesh rendering in grid 3D notebook
munechika-koyo Aug 11, 2026
4696b42
🔧 Update changelog date for version 0.6.0
munechika-koyo Aug 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
github-actions:
patterns:
- "*"
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: 🟨 Set up Pixi
uses: prefix-dev/setup-pixi@v0.9.4
uses: prefix-dev/setup-pixi@v0.10.1
with:
environments: lint

Expand All @@ -32,10 +32,10 @@ jobs:

steps:
- name: check out repo
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: 🟨 Set up Pixi
uses: prefix-dev/setup-pixi@v0.9.4
uses: prefix-dev/setup-pixi@v0.10.1
with:
environments: ${{ matrix.environment }}

Expand All @@ -48,6 +48,6 @@ jobs:
run: mv .coverage ".coverage.${{ matrix.environment }}.${{ matrix.os }}.xml"

- name: 📤 Upload coverage to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
41 changes: 28 additions & 13 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ jobs:
steps:
- name: Checkout LLVM on macOS
if: runner.os == 'macOS'
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
repository: llvm/llvm-project
ref: release/19.x
# Keep this pinned to a stable release for reproducible wheels.
ref: llvmorg-22.1.8
path: llvm-project

- name: Build OpenMP on macOS
Expand All @@ -49,21 +50,24 @@ jobs:
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}" \
-DLIBOMP_ENABLE_SHARED=ON \
-DLIBOMP_INSTALL_ALIASES=OFF \
-S openmp \
-B build
cmake --build build --parallel
cmake --install build
echo "REPAIR_LIBRARY_PATH=${PREFIX}/lib" >> "${GITHUB_ENV}"

- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@v9.0.0

# For aarch64 support
# https://cibuildwheel.pypa.io/en/stable/faq/#emulation
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-qemu-action@v4
with:
platforms: all
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
Expand All @@ -76,27 +80,38 @@ jobs:
# These needs to rotate every new Python release.
if: github.event_name == 'pull_request'
run: |
CIBW_SKIP="pp* *-musllinux* cp311-* cp313-* cp314-* cp314t-*"
CIBW_SKIP="pp* *-musllinux* cp311* cp313* cp314* cp315*"
echo "CIBW_SKIP=${CIBW_SKIP}" >> "${GITHUB_ENV}"
echo "Setting CIBW_SKIP=${CIBW_SKIP}"

- name: Build wheels (at Pull Request)
if: github.event_name == 'pull_request'
uses: pypa/cibuildwheel@v3.2.1
uses: pypa/cibuildwheel@v4.2
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos }}
CIBW_SKIP: ${{ env.CIBW_SKIP }}

- name: Build wheels
if: github.event_name != 'pull_request'
uses: pypa/cibuildwheel@v3.2.1
uses: pypa/cibuildwheel@v4.2
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos }}

- name: Verify OpenMP is bundled on macOS
if: runner.os == 'macOS'
shell: bash
run: |
for wheel in wheelhouse/*.whl; do
if ! unzip -l "${wheel}" | grep -Eq 'libomp[^/]*\.dylib$'; then
echo "::error::libomp.dylib is not bundled in ${wheel}"
exit 1
fi
done

- name: Upload wheels
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v7
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
Expand All @@ -105,12 +120,12 @@ jobs:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@v7
with:
name: cibw-sdist
path: dist/*.tar.gz
Expand All @@ -120,7 +135,7 @@ jobs:
name: Show artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v6
- uses: actions/download-artifact@v8
with:
pattern: cibw-*
path: ${{ github.workspace }}/dist
Expand All @@ -144,7 +159,7 @@ jobs:
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download artifacts
uses: actions/download-artifact@v6
uses: actions/download-artifact@v8
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: 🟨 Set up Pixi
uses: prefix-dev/setup-pixi@v0.9.4
uses: prefix-dev/setup-pixi@v0.10.1
with:
environments: docs

- name: 📝 Build docs
run: pixi run -e docs doc-build

- name: 📦 Upload artifact
uses: actions/upload-pages-artifact@v4
uses: actions/upload-pages-artifact@v5
with:
path: docs/build/html

Expand All @@ -45,4 +45,4 @@ jobs:
steps:
- name: 🚀 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: Extract release notes
id: notes
Expand All @@ -37,7 +37,7 @@ jobs:
} >> "$GITHUB_OUTPUT"

- name: Create GitHub release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
Expand Down
8 changes: 4 additions & 4 deletions .lefthook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ pre-commit:
- run: test ${CI:-false} = true
run: pixi {run} pyrefly-check {staged_files}

- name: typos
stage_fixed: true
run: pixi {run} typos {staged_files}

- name: actionlint
glob: ".github/workflows/*.{yaml,yml}"
run: pixi {run} actionlint {staged_files}
Expand Down Expand Up @@ -80,3 +76,7 @@ pre-commit:
only:
- run: test ${CI:-false} = true
run: pixi {run} nbstripout --verify {staged_files}

- name: typos
stage_fixed: true
run: pixi {run} typos {staged_files}
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,57 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.1] - 2026-07-28
## [0.6.0] - 2026-08-12

### Added

- Add synthetic JINTRAC radiation values dataset support and related regression tests
- Extend radiation emitter loading to support dual emissivity sources with improved validation
- Add IDS path utility helpers and `get_entry_reference` for resolving entry references
- Add unit tests for IDS path handling, grid loading via path references, and plasma utility entry-reference workflows
- Add public `CellConnectivity`, `CellData`, and `VertexIndices` types and the `as_cell_data()`
validation helper for GGD meshes
- Add validity-mask support for retaining the relationship between compacted 2D grids and their
source GGD face data
- Add an optimized Cython implementation for calculating polygonal cell areas and area-weighted
centroids, with OpenMP support for large meshes
- Add profile-shape inspection and plain-text/Rich summaries for species compositions
- Add regression tests for 2D grid geometry, subset validity, molecular species, and core/edge
profile loading
- Add a 2D radiation-emitter example notebook

### Changed

- Select read mode automatically when CHERAB object loaders receive an IMAS URI or netCDF path;
explicit `"r"` arguments remain temporarily supported but are deprecated
- Reject data-creating DBEntry modes in CHERAB object loader APIs
- Update API docstrings, examples, demos, and notebooks to use mode-free loader calls
- Improve radiation emitter loading checks for duplicate emissivity values and core-profile grid data
- Refactor `load_grid` to support explicit `entry` selection and improve referenced-grid source resolution
- Enhance plasma and emitter loading paths to use entry-reference aware grid resolution
- **Breaking:** Change `load_grid(..., with_subsets=True)` and
`load_unstruct_grid_2d(..., with_subsets=True)` subset values from index arrays to
`(indices, valid_data_mask)` tuples
- Extend `UnstructGrid2D` with source-data validity tracking so interpolation and plotting accept
either compacted cell data or source-sized data
- Calculate cylindrical 2D cell volumes from area-weighted centroids over a full toroidal rotation
- Filter edge and blended-plasma profile arrays consistently when invalid GGD faces are omitted
- Classify neutral and charged molecular species consistently and retain molecular bundles in core
and edge species compositions
- Promote `rich` from a test-only dependency to a runtime dependency
- Summarize non-empty species groups with compact labels, conventional ionic charge notation, and
stable symbol-derived coloring in plain and `rich` tree output
- Update the edge-plasma example to use the ITER-SOLPS sample dataset

### Fixed

- Fix grid data loading checks for radiation core profiles
- Improve error handling in radiation emitter loading workflows
- Ignore missing, incomplete, and out-of-range GGD faces while preserving correct subset mappings
- Fix triangle indexing, cylindrical cell-volume calculation, and volume preservation in 2D grid
subsets
- Fix the Cython compile and link arguments on macOS
- Preserve neutral and charged molecular species when loading core and edge compositions

## [0.5.0] - 2026-06-24

Expand Down
4 changes: 2 additions & 2 deletions demos/ITER/core_plasma_plot_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def plot_quantity(quantity, extent, title="", logscale=False, symmetric=False) -

# Load and plot equilibrium
path = iter_jintrac()
equilibrium, psi_interpolator = load_equilibrium(path, "r", with_psi_interpolator=True)
equilibrium, psi_interpolator = load_equilibrium(path, with_psi_interpolator=True)
plot_equilibrium(equilibrium)
plt.gcf().savefig(plots_path / "equilibrium.png", dpi=200)

Expand All @@ -95,7 +95,7 @@ def plot_quantity(quantity, extent, title="", logscale=False, symmetric=False) -
fig.savefig(plots_path / "bz.png", dpi=200)

# Load core plasma
plasma = load_core_plasma(path, "r", equilibrium=equilibrium, psi_interpolator=psi_interpolator)
plasma = load_core_plasma(path, equilibrium=equilibrium, psi_interpolator=psi_interpolator)

# Sample and plot electron profiles
ne_plasma = sample3d_grid(plasma.electron_distribution.density, xsamp, [0], zsamp)
Expand Down
20 changes: 15 additions & 5 deletions demos/ITER/edge_plasma_plot_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,22 @@ def plot_quantity(quantity, extent, title="", logscale=False, symmetric=False) -

# Load and plot equilibrium
try:
equilibrium = load_equilibrium(iter_jintrac(), "r")
equilibrium = load_equilibrium(iter_jintrac())
plot_equilibrium(equilibrium)
plt.gcf().savefig(plots_path / "equilibrium.png", dpi=200)
b_field = equilibrium.b_field
except RuntimeError:
try:
b_field = load_magnetic_field(iter_jintrac(), "r")
b_field = load_magnetic_field(iter_jintrac())
except RuntimeError:
b_field = None

# Sample and plot magnetic field
plot_velocity = False
b = None
b_length = None
radial_vector = None
poloidal_vector = None
if b_field is not None:
try:
xsamp, zsamp, b = samplevector2d(b_field, (xl, xu, nx), (zl, zu, nz))
Expand All @@ -116,7 +120,7 @@ def plot_quantity(quantity, extent, title="", logscale=False, symmetric=False) -
)

# Load edge plasma
plasma = load_edge_plasma(iter_jintrac(), "r", b_field=b_field)
plasma = load_edge_plasma(iter_jintrac(), b_field=b_field)

# Sample and plot electron profiles
xsamp, _, zsamp, ne_plasma = sample3d(
Expand All @@ -132,7 +136,7 @@ def plot_quantity(quantity, extent, title="", logscale=False, symmetric=False) -
fig = plot_quantity(te_plasma, extent, title="Te [eV]", logscale=True)
fig.savefig(plots_path / "edge_te.png", dpi=200)

if plot_velocity:
if plot_velocity and b is not None and b_length is not None:
electron_velocity = samplevector3d_grid(
plasma.electron_distribution.bulk_velocity, xsamp, [0], zsamp
).squeeze()
Expand Down Expand Up @@ -174,7 +178,13 @@ def plot_quantity(quantity, extent, title="", logscale=False, symmetric=False) -
dpi=200,
)

if plot_velocity:
if (
plot_velocity
and b is not None
and b_length is not None
and radial_vector is not None
and poloidal_vector is not None
):
velocity = samplevector3d_grid(
species.distribution.bulk_velocity, xsamp, [0], zsamp
).squeeze()
Expand Down
Loading
Loading