Skip to content

Conversation

@h-mayorquin
Copy link
Contributor

@h-mayorquin h-mayorquin commented Mar 20, 2025

Should fix #1661
See discussion here: #1656
Added a test as @zm711 requested.

This is restoring some behavior that we lost after #1608

Plus, reading the metadata history changes here:
https://billkarsh.github.io/SpikeGLX/help/parsing/

Calculating device_index through the original file name is robust up till the phase 3A whereas the current probe_index calculation might fail for some phases. So I think this is a good improvement overall and simplifies the code.

@zm711
Copy link
Contributor

zm711 commented Mar 20, 2025

@guptadivyansh, so this was a loading regression that occurred. So we also want to fix this. Depending on which PR gets merged first you two might end up with some conflicts. So just want you to take a look at the tweak we are making here as well.

@zm711 zm711 requested a review from alejoe91 March 24, 2025 18:06
for info in info_list:
if info.get("device") == "nidq":
info["device_index"] = "" # TODO: Handle multi nidq case, maybe use meta["typeNiEnabled"]
if info.get("device_kind") == "imec":
Copy link
Contributor

Choose a reason for hiding this comment

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

why switch back to imec. Just so I can better understand this for the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just switch the order of the if here and the diff is not working as it should.

But overall, instead of calculating the stream_index by considering all the possible configurations of probe, dock, slot we are just parsing it from the file name that is written on the metadata.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay I'm just showing off my total ignorance of this IO. I see how you flipped it now.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a comment saying the options are nidq or imec above the if-else? In case other devs work on this in the future??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feel free to suggest a line that would make it easier for you as you are in a better position to judge what's helpful.

I will revisit this once we are adding support for one box data:

https://www.neuropixels.org/_files/ugd/328966_9d776efdcff74658a3724690610d4b41.pdf

@zm711
Copy link
Contributor

zm711 commented Mar 25, 2025

@grahamfindlay do you have a moment to test this PR really quick? Since we are just reverting due to lost behavior and we've added a test I feel like we are in a good place, but having an end-user test would be awesome.

@grahamfindlay
Copy link

@zm711 it works for me!

@zm711
Copy link
Contributor

zm711 commented Mar 26, 2025

Great fixing the CI tomorrow-ish and then we can merge after we retest :)

zm711 and others added 3 commits March 26, 2025 09:05
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
Copy link
Contributor

@zm711 zm711 left a comment

Choose a reason for hiding this comment

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

Two separate users confirm this fixes the regression. Merging.

@zm711 zm711 merged commit 48b855f into NeuralEnsemble:master Mar 26, 2025
5 checks passed
@h-mayorquin h-mayorquin deleted the fix_spikeglx branch March 26, 2025 18:34
@zm711 zm711 added this to the 0.14.1 milestone Mar 28, 2025
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