Adds PDF report for Size Distribution#3965
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds report generation support for the Size Distribution perspective by leveraging the existing ReportBase HTML/PDF reporting pipeline, while also refactoring common report utilities for reuse across perspectives.
Changes:
- Added
getReport()(andsupports_reports) to the Size Distribution perspective, including embedding currently-shown plots into the report. - Factored out parameter key/value formatting into a shared
format_report_parameters()helper and reused it from Corfunc. - Centralized “collect live plot figures by dataset id” logic into
PlotHelper.figures_for_plot_ids()and reused it in the Fitting report flow.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/sas/qtgui/Utilities/Reports/reports.py |
Adds reusable report-parameter formatting helper. |
src/sas/qtgui/Utilities/Reports/__init__.py |
Re-exports the new formatting helper from the Reports package. |
src/sas/qtgui/Plotting/PlotHelper.py |
Adds helper to fetch active Matplotlib figures by plot/data ids. |
src/sas/qtgui/Perspectives/SizeDistribution/SizeDistributionPerspective.py |
Implements report generation + plot image collection for Size Distribution. |
src/sas/qtgui/Perspectives/Fitting/ReportPageLogic.py |
Refactors image collection to use the new PlotHelper utility. |
src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py |
Switches to shared parameter formatting helper for reports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
butlerpd
left a comment
There was a problem hiding this comment.
The refactoring looks reasonable from a high lever perspective. I did not dig to deeply into the detail.
The functionality however works fine for corfunc (which was part of the refactor) as well as the newly added reporting capability for the size distribution. I would say this can be merged unless somebody wants to look more carefully at the code details.
Description
This PR adds PDF reports for the Size distribution perspective.
This also factors out parameter formatting from Corfunc, and getting plot images from Fitting perspectives to be used here.
Fixes #3258
How Has This Been Tested?
Manually ran and created reports.
Review Checklist:
Documentation
Installers
Licensing