Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] ENH: add new property to access spike times by cell type #916

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jasmainak
Copy link
Collaborator

closes #912

Comment on lines +156 to +161
@property
def cell_types(self):
"""Get unique cell types."""
spike_types_data = np.concatenate(np.array(self.spike_types,
dtype=object))
return np.unique(spike_types_data).tolist()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this would also include spike types that are from bursty drives. Should this filter for only the cell types? Without hardcoding one way to do this is to have a bidirectional relationship between Network and CellResponse. Similar to what matplotlib does with Figure and Axes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I actually want the spike times of the input drives for my work :) They are "artificial cells" ... but yeah not part of the local network. We would need the network object to know which cells are drive cells and which ones belong to the local network. Are you thinking of a net.cell and cell.net attribute? It will create complications for IO, probably more than what I want to bite for this PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, net.cell_reponse is already an attribute. But there's not a way to get information about the parent network at the moment.

This came up in work on the spike raster plot. Currently we hardcode the local cell type names in the plotting function. I was thinking this might not be very flexible if local cell types are ever expanded or names changed.

But now that you mention it... should that plot also include artificial cells and not just the 4 local network? Then I can just grab them all with this property and just call it a day!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think @ntolley may be able to answer better. But I think if you want to preserve the functionality, the cell_types (of the local network) from the default jones model may be declared somewhere as a global variable and imported where needed in the codebase ... acknowledging that it's not the best solution but we also don't want to over-engineer

@gtdang gtdang self-requested a review October 21, 2024 21:47
Copy link
Collaborator

@gtdang gtdang left a comment

Choose a reason for hiding this comment

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

Looks good. Should what's new be updated?

@jasmainak jasmainak changed the title ENH: add new property to access spike times by cell type [MRG] ENH: add new property to access spike times by cell type Oct 23, 2024
@jasmainak
Copy link
Collaborator Author

updated what's new!

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.

extracting spike times by cell type
2 participants