Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9a12df4
📝 Update documentation formatting for solve_coronal_equilibrium funct…
munechika-koyo Mar 31, 2026
3a1f93f
🏷️ Refactor from_value methods to use string annotations for return t…
munechika-koyo Mar 31, 2026
6022e45
📝 Fix raw type cell's metadata
munechika-koyo Apr 1, 2026
114e1c5
🎨 Update visualization output to show percentage of rays passed
munechika-koyo Apr 2, 2026
1e69555
📝 Fix dataset paths in docstrings
munechika-koyo Apr 2, 2026
2a911d0
✨ Add builtin dataset functionality and mock bolometer dataset creation
munechika-koyo Apr 2, 2026
ad03ad5
✨ Add tests for loading and visualizing bolometer data
munechika-koyo Apr 2, 2026
d73ebf1
📝 Add notebook for loading and visualizing bolometer observers
munechika-koyo Apr 2, 2026
404cadb
📝 Add observer gallery section to examples documentation
munechika-koyo Apr 2, 2026
146f2fc
📝 Update import statements and set default renderer for Plotly in bol…
munechika-koyo Apr 2, 2026
8b84005
🎨 Update __all__ export in observer module to include bolometer
munechika-koyo Apr 2, 2026
4238c0c
🖼️ Add bolometer thumbnail for NBSphinx documentation
munechika-koyo Apr 2, 2026
b2cd3c9
📝 Update CHANGELOG for version 0.4.1
munechika-koyo Apr 2, 2026
8e03bdb
🎨 Fix what copilot suggested
munechika-koyo Apr 2, 2026
aa5a78d
➕ Add Plotly to optional test dependencies
munechika-koyo Apr 2, 2026
476d09b
📝 Modify changelog
munechika-koyo Apr 2, 2026
5b9d70c
🎨 Add bolometer_moc to method_files_map
munechika-koyo Apr 2, 2026
70fc172
🐛 Ensure directory exists for bolometer dataset cache
munechika-koyo Apr 2, 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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ 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.4.1] - 2026-04-03

### Added

- Add builtin mock bolometer dataset generator `datasets.bolometer_moc`
- Add bolometer observer notebook (`docs/notebooks/observer/bolometer.ipynb`)
- Add observer tests and fixtures for loading and visualizing bolometer data
- Add `plotly` to test dependencies for bolometer visualization testing

### Changed

- Export builtin dataset helpers from `cherab.imas.datasets`
- Update bolometer visualization output to show ray-through ratio as a percentage
- Refine documentation notebooks and formatting related to plasma and bolometer workflows

### Fixed

- Fix dataset path examples in fetcher docstrings
- Fix notebook raw-cell metadata formatting
- Fix Python 3.10 typing compatibility in bolometer enum `from_value()` methods by replacing `Self`-based annotations, preventing version-specific type errors

## [0.4.0] - 2026-03-31

### Added
Expand Down
7 changes: 2 additions & 5 deletions docs/notebooks/misc/fractional_abundances.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,10 @@
"cell_type": "raw",
"id": "6",
"metadata": {
"raw_mimetype": "text/restructuredtext",
"vscode": {
"languageId": "raw"
}
"raw_mimetype": "text/restructuredtext"
},
"source": [
"The `.solve_coronal_equilibrium` function computes the fractional abundances by setting the total density to one."
"The :obj:`.solve_coronal_equilibrium` function computes the fractional abundances by setting the total density to one."
]
},
{
Expand Down
165 changes: 165 additions & 0 deletions docs/notebooks/observer/bolometer.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# Bolometer\n",
"\n",
"Here we demonstrate how to load bolometer observers from a bolometer IDS, and visualize them to check what they look like.\n",
"The dataset used in this example is a mock bolometer dataset, which consists of different types of bolometer cameras."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [],
"source": [
"from plotly import io\n",
"\n",
"from cherab.imas.datasets import bolometer_moc\n",
"from cherab.imas.observer.bolometer import load_bolometers, visualize\n",
"\n",
"io.renderers.default = \"notebook\""
]
},
{
"cell_type": "markdown",
"id": "2",
"metadata": {},
"source": [
"## Load bolometer dataset\n"
]
},
{
"cell_type": "raw",
"id": "3",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"The list of instances :obj:`~cherab.tools.observers.bolometry.BolometerCamera` are loaded from the ``\"bolometer\"`` IDS."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"metadata": {},
"outputs": [],
"source": [
"path = bolometer_moc()\n",
"bolometers = load_bolometers(path, \"r\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5",
"metadata": {},
"outputs": [],
"source": [
"for bolo in bolometers:\n",
" print(f\"Bolometer: {bolo.name}\")"
]
},
{
"cell_type": "markdown",
"id": "6",
"metadata": {},
"source": [
"## Visualize bolometer observers"
]
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {},
"source": [
"### Pinhole camera"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"metadata": {},
"outputs": [],
"source": [
"fig = visualize(\n",
" bolometers[0],\n",
" num_rays=100,\n",
" ray_terminate_distance=2.0e-2,\n",
" show=False,\n",
")\n",
"fig.update_layout(template=\"plotly_dark\")"
]
},
{
"cell_type": "markdown",
"id": "9",
"metadata": {},
"source": [
"### Collimator cameras"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {},
"outputs": [],
"source": [
"fig = visualize(\n",
" bolometers[1],\n",
" num_rays=100,\n",
" ray_from_channel=[0, 3],\n",
" ray_terminate_distance=2.0e-2,\n",
" show=False,\n",
")\n",
"fig.update_layout(template=\"plotly_dark\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"metadata": {},
"outputs": [],
"source": [
"fig = visualize(\n",
" bolometers[2],\n",
" num_rays=200,\n",
" ray_from_channel=[0, 3],\n",
" ray_terminate_distance=2.0e-2,\n",
" show=False,\n",
")\n",
"fig.update_layout(template=\"plotly_dark\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "docs",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
5 changes: 1 addition & 4 deletions docs/notebooks/plasma/emission.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@
"cell_type": "raw",
"id": "4",
"metadata": {
"mime_type": "text/restructuredtext",
"vscode": {
"languageId": "raw"
}
"raw_mimetype": "text/restructuredtext"
},
"source": [
"When using OpenADAS data first time, the relevant data files must be downloaded and installed.\n",
Expand Down
Binary file added docs/source/_static/images/bolometer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@

# -- NBSphinx configuration ---------------------------------------------------
# nbsphinx_execute = "never"
nbsphinx_thumbnails = {
"notebooks/observer/bolometer": "_static/images/bolometer.png",
}
nbsphinx_prolog = r"""
{% set docname = 'docs/' + env.doc2path(env.docname, base=None)|string %}

Expand Down
11 changes: 11 additions & 0 deletions docs/source/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ Each notebook is designed to showcase specific functionalities and provide pract
notebooks/plasma/*
```

## Observer

```{eval-rst}
.. nbgallery::
:name: observer-gallery
:glob:
:reversed:

notebooks/observer/*
```

## Miscellaneous

```{eval-rst}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
dynamic = ["version"]

[project.optional-dependencies]
test = ["pytest", "pytest-cov", "pooch", "rich"]
test = ["pytest", "pytest-cov", "pooch", "rich", "plotly"]

[project.urls]
Homepage = "https://github.com/cherab"
Expand Down
15 changes: 11 additions & 4 deletions src/cherab/imas/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
r"""Sample Dataset utilities for fetching and processing data.
r"""Sample Dataset utilities.

Usage of Datasets
=================

CHERAB-IMAS dataset methods can be simply called as follows: ``'<dataset-name>()'``
This downloads the dataset files over the network once, and saves the cache,
before returning the path to the downloaded data file.
This downloads/creates the dataset files over the network once, and saves the cache,
before returning the path to the downloaded/created data file.

How dataset retrieval and storage works
=======================================
Expand Down Expand Up @@ -46,7 +46,14 @@
the internet connectivity.
"""

from ._builtin import bolometer_moc
from ._fetchers import iter_jintrac, iter_jorek, iter_solps
from ._utils import clear_cache

__all__ = ["iter_jintrac", "iter_solps", "iter_jorek", "clear_cache"]
__all__ = [
"iter_jintrac",
"iter_solps",
"iter_jorek",
"bolometer_moc",
"clear_cache",
]
Loading
Loading