Make sure default automerge params reflect their type#4483
Make sure default automerge params reflect their type#4483chrishalcrow wants to merge 1 commit intoSpikeInterface:mainfrom
Conversation
|
Would it be worth adding type hints somewhere around here. Otherwise I think it would be too easy for these things to get out of sync in the future, no? |
Yeah it's a good point. It's a bit awkward: some of these are type-hinted in their function signatures but the values are given here. This is fine internally: it's only a problem when used externally by e.g. si-gui. It's not easy to test because the function signatures are scattered all over the place, and only covers some parameters e.g. so isn't typed anywhere... EDIT: one option is to wait until 3.11 (~ a year's time) and then implement TypedDicts everywhere we use parameters... |
In spikeinterface-gui, the parameter type of each autmerge algorithm is computed by computing the type of the default.
Before this PR there were some mismatches between the type (e.g.
min_snris a float param) and the type of the default value (min_snrhas default value 2). This means the user cannot changemin_snrto float values in the GUI. This PR ensures all default param values have the type intended by their param.