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

Fix cbin_file_path #3524

Merged
merged 4 commits into from
Nov 19, 2024
Merged

Conversation

alejoe91
Copy link
Member

@alejoe91 alejoe91 commented Nov 7, 2024

Fixes #3523

@alejoe91 alejoe91 added the extractors Related to extractors module label Nov 7, 2024
if cbin_file is None:
if cbin_file is not None:
warnings.warn(
"The `cbin_file` argument is deprecated, please use `cbin_file_path` instead", DeprecationWarning
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did we need a stack level for this? I forget?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch

@@ -119,7 +131,7 @@ def __init__(self, folder_path=None, load_sync_channel=False, stream_name="ap",
self._kwargs = {
"folder_path": str(Path(folder_path).resolve()),
"load_sync_channel": load_sync_channel,
"cbin_file": str(Path(cbin_file).resolve()),
"cbin_file_path": str(Path(cbin_file_path).resolve()),
Copy link
Collaborator

Choose a reason for hiding this comment

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

One more question because I forget the json mechanics. Is this breaking for trying to read the extractor or will this just work?

Copy link
Member Author

Choose a reason for hiding this comment

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

No this is back compatible since we kept both arguments

Copy link
Collaborator

@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 wonder if it would be nice for provenance to explain why this PR worked. The changes here by themselves don't make sense without doing that the tools scan for "path" in the name. I guess in the future people can read my comment and the issue.

But as the user said this fixes it.

Copy link
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

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

LGTM.

I would suggest adding the date on the deprecation warnings so we eventually remove them. and a minor typing thing on the docstring.

src/spikeinterface/extractors/cbin_ibl.py Outdated Show resolved Hide resolved
if cbin_file is None:
if cbin_file is not None:
warnings.warn(
"The `cbin_file` argument is deprecated, please use `cbin_file_path` instead",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe let's say when?

Copy link
Member Author

Choose a reason for hiding this comment

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

unfortunately I think we'll have to keep this forever because of back-compatibility...

@alejoe91 alejoe91 merged commit ad45248 into SpikeInterface:main Nov 19, 2024
14 of 15 checks passed
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.

CompressedBinaryIblExtractor does not save cbin_file relative
3 participants