Skip to content

Conversation

Copy link

Copilot AI commented Dec 22, 2025

The poly_fit factory function had an incorrect GUFuncWrapper signature "(n),(m)" which was parsed as 2 inputs / 0 outputs instead of 1 input / 1 output. This broke DSP configs using poly_fit with build_dsp().

Changes

  • Fix signature: "(n),(m)""(n)->(m)" to correctly indicate input/output dimensions
  • Fix types: ["ff", "dd"]["ff->f", "dd->d"] to match signature format
  • Add docstrings: YAML configuration examples for poly_fit, poly_diff, poly_exp_rms

Example Configuration

tail_pars:
  function: poly_fit
  module: dspeed.processors
  args:
    - wf_logged[(db.tail.start):(db.tail.stop)]
    - tail_pars(5, 'd')
  init_args:
    - len(wf_logged[(db.tail.start):(db.tail.stop)])
    - '4'
  unit: ADC
  defaults:
    db.tail.start: 2125
    db.tail.stop: 4000
tail_slope: tail_pars[1]
Original prompt

I don't understand how to use poly_fitter anymore. Previosly I would provide build_dsp() with a dsp config file containing the following:

tail_pars:
description: Look at the tail of the waveform. Start once the windowed waveform
ends and go until the end. Get values for where the tail starts and ends from
database (Usually, however that means starting at 85 us and continuing until
160 us).
function: poly_fit
module: dspeed.processors
args:
- wf_logged[(db.waveform_presummed.tail.start):(db.waveform_presummed.tail.stop)]
- tail_pars(5, 'd')
init_args:
- len(wf_logged[(db.waveform_presummed.tail.start):(db.waveform_presummed.tail.stop)])
- '4'
unit: ADC
defaults:
db.waveform_presummed.tail.start: 2125
db.waveform_presummed.tail.stop: 4000
tail_slope: tail_pars[1]
tail_diff, tail_rms:
description: finds residual of quadratic fit of the logged tail
function: poly_exp_rms
module: dspeed.processors
args:
- waveform_presummed[(db.waveform_presummed.tail.start):(db.waveform_presummed.tail.stop)]
- tail_pars
- tail_diff
- tail_rms
unit:
- ADC
- ADC
defaults:
db.waveform_presummed.tail.start: 2125
db.waveform_presummed.tail.stop: 4000

Recently, poly_fitter changed and my config does not work anymore. Can you figure out
a) How to change the config to make build_dsp() work again
b) How poly_fitter works now and provide documentation?

Any questions? Something unclear?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…rocessors

- Change GUFuncWrapper signature from "(n),(m)" to "(n)->(m)" to correctly
  indicate input and output dimensions
- Update types from ["ff", "dd"] to ["ff->f", "dd->d"] for proper type handling
- Add comprehensive docstrings with YAML configuration examples for poly_fit,
  poly_diff, and poly_exp_rms functions
- Add type hints to poly_fit function parameters

Co-authored-by: cVogl97 <[email protected]>
Copilot AI changed the title [WIP] Update usage instructions for poly_fitter Fix poly_fit signature to work with ProcessingChain Dec 22, 2025
Copilot AI requested a review from cVogl97 December 22, 2025 12:47
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