Skip to content

"quality" property to be read as string instead of object in BasePhyKilosortSortingExtractor#3365

Merged
alejoe91 merged 1 commit intoSpikeInterface:mainfrom
h-mayorquin:read_quality_in_phy_as_string
Sep 5, 2024
Merged

"quality" property to be read as string instead of object in BasePhyKilosortSortingExtractor#3365
alejoe91 merged 1 commit intoSpikeInterface:mainfrom
h-mayorquin:read_quality_in_phy_as_string

Conversation

@h-mayorquin
Copy link
Copy Markdown
Collaborator

At the moment, this specific column which we know is a string is unnecessarily read as an object.

This is a simple patch so this property is converted as a string.

Another possible more general solution is to use this function from pandas after reading the cluster info data frames and merging

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.convert_dtypes.html

I think this could simplify the logic here where we do the casting:

https://github.com/h-mayorquin/spikeinterface/blob/5953d6cdaac993928988a715725b824edf11d00a/src/spikeinterface/extractors/phykilosortextractors.py#L167-L183

@pauladkisson

@h-mayorquin h-mayorquin requested a review from zm711 September 5, 2024 00:31
@h-mayorquin h-mayorquin self-assigned this Sep 5, 2024
@alejoe91 alejoe91 added the extractors Related to extractors module label Sep 5, 2024
@alejoe91
Copy link
Copy Markdown
Member

alejoe91 commented Sep 5, 2024

Thanks @h-mayorquin

Let's merge this for now, but I like the convert_dtypes approach as a more general solution :)

@alejoe91 alejoe91 added this to the 0.101.1 milestone Sep 5, 2024
@alejoe91 alejoe91 merged commit 0e36a3a into SpikeInterface:main Sep 5, 2024
@h-mayorquin h-mayorquin deleted the read_quality_in_phy_as_string branch September 5, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extractors Related to extractors module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants