Skip to content

SpikeGLX: Add one box reading #1719

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

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

Conversation

h-mayorquin
Copy link
Contributor

Should close #1684

Needs the gin test data that is in a PR right now:

https://gin.g-node.org/NeuralEnsemble/ephy_testing_data/pulls/156#

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.

I started reviewing this but I actually need to run. I can check carefully this weekend and merge the gin pr then too.

@zm711 zm711 changed the title Add one box reading SpikeGLX: Add one box reading May 29, 2025
@h-mayorquin h-mayorquin marked this pull request as ready for review June 3, 2025 17:34
@zm711
Copy link
Contributor

zm711 commented Jun 5, 2025

Just to address this do we want to think about this in another PR? I think having stable streams is a better idea (like what we did with Intan). Especially if we can find some stability across the different formats (obx etc).

@h-mayorquin
Copy link
Contributor Author

Yes, we should do in another PR.

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.

few comments

and local_chan == info["num_chan"] - 1
):
# Separate sync channel in its own stream
is_sync_channel = "SY" in chan_name and not self.load_sync_channel
Copy link
Contributor

Choose a reason for hiding this comment

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

This is for backward compatibility (searching for 'SY'?)

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 know better the metadata now and this is an easier criteria to determine if a channel is a synch channel.

stream_id_for_chan,
buffer_id,
)
)

# all channel by default unless load_sync_channel=False
# None here means that the all the channels in the buffer will be included
Copy link
Contributor

Choose a reason for hiding this comment

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

should this comment indicate that this means the ephys + sync since the buffer in this case has the extra channel?

Not required, but I'm just imagining a future dev trying to figure this out.

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 am trying to document what assigning None to self._stream_buffer_slice[stream_id] means here because I think the statement:

self._stream_buffer_slice[stream_id] = None

is very opaque.

I think once we deprecated load_sync_channel this section will be more clear but right now I am struggling to right all the conditions. Feel free to make suggestions.

@@ -404,9 +399,21 @@ def scan_files(dirname):
if len(info_list) == 0:
raise FileNotFoundError(f"No appropriate combination of .meta and .bin files were detected in {dirname}")
Copy link
Contributor

Choose a reason for hiding this comment

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

We should improve this eventually. If I'm a user of neo and I see one bin and one meta file in my folder I would assume it should work. So the word "appropriate" is not actionable in this case. Not for this PR but I don't want us to forget this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, a better error here would be good.

"""
re_standard = re.findall(r"(\S*)_g(\d*)_t(\d*)\.(\S*).(ap|lf)", fname)
re_tcat = re.findall(r"(\S*)_g(\d*)_tcat.(\S*).(ap|lf)", fname)
re_nidq = re.findall(r"(\S*)_g(\d*)_t(\d*)\.(\S*)", fname)
re_obx = re.findall(r"(\S*)_g(\d*)_t(\d*)\.(\S*)\.obx", fname)
Copy link
Contributor

Choose a reason for hiding this comment

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

can a note be added for these regexes? I am never able to read them and so I have to look up each rule each time when I troubleshoot something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me try to improve them. I agree with you that most people are not innate regex readers. I am certainly not.

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 improved the whole function. But maybe this commit should be a PR on it own. Let me know what you think.

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.

For me that's super useful. It is not necessarily within the scope of the PR, but I say we keep it unless @samuelgarcia or @alejoe91 really want it in another PR.

@h-mayorquin
Copy link
Contributor Author

If you want to wait for the others to read it. Let's remove it, and I will make another PR after to make this easier to read

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.

Spikeglx with onebox file format
2 participants