Skip to content

Bugfix for python v3.10 and add bolometer observer test#29

Merged
munechika-koyo merged 18 commits into
masterfrom
develop
Apr 3, 2026
Merged

Bugfix for python v3.10 and add bolometer observer test#29
munechika-koyo merged 18 commits into
masterfrom
develop

Conversation

@munechika-koyo
Copy link
Copy Markdown
Member

Key changes include:

  • Fix inavailable type setting for python v3.10 (using Self type)

  • Added built-in dataset functionality for bolometer mock data.

  • Updated visualization to display the percentage of rays passed.

  • Refactored documentation for clarity and consistency.

  • Introduced tests for loading and visualizing bolometer data.

@munechika-koyo munechika-koyo self-assigned this Apr 2, 2026
@munechika-koyo munechika-koyo requested a review from Copilot April 2, 2026 21:08
@munechika-koyo munechika-koyo added bug Something isn't working documentation Improvements or additions to documentation labels Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves bolometer observer usability and documentation by introducing a built-in mock bolometer IMAS dataset, adding observer-focused docs/tests, and adjusting visualization output, while also fixing Python 3.10 typing compatibility in bolometer enums.

Changes:

  • Replace Self-based enum return annotations with forward-referenced concrete enum types for Python 3.10 compatibility.
  • Add a built-in mock bolometer dataset generator (datasets.bolometer_moc) and use it in new observer tests and a new documentation notebook.
  • Update bolometer visualization titles to display the ray-through ratio as a percentage; reorganize docs gallery and notebook metadata formatting.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/observer/test_bolometer.py Adds smoke tests for loading and visualizing bolometer observers.
tests/observer/conftest.py Adds a session fixture providing a temp-path bolometer dataset.
src/cherab/imas/observer/bolometer.py Updates visualization title to report ray pass rate as a percentage.
src/cherab/imas/observer/init.py Exposes bolometer module via __all__.
src/cherab/imas/ids/bolometer/utility.py Fixes typing annotations for Python 3.10 compatibility in enum helpers.
src/cherab/imas/datasets/_fetchers.py Refines dataset path examples in docstrings.
src/cherab/imas/datasets/_builtin.py Introduces built-in mock bolometer dataset generation and caching.
src/cherab/imas/datasets/init.py Exports the new built-in dataset helper and updates module docs.
docs/source/examples.md Adds an “Observer” notebook gallery section.
docs/source/conf.py Adds an nbsphinx thumbnail for the bolometer notebook.
docs/notebooks/plasma/emission.ipynb Normalizes raw-cell metadata formatting.
docs/notebooks/observer/bolometer.ipynb Adds a new bolometer observer usage/visualization notebook.
docs/notebooks/misc/fractional_abundances.ipynb Normalizes raw-cell metadata and improves inline reference markup.
CHANGELOG.md Documents additions/changes/fixes for release 0.4.1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cherab/imas/observer/bolometer.py Outdated
Comment thread src/cherab/imas/datasets/_builtin.py
Comment thread src/cherab/imas/datasets/_builtin.py Outdated
Comment thread tests/observer/test_bolometer.py
Comment thread tests/observer/conftest.py Outdated
Comment thread docs/notebooks/observer/bolometer.ipynb Outdated
Comment thread docs/notebooks/observer/bolometer.ipynb Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 95.26627% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.10%. Comparing base (052948f) to head (70fc172).
⚠️ Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
src/cherab/imas/datasets/_builtin.py 96.83% 3 Missing and 2 partials ⚠️
src/cherab/imas/ids/bolometer/utility.py 50.00% 2 Missing ⚠️
src/cherab/imas/observer/bolometer.py 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #29       +/-   ##
===========================================
+ Coverage   50.41%   64.10%   +13.69%     
===========================================
  Files          45       46        +1     
  Lines        2650     2811      +161     
  Branches      453      468       +15     
===========================================
+ Hits         1336     1802      +466     
+ Misses       1137      804      -333     
- Partials      177      205       +28     

☔ View full report in Codecov by Sentry.
📢 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.

@munechika-koyo munechika-koyo merged commit 2c2583a into master Apr 3, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants