Skip to content

fix: signed Thresholder.threshold_uV - #86

Merged
namthor9 merged 4 commits into
mainfrom
calvin/signedness-api-issue
Oct 27, 2026
Merged

namthor9 merged 4 commits into
mainfrom
calvin/signedness-api-issue

Conversation

@calvinleng-science

@calvinleng-science calvinleng-science commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Changes Thresholder.threshold_uV from uint32 to int32 so a threshold can describe both positive- and negative-going events: the sign is the crossing direction. Previously only positive thresholds were expressible.

Wire-compatible: uint32 and int32 share the varint encoding, so existing non-negative values are unchanged. Bumps VERSION to 2.6.1.

The sign sets the crossing direction: negative fires below the threshold
(extracellular spikes), positive above it. Wire-compatible with uint32
for existing non-negative values. Bumps VERSION to 2.7.0.
calvinleng-science added a commit that referenced this pull request Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
calvinleng-science added a commit that referenced this pull request Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@calvinleng-science calvinleng-science changed the title feat(spike-detector): signed Thresholder.threshold_uV (sign = direction) feat(spike-detector): signed Thresholder.threshold_uV Oct 27, 2026
@calvinleng-science calvinleng-science changed the title feat(spike-detector): signed Thresholder.threshold_uV fix(spike-detector): signed Thresholder.threshold_uV Oct 27, 2026
@calvinleng-science calvinleng-science changed the title fix(spike-detector): signed Thresholder.threshold_uV fix: signed Thresholder.threshold_uV Oct 27, 2026
@calvinleng-science
calvinleng-science force-pushed the calvin/signedness-api-issue branch from 05f8726 to 0b686d6 Compare October 27, 2026 02:19

@namthor9 namthor9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sensible

@namthor9
namthor9 merged commit 551deca into main Oct 27, 2026
2 checks passed
@namthor9
namthor9 deleted the calvin/signedness-api-issue branch October 27, 2026 18:53
calvinleng-science added a commit to sciencecorp/synapse-python that referenced this pull request Oct 27, 2026
Points the `synapse-api` submodule at 2.6.1 (sciencecorp/synapse-api#86), where `Thresholder.threshold_uV` becomes `int32` so a threshold can describe negative- as well as positive-going events. With the old pin the client rejects a negative threshold before sending (`ValueError: Value out of range`).

- `_api_version.py` → 2.6.1, package → 2.8.5.
- New test: a negative threshold round-trips through `SpikeDetector` and the wire.
- 238/238 tests pass. Verified end to end against a device: a negative threshold fires on negative-going events and stays silent below the signal's trough.
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