Skip to content

Fix spiking functionality and sample period handling - #70

Merged
kjohnsen merged 6 commits into
masterfrom
v0.18.3
Jun 23, 2026
Merged

kjohnsen merged 6 commits into
masterfrom
v0.18.3

Conversation

@kjohnsen

@kjohnsen kjohnsen commented May 26, 2026 •

Copy link
Copy Markdown
Member
  • Identify the exact @copilot review comment in PR Fix spiking functionality and sample period handling #70 and confirm it is actionable
  • Apply only the requested/suggested code change for that single comment
  • Run targeted validation for the touched area
  • Run final PR validation checks
  • Reply on the addressed review comment with the fixing commit hash

@gitnotebooks

gitnotebooks Bot commented May 26, 2026

Copy link
Copy Markdown

Review these changes at https://app.gitnotebooks.com/siplab-gt/cleo/pull/70

Copilot AI 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.

Pull request overview

This PR fixes two issues in Cleo’s electrophysiology signals: (1) spiking signals now behave correctly when a probe records zero neurons, and (2) RWSLFPSignalFromPSCs can correctly receive (or enforce) a sampling period, including via injection kwargs.

Changes:

  • Initialize spiking signal internal state so get_state() works even when no neurons meet recording criteria.
  • Plumb sample_period (and other injection kwargs) through to RWSLFPSignalFromPSCs buffer-length computation and raise a more specific error when missing.
  • Add/extend tests covering the “no neurons recorded” spiking case and the missing/explicit sampling period behavior for PSC-based RWSLFP.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
tests/ephys/test_spiking.py Adds a regression test ensuring spiking signals stay empty/consistent when no neurons are recordable.
tests/ephys/test_lfp.py Updates test helper to pass injection kwargs and adds coverage for missing sample_period error path.
cleo/ephys/spiking.py Ensures spiking signals initialize required internal fields even when zero neurons are recorded; handles None return in SortedSpiking.
cleo/ephys/lfp.py Passes injection kwargs into buffer-length computation and raises RuntimeError when sampling period cannot be determined.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/ephys/test_lfp.py
Comment on lines 369 to 373
Iampa_var_names=["Iampa1"],
Igaba_var_names=["Igaba1"],
name=None,
inject_kwargs={},
):

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.

Fixed in commit 1774111.

Comment thread tests/ephys/test_lfp.py Outdated
Comment thread cleo/ephys/lfp.py Outdated
kjohnsen and others added 3 commits May 26, 2026 16:56
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kjohnsen
kjohnsen merged commit 41cfb17 into master Jun 23, 2026
13 checks passed
@kjohnsen
kjohnsen deleted the v0.18.3 branch June 23, 2026 17:15
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.

3 participants