Skip to content

Commit

Permalink
Merge branch 'main' into set_verbose_to_false
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin authored Dec 13, 2024
2 parents 01652cc + 05423d1 commit a842e78
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Removed use of `jsonschema.RefResolver` as it will be deprecated from the jsonschema library [PR #1133](https://github.com/catalystneuro/neuroconv/pull/1133)
* Completely removed compression settings from most places[PR #1126](https://github.com/catalystneuro/neuroconv/pull/1126)
* Interfaces and converters now have `verbose=False` by default [PR #1153](https://github.com/catalystneuro/neuroconv/pull/1153)
* Completely removed compression settings from most places [PR #1126](https://github.com/catalystneuro/neuroconv/pull/1126)
* Soft deprecation for `file_path` as an argument of `SpikeGLXNIDQInterface` and `SpikeGLXRecordingInterface` [PR #1155](https://github.com/catalystneuro/neuroconv/pull/1155)

## Bug Fixes
* datetime objects now can be validated as conversion options [#1139](https://github.com/catalystneuro/neuroconv/pull/1126)
Expand All @@ -27,6 +29,7 @@
* Use pytest format for dandi tests to avoid window permission error on teardown [PR #1151](https://github.com/catalystneuro/neuroconv/pull/1151)
* Added many docstrings for public functions [PR #1063](https://github.com/catalystneuro/neuroconv/pull/1063)


# v0.6.5 (November 1, 2024)

## Bug Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ were are combining a SpikeGLX recording with Phy sorting results using the
>>> from neuroconv.datainterfaces import SpikeGLXRecordingInterface, PhySortingInterface
>>>
>>> # For this interface we need to pass the location of the ``.bin`` file. Change the file_path to the location in your system
>>> file_path = f"{ECEPHY_DATA_PATH}/spikeglx/Noise4Sam_g0/Noise4Sam_g0_imec0/Noise4Sam_g0_t0.imec0.ap.bin"
>>> interface_spikeglx = SpikeGLXRecordingInterface(file_path=file_path, verbose=False)
>>> folder_path = f"{ECEPHY_DATA_PATH}/spikeglx/Noise4Sam_g0/Noise4Sam_g0_imec0"
>>> interface_spikeglx = SpikeGLXRecordingInterface(folder_path=folder_path, stream_id="imec0.ap", verbose=False)
>>>
>>> folder_path = f"{ECEPHY_DATA_PATH}/phy/phy_example_0" # Change the folder_path to the location of the data in your system
>>> interface_phy = PhySortingInterface(folder_path=folder_path, verbose=False)
Expand Down
7 changes: 4 additions & 3 deletions docs/conversion_examples_gallery/recording/spikeglx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ Defining a 'stream' as a single band on a single NeuroPixels probe, we can conve
>>> from neuroconv.datainterfaces import SpikeGLXRecordingInterface
>>>
>>> # For this interface we need to pass the location of the ``.bin`` file
>>> file_path = f"{ECEPHY_DATA_PATH}/spikeglx/Noise4Sam_g0/Noise4Sam_g0_imec0/Noise4Sam_g0_t0.imec0.ap.bin"
>>> # Change the file_path to the location in your system
>>> interface = SpikeGLXRecordingInterface(file_path=file_path, verbose=False)
>>> folder_path = f"{ECEPHY_DATA_PATH}/spikeglx/Noise4Sam_g0/Noise4Sam_g0_imec0"
>>> # Options for the streams are "imec0.ap", "imec0.lf", "imec1.ap", "imec1.lf", etc.
>>> # Depending on the device and the band of interest, choose the appropriate stream
>>> interface = SpikeGLXRecordingInterface(folder_path=folder_path, stream_id="imec0.ap", verbose=False)
>>>
>>> # Extract what metadata we can from the source files
>>> metadata = interface.get_metadata()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""DataInterfaces for SpikeGLX."""

import warnings
from pathlib import Path
from typing import Optional

Expand Down Expand Up @@ -79,6 +80,15 @@ def __init__(
"SpikeGLXRecordingInterface is not designed to handle nidq files. Use SpikeGLXNIDQInterface instead"
)

if file_path is not None:
warnings.warn(
"file_path is deprecated and will be removed by the end of 2025. "
"The first argument of this interface will be `folder_path` afterwards. "
"Use folder_path and stream_id instead.",
DeprecationWarning,
stacklevel=2,
)

if file_path is not None and stream_id is None:
self.stream_id = fetch_stream_id_for_spikelgx_file(file_path)
self.folder_path = Path(file_path).parent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
self,
file_path: Optional[FilePath] = None,
verbose: bool = False,
load_sync_channel: bool = False,
load_sync_channel: Optional[bool] = None,
es_key: str = "ElectricalSeriesNIDQ",
folder_path: Optional[DirectoryPath] = None,
):
Expand All @@ -56,7 +56,7 @@ def __init__(
es_key : str, default: "ElectricalSeriesNIDQ"
"""

if load_sync_channel:
if load_sync_channel is not None:

warnings.warn(
"The 'load_sync_channel' parameter is deprecated and will be removed in June 2025. "
Expand All @@ -65,6 +65,15 @@ def __init__(
stacklevel=2,
)

if file_path is not None:
warnings.warn(
"file_path is deprecated and will be removed by the end of 2025. "
"The first argument of this interface will be `folder_path` afterwards. "
"Use folder_path and stream_id instead.",
DeprecationWarning,
stacklevel=2,
)

if file_path is None and folder_path is None:
raise ValueError("Either 'file_path' or 'folder_path' must be provided.")

Expand Down

0 comments on commit a842e78

Please sign in to comment.