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

Support digital channels on NIDQ interface and use TimeSeries instead of ElecricalSeries for analog channels #1152

Merged
merged 22 commits into from
Dec 11, 2024

Conversation

h-mayorquin
Copy link
Collaborator

This should come after #1150 and has it as a base.

This should close #994 and also should close #923

Base automatically changed from equate_spikeglx_in_spikeinterface to main December 10, 2024 15:39
@h-mayorquin h-mayorquin changed the title Support digital channels on NIDQ interface and use TimeSeries instead of ElecricalSeries as the writing data type Support digital channels on NIDQ interface and use TimeSeries instead of ElecricalSeries for analog channels Dec 10, 2024
@h-mayorquin h-mayorquin marked this pull request as ready for review December 11, 2024 01:06
Comment on lines 61 to 65
warnings.warn(
"The load_sync_channel parameter is deprecated and will be removed in June 2025.",
DeprecationWarning,
stacklevel=2,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the behavior change? What should be done instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The last channel of the ap and lf bands of SpikeGLX binaries are used to store synch data. This command does not make sense with the NIDQ interface because there is no such channel. To be honest, I don't know what role was playing here before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Improved the warning to give more context.

from spikeinterface.extractors import SpikeGLXEventExtractor

self.event_extractor = SpikeGLXEventExtractor(folder_path=self.folder_path)

super().__init__(
verbose=verbose,
load_sync_channel=load_sync_channel,
es_key=es_key,
Copy link
Contributor

Choose a reason for hiding this comment

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

should es_key still be here? "es" stands for ElectricalSeries

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I think you are right.

At the moment, it is not clear how to pass metadata to this object but also there is not clear metadata to be passed. I discussed yesterday with a user that has this type of data about what could be useful for their use case and the only thing that came up is a description of the channels.

I will open another issue to discuss this.

Related, I really like the proposal that you had here:
#629

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I opened an issue here:
#1154

I would like to hear your thoughts on it when you have some time.

Comment on lines 170 to 189
if starting_time is not None:
warnings.warn(
"The 'starting_time' parameter is deprecated and will be removed in June 2025.",
DeprecationWarning,
stacklevel=2,
)

if write_as != "raw":
warnings.warn(
"The 'write_as' parameter is deprecated and will be removed in June 2025.",
DeprecationWarning,
stacklevel=2,
)

if write_electrical_series is not True:
warnings.warn(
"The 'write_electrical_series' parameter is deprecated and will be removed in June 2025.",
DeprecationWarning,
stacklevel=2,
)
Copy link
Contributor

@bendichter bendichter Dec 11, 2024

Choose a reason for hiding this comment

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

For each of these, it would be helpful to provide a bit more explanation about why it is being deprecated, and/or what the new behavior is, and/or what to do to get the same result instead of using this arg

Copy link
Collaborator Author

@h-mayorquin h-mayorquin Dec 11, 2024

Choose a reason for hiding this comment

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

I think you are right that's a good practice.

To add more context, those are conversion options that only made sense for a general electrical series and did not even make sense for the NIDQ interface. For example, the write_as is a general argument to decide whether we add this in acquisition or as a processing module but in this case we are sure NIDQ is acquisition so the choice does not make sense.

In other words, if someone played with those parameters for the nidq interface they were writing wrong data. I don't think that people did but just to be safe I ported the signature as it was so their code will not break immediately.

All of that said, I think that this type of information should be included in the warning. It is useful and it would have avoided this discussion at the review, my bad.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, that makes sense. I just think we need a sentence or two alluding to this for users who are less familiar and may be copying/pasting old code

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I updated all the warning strings to add context and information. Take a look and let me know what you think.

@bendichter
Copy link
Contributor

This looks great! Thanks for putting this together. Just a minor request about the warn messages

Copy link
Contributor

@bendichter bendichter left a comment

Choose a reason for hiding this comment

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

Perfect!

@h-mayorquin h-mayorquin merged commit 5356263 into main Dec 11, 2024
40 checks passed
@h-mayorquin h-mayorquin deleted the improve_nidq_interface branch December 11, 2024 18:44
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 84.21053% with 15 lines in your changes missing coverage. Please review.

Project coverage is 90.76%. Comparing base (96dfdff) to head (7f78db9).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...terfaces/ecephys/spikeglx/spikeglxnidqinterface.py 84.44% 14 Missing ⚠️
...terfaces/ecephys/spikeglx/spikeglxdatainterface.py 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1152      +/-   ##
==========================================
+ Coverage   90.69%   90.76%   +0.06%     
==========================================
  Files         129      129              
  Lines        8189     8281      +92     
==========================================
+ Hits         7427     7516      +89     
- Misses        762      765       +3     
Flag Coverage Δ
unittests 90.76% <84.21%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/neuroconv/tools/testing/mock_interfaces.py 99.16% <100.00%> (+0.02%) ⬆️
...terfaces/ecephys/spikeglx/spikeglxdatainterface.py 95.52% <50.00%> (+0.52%) ⬆️
...terfaces/ecephys/spikeglx/spikeglxnidqinterface.py 86.04% <84.44%> (-12.00%) ⬇️

... and 3 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants