Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ndi/element/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ def _get_epoch_table(obj: Any) -> list[dict]:
Handles ndi_element, ndi_probe, and dict-like objects.
"""
if hasattr(obj, "epochtable"):
return obj.epochtable()
result = obj.epochtable()
if isinstance(result, tuple):
return result[0]
return result
if isinstance(obj, dict):
return obj.get("epochtable", [])
if isinstance(obj, list):
Expand Down
3 changes: 2 additions & 1 deletion src/ndi/epoch/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def epochrange(
Raises:
ValueError: If epochs are not found or range is invalid
"""
et = epochset_obj.epochtable()
result = epochset_obj.epochtable()
et = result[0] if isinstance(result, tuple) else result

if not et:
return [], [], []
Expand Down
4 changes: 1 addition & 3 deletions src/ndi/fun/probe/export_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ def export_binary(
outputfile = Path(outputfile)
metafile = outputfile.with_suffix(outputfile.suffix + ".metadata")

et = probe.epochtable()
if isinstance(et, tuple):
et = et[0]
et, _ = probe.epochtable()

dtype = np.dtype(precision)
chunk_duration = 100 # seconds
Expand Down
2 changes: 1 addition & 1 deletion src/ndi/probe/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _readtimeseries_via_syncgraph(
return None, None, None

# Get epoch table
et = self.epochtable()
et, _ = self.epochtable()
if not et:
return None, None, None

Expand Down
2 changes: 1 addition & 1 deletion src/ndi/probe/timeseries_mfdaq.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def getchanneldevinfo(
return None

# Get epoch probe map
et = self.epochtable()
et, _ = self.epochtable()
if not et:
return None

Expand Down
Loading