feat(curve, waveform): add dap_parameters for lmfit customization in DAP requests#987
Open
wyzula-jan wants to merge 2 commits intopre_release_v3from
Open
feat(curve, waveform): add dap_parameters for lmfit customization in DAP requests#987wyzula-jan wants to merge 2 commits intopre_release_v3from
wyzula-jan wants to merge 2 commits intopre_release_v3from
Conversation
Contributor
There was a problem hiding this comment.
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! |
e2262dd to
a17e8d2
Compare
a17e8d2 to
25ff1f5
Compare
f5adf59 to
76053c3
Compare
76053c3 to
130d17e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.