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 #908 #998

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Bug fixes
* Fixed the default naming of multiple electrical series in the `SpikeGLXConverterPipe`. [PR #957](https://github.com/catalystneuro/neuroconv/pull/957)
* Write new properties to the electrode table use the global identifier channel_name, group [PR #984](https://github.com/catalystneuro/neuroconv/pull/984)
* Fixed a check in `_configure_backend` on neurodata_object ndx_events.Events to work only when ndx-events==0.2.0 is used. [PR #998](https://github.com/catalystneuro/neuroconv/pull/998)

### Improvements
* The `OpenEphysBinaryRecordingInterface` now uses `lxml` for extracting the session start time from the settings.xml file and does not depend on `pyopenephys` anymore. [PR #971](https://github.com/catalystneuro/neuroconv/pull/971)
Expand Down
18 changes: 10 additions & 8 deletions src/neuroconv/tools/nwb_helpers/_configure_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
from typing import Union

from hdmf.common import Data
from packaging import version
from pynwb import NWBFile, TimeSeries

from ._configuration_models._hdf5_backend import HDF5BackendConfiguration
from ._configuration_models._zarr_backend import ZarrBackendConfiguration
from ..importing import is_package_installed
from ..importing import get_package_version, is_package_installed


def configure_backend(
Expand Down Expand Up @@ -53,13 +54,14 @@ def configure_backend(
dataset_name=dataset_name, data_io_class=data_io_class, data_io_kwargs=data_io_kwargs
)
# Special ndx-events v0.2.0 types
elif is_ndx_events_installed and isinstance(neurodata_object, ndx_events.Events):
neurodata_object.set_data_io(
dataset_name=dataset_name, data_io_class=data_io_class, data_io_kwargs=data_io_kwargs
)
# But temporarily skipping LabeledEvents
elif is_ndx_events_installed and isinstance(neurodata_object, ndx_events.LabeledEvents):
continue
elif is_ndx_events_installed and (get_package_version("ndx-events") == version.parse("0.2.0")):
# Temporarily skipping LabeledEvents
if isinstance(neurodata_object, ndx_events.LabeledEvents):
continue
elif isinstance(neurodata_object, ndx_events.Events):
neurodata_object.set_data_io(
dataset_name=dataset_name, data_io_class=data_io_class, data_io_kwargs=data_io_kwargs
)
# Skip the setting of a DataIO when target dataset is a link (assume it will be found in parent)
elif isinstance(neurodata_object, TimeSeries) and is_dataset_linked:
continue
Expand Down
Loading