Bugfix for python v3.10 and add bolometer observer test#29
Conversation
There was a problem hiding this comment.
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.
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
Key changes include:
Fix inavailable type setting for python v3.10 (using
Selftype)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.