From 23f24b9ac6ca12d37d7699a180ef90e3311c8c51 Mon Sep 17 00:00:00 2001 From: Chadwick Boulay Date: Fri, 30 Jan 2026 14:16:14 -0500 Subject: [PATCH 1/2] Eliminate usage of deprecated ezmsg.util.generator --- src/ezmsg/xdf/source.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/ezmsg/xdf/source.py b/src/ezmsg/xdf/source.py index 50690a5..0228384 100644 --- a/src/ezmsg/xdf/source.py +++ b/src/ezmsg/xdf/source.py @@ -5,7 +5,6 @@ from dataclasses import field import ezmsg.core as ez -from ezmsg.util.generator import GenState from ezmsg.util.messages.axisarray import AxisArray from .iter import XDFAxisArrayIterator, XDFMultiAxArrIterator @@ -62,12 +61,16 @@ class XDFIteratorSettings(ez.Settings): Note, however, that this will terminate the pipeline even if the data published by this unit are still in transit, which will lead to the pipeline output being truncated before it has finished processing the stream. `self_terminating` should only be used when it is not important that the pipeline finish processing data, such - as during prototyping and testing. + as during prototyping and testing. """ +class XDFIteratorState(ez.State): + gen: typing.Any = None + + class XDFIteratorUnit(ez.Unit): - STATE = GenState + STATE = XDFIteratorState SETTINGS = XDFIteratorSettings OUTPUT_SIGNAL = ez.OutputStream(AxisArray) @@ -102,9 +105,7 @@ async def pub_chunk(self) -> typing.AsyncGenerator: else: await asyncio.sleep(0) except StopIteration: - ez.logger.debug( - f"File ({self.SETTINGS.filepath} :: {self.SETTINGS.select}) exhausted." - ) + ez.logger.debug(f"File ({self.SETTINGS.filepath} :: {self.SETTINGS.select}) exhausted.") if self.SETTINGS.self_terminating: raise ez.NormalTermination yield self.OUTPUT_TERM, True @@ -116,7 +117,7 @@ class XDFMultiIteratorUnitSettings(XDFIteratorSettings): class XDFMultiIteratorUnit(ez.Unit): - STATE = GenState + STATE = XDFIteratorState SETTINGS = XDFMultiIteratorUnitSettings OUTPUT_SIGNAL = ez.OutputStream(AxisArray) @@ -152,9 +153,7 @@ async def pub_multi(self) -> typing.AsyncGenerator: else: await asyncio.sleep(0) except StopIteration: - ez.logger.debug( - f"File ({self.SETTINGS.filepath} :: {self.SETTINGS.select}) exhausted." - ) + ez.logger.debug(f"File ({self.SETTINGS.filepath} :: {self.SETTINGS.select}) exhausted.") if self.SETTINGS.self_terminating: raise ez.NormalTermination yield self.OUTPUT_TERM, True From 1bfde0597dbc9e1eba7586691d5c94df0063ec1f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Sep 2026 06:09:21 +0000 Subject: [PATCH 2/2] Initial plan