Skip to content

Add channel attr - #5

Merged
atspaeth merged 5 commits into
mainfrom
add_channel_attr
Dec 15, 2025
Merged

Add channel attr#5
atspaeth merged 5 commits into
mainfrom
add_channel_attr

Conversation

@KamranHussain05

Copy link
Copy Markdown
Contributor

Added a few functions to derive a channel-level raster (instead of neurons x time) and a frame-level raster (instead of ms). This can serve as a nice training mask that is derived from existing data, so it backwards compatible with previous spike data verisons.

Comment thread spikedata/spikedata.py
Comment thread spikedata/spikedata.py Outdated
neuron_raster = self.sparse_raster(bin_size)

# Aggregate by channel
if sparse.issparse(neuron_raster):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Won't it always be sparse since it comes straight from sparse_raster()?

Comment thread spikedata/spikedata.py Outdated
raise ValueError("lowcut must be smaller than highcut")
filter_type = "bandpass"
band = [lowcut, highcut]
Wn = [e / fs * 2 for e in band]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did you need to translate everything back to Python 3.9 syntax?

@atspaeth atspaeth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks really useful and if you want you can merge already, but I do recommend getting rid of the sparse option, or at least simplifying the issparse check logic.

@KamranHussain05

Copy link
Copy Markdown
Contributor Author

Sorry, accidentally closed lol

@KamranHussain05

Copy link
Copy Markdown
Contributor Author

@atspaeth Most recent push addressed your comments and simplifies the sparsity checking code. Lmk wyt! Also CIs are failing suddenly due to Numpy version error, can constrain this to numpy<2.0 or update CIs--likely a diff PR.

@atspaeth

Copy link
Copy Markdown
Member

I think your fixes look good, and the unit tests pass locally.

Don't add that version guard though. The CI issue is something weirder. It's running Python 3.11 instead of the intended version, and it claims to be installing numpy 2.3.5 but then fails to parse 2.4.0rc1 (which is a prerelease ofc and shouldn't be installable without --pre in pip)

@KamranHussain05

Copy link
Copy Markdown
Contributor Author

Good to merge?

@atspaeth

Copy link
Copy Markdown
Member

I'm going to try to fix that CI issue in a separate branch

@atspaeth
atspaeth merged commit ac15df6 into main Dec 15, 2025
0 of 12 checks passed
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