-
Notifications
You must be signed in to change notification settings - Fork 0
feat(curve, waveform): add dap_parameters for lmfit customization in DAP requests #987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds support for customizing lmfit parameters in DAP (Data Analysis Pipeline) requests, allowing users to override default fitting parameters when creating DAP curves for waveform plots.
Key changes:
- Added
dap_parametersparameter toplot()andadd_dap_curve()methods, accepting dict or lmfit.Parameters - Implemented
_normalize_dap_parameters()method to serialize various parameter formats for the DAP server - Modified
request_dap()to include normalized parameters in DAP request messages - Extended DeviceSignal model to store
dap_parameters
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| bec_widgets/widgets/plots/waveform/waveform.py | Added dap_parameters support throughout the waveform plotting API, including parameter normalization logic and updated DAP request handling. Includes demo examples showing different parameter input formats. |
| bec_widgets/widgets/plots/waveform/curve.py | Extended DeviceSignal model with optional dap_parameters field to store serialized parameters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c3c2440 to
6713321
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
6713321 to
e2262dd
Compare
e2262dd to
a17e8d2
Compare
Description
Extend the Waveform widget DAP integration to allow passing lmfit parameter overrides/fixed values from the GUI/API into the backend fit service.
Waveform.plot()andWaveform.add_dap_curve()now acceptdap_parameters(dict orlmfit.Parameters) which are serialized into the DAP request and applied server-side for any lmfit model (includingSineModel). The server now merges partial overrides withmodel.make_params()so users can provide only a subset of parameters without triggering “Missing parameters” errors. Added server-side logging to make configuration and fit failures easier to debug, and expanded the Waveform demo launch script with examples of all supported parameter formats.Has to be reviewed together with bec-project/bec#707
Type of Change
dap_parameterspassthrough and storage on DAP curves (Waveform.plot/add_dap_curve→ DAPrequest).
defaults, filter unknown names) and improve fit/config logging.
How to test
bec_widgets/bec_widgets/widgets/plots/waveform/waveform.py) and verify:{"amplitude": 1.0}), lmfit-style dict, andlmfit.Parameters.