Skip to content

Commit

Permalink
Propagate integrity checks verbose for intan (#887)
Browse files Browse the repository at this point in the history
Co-authored-by: Cody Baker <[email protected]>
  • Loading branch information
h-mayorquin and CodyCBakerPhD authored Jun 10, 2024
1 parent 71f38eb commit 337ce2a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
* Added a function to generate ogen timestamps and data from onset times and parameters to `tools.optogenetics`. [PR #832](https://github.com/catalystneuro/neuroconv/pull/832)
* Added `configure_and_write_nwbfile` and optimized imports in `tools.nwb_helpers` module. [PR #848](https://github.com/catalystneuro/neuroconv/pull/848)
* `configure_backend` may now apply a `BackendConfiguration` to equivalent in-memory `pynwb.NWBFile` objects that have different address in RAM. [PR #848](https://github.com/catalystneuro/neuroconv/pull/848)
* Add support for doubled ragged arrays in `add_units_table`. [PR #879](https://github.com/catalystneuro/neuroconv/pull/879)
* Add support for doubled ragged arrays in `add_electrodes`. [PR #881](https://github.com/catalystneuro/neuroconv/pull/881)
* Add support for doubled ragged arrays in `add_units_table` [PR #879](https://github.com/catalystneuro/neuroconv/pull/879)
* Add support for doubled ragged arrays in `add_electrodes` [PR #881](https://github.com/catalystneuro/neuroconv/pull/881)
* Propagate `ignore_integrity_checks` from neo to IntanRecordingInterface [PR #887](https://github.com/catalystneuro/neuroconv/pull/887)


### Bug fixes
* Remove JSON Schema `definitions` from the `properties` field. [PR #818](https://github.com/catalystneuro/neuroconv/pull/818)
Expand Down
22 changes: 20 additions & 2 deletions src/neuroconv/datainterfaces/ecephys/intan/intandatainterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class IntanRecordingInterface(BaseRecordingExtractorInterface):
display_name = "Intan Recording"
associated_suffixes = (".rhd", ".rhs")
info = "Interface for Intan recording data."
stream_id = "0" # This is the only stream_id of Intan that might have neural data
stream_id = "0" # This are the amplifier channels, corresponding to the stream_name 'RHD2000 amplifier channel'

@classmethod
def get_source_schema(cls) -> dict:
Expand All @@ -59,6 +59,7 @@ def __init__(
stream_id: Optional[str] = None,
verbose: bool = True,
es_key: str = "ElectricalSeries",
ignore_integrity_checks: bool = False,
):
"""
Load and prepare raw data and corresponding metadata from the Intan format (.rhd or .rhs files).
Expand All @@ -72,16 +73,33 @@ def __init__(
verbose : bool, default: True
Verbose
es_key : str, default: "ElectricalSeries"
ignore_integrity_checks, bool, default: False.
If True, data that violates integrity assumptions will be loaded. At the moment the only integrity
check performed is that timestamps are continuous. If False, an error will be raised if the check fails.
"""

neo_version = get_package_version(name="neo")
spikeinterface_version = get_package_version(name="spikeinterface")

init_kwargs = dict(file_path=file_path, stream_id=self.stream_id, verbose=verbose, es_key=es_key)
if neo_version >= Version("0.13.1") and spikeinterface_version >= Version("0.100.6"):
init_kwargs["ignore_integrity_checks"] = ignore_integrity_checks
else:
if ignore_integrity_checks:
warnings.warn(
"The 'ignore_integrity_checks' parameter is not supported for neo versions < 0.13.1. "
"or spikeinterface versions < 0.100.6.",
UserWarning,
)

if stream_id is not None:
warnings.warn(
"Use of the 'stream_id' parameter is deprecated and it will be removed after September 2024.",
DeprecationWarning,
)
self.stream_id = stream_id

super().__init__(file_path=file_path, stream_id=self.stream_id, verbose=verbose, es_key=es_key)
super().__init__(**init_kwargs)
electrodes_metadata = extract_electrode_metadata(recording_extractor=self.recording_extractor)

group_names = electrodes_metadata["group_names"]
Expand Down

0 comments on commit 337ce2a

Please sign in to comment.