diff --git a/src/ndi/element/functions.py b/src/ndi/element/functions.py index 3a74bb0..e7f1d97 100644 --- a/src/ndi/element/functions.py +++ b/src/ndi/element/functions.py @@ -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): diff --git a/src/ndi/epoch/functions.py b/src/ndi/epoch/functions.py index c612360..ce02393 100644 --- a/src/ndi/epoch/functions.py +++ b/src/ndi/epoch/functions.py @@ -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 [], [], [] diff --git a/src/ndi/fun/probe/export_binary.py b/src/ndi/fun/probe/export_binary.py index 62a4927..e7e54bd 100644 --- a/src/ndi/fun/probe/export_binary.py +++ b/src/ndi/fun/probe/export_binary.py @@ -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 diff --git a/src/ndi/probe/timeseries.py b/src/ndi/probe/timeseries.py index 50f8522..2987b38 100644 --- a/src/ndi/probe/timeseries.py +++ b/src/ndi/probe/timeseries.py @@ -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 diff --git a/src/ndi/probe/timeseries_mfdaq.py b/src/ndi/probe/timeseries_mfdaq.py index 2d5a1b9..5fd8949 100644 --- a/src/ndi/probe/timeseries_mfdaq.py +++ b/src/ndi/probe/timeseries_mfdaq.py @@ -168,7 +168,7 @@ def getchanneldevinfo( return None # Get epoch probe map - et = self.epochtable() + et, _ = self.epochtable() if not et: return None