Skip to content

Module C notebooks: plots with errors, saving with DataToExportSaver - #17

Merged
seb5g merged 2 commits into
mainfrom
errors-plots-module-c
Nov 18, 2026
Merged

seb5g merged 2 commits into
mainfrom
errors-plots-module-c

Conversation

@seb5g

@seb5g seb5g commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • notebooks/01_data_objects.ipynb, part 8: plot the cropped line with its errors in the PyMoDAQ viewer (display cell). The qt plotter turns the Errors action of the Viewer1D on when the data has errors: the errors show as a band.
  • notebooks/03_analysis.ipynb, part 6: the averaged scan with error bars (yerr from window.errors) and the weighted fit, with matplotlib. Part 8: the spectrum with Naverage = 200 and its errors in the PyMoDAQ viewer.
  • notebooks/02_saving_loading.ipynb: save with DataToExportSaver(path, new_file=True) used as a context manager (it creates the H5SaverLowLevel itself and closes the file), no more H5SaverLowLevel/init_file/add_det_group/unlink; new part 2 bis: one data alone with DataSaverLoader.
  • Same cells, filled, pushed to correction-module-c.

.plot('matplotlib') is not used: with errors it raises TypeError: can only concatenate tuple (not "list") to tuple in pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py (PLOT_COLORS[ind_data] + [0.3], the colors are tuples), PyMoDAQ 5.3.11.

Checks

  • Every cell of the corrected notebooks, display cells included, runs offscreen (PyQt5, PyMoDAQ 5.3.11).
  • pytest tests/test_notebooks_exercises_module_c.py: 10 passed.

https://claude.ai/code/session_01RKuN833EwRkwYgUKwN8sKq


Generated by Claude Code

Notebook 01: the cropped line with its errors in the PyMoDAQ viewer (the Viewer1D turns
its Errors action on when the data has errors). Notebook 03: the averaged scan with
error bars and the weighted fit (matplotlib errorbar), and the spectrum with Naverage = 200
and its errors in the PyMoDAQ viewer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN833EwRkwYgUKwN8sKq
Both savers take the path of the file and create the H5SaverLowLevel themselves; used as
context managers with new_file=True they overwrite an existing file and close it at the end.
No more H5SaverLowLevel, init_file, add_det_group nor unlink in the notebook; a new part
saves one data alone with DataSaverLoader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN833EwRkwYgUKwN8sKq
@seb5g seb5g changed the title Module C notebooks: plot 1D data with their errors Module C notebooks: plots with errors, saving with DataToExportSaver Nov 18, 2026
@seb5g
seb5g merged commit 2fa8e96 into main Nov 18, 2026
7 checks passed
@seb5g
seb5g deleted the errors-plots-module-c branch November 18, 2026 12:34
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