Skip to content

Commit

Permalink
Merge pull request #29 from iscoe/dev
Browse files Browse the repository at this point in the history
3.3.1: Bugfixes and Logging/Replay Enhancements
  • Loading branch information
griffinmilsap authored Apr 13, 2023
2 parents 780953a + a1c0824 commit 0a43c3a
Show file tree
Hide file tree
Showing 24 changed files with 416 additions and 208 deletions.
4 changes: 2 additions & 2 deletions examples/ezmsg_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def count(self) -> AsyncGenerator:
raise ez.Complete


class CountSystem(ez.System):
class CountSystem(ez.Collection):
COUNT = Count()
TERM = TerminateTest()

Expand All @@ -61,4 +61,4 @@ def process_components(self):
# multiprocessing.set_start_method('spawn', force=True)

system = CountSystem()
ez.run_system(system)
ez.run(SYSTEM = system)
4 changes: 2 additions & 2 deletions examples/ezmsg_normalterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ToySystemSettings(ez.Settings):
output_fn: str


class ToySystem(ez.System):
class ToySystem(ez.Collection):
SETTINGS: ToySystemSettings

# Publishers
Expand Down Expand Up @@ -109,7 +109,7 @@ def main():
system = ToySystem(
ToySystemSettings(num_msgs=num_messages, output_fn=test_filename)
)
ez.run_system(system)
ez.run(SYSTEM = system)

results = []
with open(test_filename, "r") as file:
Expand Down
4 changes: 2 additions & 2 deletions examples/ezmsg_stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ToySystemSettings(ez.Settings):
output_fn: str


class ToySystem(ez.System):
class ToySystem(ez.Collection):
SETTINGS: ToySystemSettings

# Publishers
Expand Down Expand Up @@ -103,7 +103,7 @@ def main():
system = ToySystem(
ToySystemSettings(num_msgs=num_messages, output_fn=test_filename)
)
ez.run_system(system)
ez.run(SYSTEM = system)

results = []
with open(test_filename, "r") as file:
Expand Down
5 changes: 2 additions & 3 deletions examples/ezmsg_toy.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ def process_components(self):

system = TestSystem(TestSystemSettings(name="A"))

ez.run_system(
system,
# name = 'TOY',
ez.run(
SYSTEM = system,
# connections = [
# ( system.PING.OUTPUT, 'PING_OUTPUT' ),
# ( 'FOO_SUB', system.FOOSUB.INPUT )
Expand Down
4 changes: 2 additions & 2 deletions extensions/ezmsg-sigproc/ezmsg/sigproc/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class SamplerTestSystemSettings(ez.Settings):
trigger_settings: TriggerGeneratorSettings


class SamplerTestSystem(ez.System):
class SamplerTestSystem(ez.Collection):
SETTINGS: SamplerTestSystemSettings

OSC = Oscillator()
Expand Down Expand Up @@ -284,4 +284,4 @@ def network(self) -> ez.NetworkDefinition:

system = SamplerTestSystem(settings)

ez.run_system(system)
ez.run(SYSTEM = system)
11 changes: 5 additions & 6 deletions extensions/ezmsg-sigproc/tests/test_butterworth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ezmsg.util.messages.axisarray import AxisArray
from ezmsg.util.messagegate import MessageGate, MessageGateSettings
from ezmsg.util.messagelogger import MessageLogger, MessageLoggerSettings
from ezmsg.util.messagecodec import MessageDecoder
from ezmsg.util.messagecodec import message_log
from ezmsg.sigproc.synth import WhiteNoise, WhiteNoiseSettings
from ezmsg.sigproc.butterworthfilter import ButterworthFilter, ButterworthFilterSettings

Expand All @@ -27,7 +27,7 @@ class ButterworthSystemSettings(ez.Settings):
term_settings: TerminateTestSettings


class ButterworthSystem(ez.System):
class ButterworthSystem(ez.Collection):
NOISE = WhiteNoise()
GATE = MessageGate()
BUTTER = ButterworthFilter()
Expand Down Expand Up @@ -90,12 +90,11 @@ def test_butterworth_system(

system = ButterworthSystem(settings)

ez.run_system(system)
ez.run(SYSTEM = system)

messages: List[AxisArray] = []
with open(test_filename, "r") as file:
for line in file:
messages.append(json.loads(line, cls=MessageDecoder))
for msg in message_log(test_filename):
messages.append(msg)

os.remove(test_filename)

Expand Down
11 changes: 5 additions & 6 deletions extensions/ezmsg-sigproc/tests/test_downsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ezmsg.util.messages.axisarray import AxisArray
from ezmsg.util.messagegate import MessageGate, MessageGateSettings
from ezmsg.util.messagelogger import MessageLogger, MessageLoggerSettings
from ezmsg.util.messagecodec import MessageDecoder
from ezmsg.util.messagecodec import message_log
from ezmsg.sigproc.downsample import Downsample, DownsampleSettings
from ezmsg.sigproc.synth import Oscillator, OscillatorSettings

Expand All @@ -28,7 +28,7 @@ class DownsampleSystemSettings(ez.Settings):
term_settings: TerminateTestSettings


class DownsampleSystem(ez.System):
class DownsampleSystem(ez.Collection):
OSC = Oscillator()
GATE = MessageGate()
DOWN = Downsample()
Expand Down Expand Up @@ -90,12 +90,11 @@ def test_downsample_system(

system = DownsampleSystem(settings)

ez.run_system(system)
ez.run(SYSTEM = system)

messages: List[AxisArray] = []
with open(test_filename, "r") as file:
for line in file:
messages.append(json.loads(line, cls=MessageDecoder))
for msg in message_log(test_filename):
messages.append(msg)

os.remove(test_filename)

Expand Down
11 changes: 5 additions & 6 deletions extensions/ezmsg-sigproc/tests/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ezmsg.util.messages.axisarray import AxisArray
from ezmsg.util.messagegate import MessageGate, MessageGateSettings
from ezmsg.util.messagelogger import MessageLogger, MessageLoggerSettings
from ezmsg.util.messagecodec import MessageDecoder
from ezmsg.util.messagecodec import message_log
from ezmsg.sigproc.synth import Counter, CounterSettings
from ezmsg.sigproc.window import Window, WindowSettings

Expand All @@ -30,7 +30,7 @@ class WindowSystemSettings(ez.Settings):
term_settings: TerminateTestSettings = field(default_factory=TerminateTestSettings)


class WindowSystem(ez.System):
class WindowSystem(ez.Collection):
COUNTER = Counter()
GATE = MessageGate()
WIN = Window()
Expand Down Expand Up @@ -94,12 +94,11 @@ def test_window_system(

system = WindowSystem(settings)

ez.run_system(system)
ez.run(SYSTEM = system)

messages: List[AxisArray] = []
with open(test_filename, "r") as file:
for line in file:
messages.append(json.loads(line, cls=MessageDecoder))
for msg in message_log(test_filename):
messages.append(msg)

os.remove(test_filename)

Expand Down
4 changes: 2 additions & 2 deletions extensions/ezmsg-websocket/examples/ezmsg_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class WebsocketSystemSettings(ez.Settings):
port: int


class WebsocketSystem(ez.System):
class WebsocketSystem(ez.Collection):
SETTINGS: WebsocketSystemSettings

OSC = LFO()
Expand Down Expand Up @@ -104,4 +104,4 @@ def process_components(self) -> Tuple[ez.Component, ...]:
# Run the websocket system
system = WebsocketSystem()
system.apply_settings(WebsocketSystemSettings(host=host, port=port))
ez.run_system(system)
ez.run(SYSTEM = system)
Loading

0 comments on commit 0a43c3a

Please sign in to comment.