Skip to content

Commit

Permalink
Merge pull request #2635 from h-mayorquin/use_normal_typing_in_nwb
Browse files Browse the repository at this point in the history
Remove lazy typing in nwb
  • Loading branch information
alejoe91 authored Mar 27, 2024
2 parents 2b80f16 + 50992ba commit 3aa0ab6
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/spikeinterface/extractors/nwbextractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
from spikeinterface.core.core_tools import define_function_from_class


def import_lazily():
"Makes annotations / typing available lazily"
global NWBFile, ElectricalSeries, Units, NWBHDF5IO
from pynwb import NWBFile
from pynwb.ecephys import ElectricalSeries
from pynwb.misc import Units
from pynwb import NWBHDF5IO


def read_file_from_backend(
*,
file_path: str | Path | None,
Expand Down Expand Up @@ -111,7 +102,7 @@ def read_nwbfile(
cache: bool = False,
stream_cache_path: str | Path | None = None,
storage_options: dict | None = None,
) -> NWBFile:
) -> "NWBFile":
"""
Read an NWB file and return the NWBFile object.
Expand Down Expand Up @@ -176,8 +167,8 @@ def read_nwbfile(


def _retrieve_electrical_series_pynwb(
nwbfile: NWBFile, electrical_series_path: Optional[str] = None
) -> ElectricalSeries:
nwbfile: "NWBFile", electrical_series_path: Optional[str] = None
) -> "ElectricalSeries":
"""
Get an ElectricalSeries object from an NWBFile.
Expand Down Expand Up @@ -230,7 +221,7 @@ def _retrieve_electrical_series_pynwb(
return electrical_series


def _retrieve_unit_table_pynwb(nwbfile: NWBFile, unit_table_path: Optional[str] = None) -> Units:
def _retrieve_unit_table_pynwb(nwbfile: "NWBFile", unit_table_path: Optional[str] = None) -> "Units":
"""
Get an Units object from an NWBFile.
Units tables can be either the main unit table (nwbfile.units) or in the processing module.
Expand Down

0 comments on commit 3aa0ab6

Please sign in to comment.