ezmsg 3.2.2__tar.gz → 3.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ezmsg-3.2.2/ezmsg.egg-info → ezmsg-3.3.0}/PKG-INFO +5 -4
- {ezmsg-3.2.2 → ezmsg-3.3.0}/README.md +4 -3
- ezmsg-3.3.0/docs/source/conf.py +35 -0
- ezmsg-3.3.0/examples/ezmsg_attach.py +8 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/examples/ezmsg_configs.py +32 -33
- {ezmsg-3.2.2 → ezmsg-3.3.0}/examples/ezmsg_count.py +6 -10
- {ezmsg-3.2.2 → ezmsg-3.3.0}/examples/ezmsg_intro.py +187 -195
- {ezmsg-3.2.2 → ezmsg-3.3.0}/examples/ezmsg_normalterm.py +17 -22
- {ezmsg-3.2.2 → ezmsg-3.3.0}/examples/ezmsg_stop.py +13 -20
- {ezmsg-3.2.2 → ezmsg-3.3.0}/examples/ezmsg_toy.py +31 -17
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/__init__.py +1 -0
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/__version__.py +1 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/extensions/ezmsg-sigproc/ezmsg/sigproc/butterworthfilter.py +17 -27
- {ezmsg-3.2.2 → ezmsg-3.3.0}/extensions/ezmsg-sigproc/ezmsg/sigproc/decimate.py +7 -10
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/downsample.py +63 -0
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/ewmfilter.py +127 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/extensions/ezmsg-sigproc/ezmsg/sigproc/filter.py +43 -30
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/messages.py +31 -0
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/sampler.py +287 -0
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/spectral.py +132 -0
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/synth.py +411 -0
- ezmsg-3.3.0/extensions/ezmsg-sigproc/ezmsg/sigproc/window.py +144 -0
- ezmsg-3.3.0/extensions/ezmsg-sigproc/setup.py +7 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/extensions/ezmsg-sigproc/tests/test_butterworth.py +143 -148
- {ezmsg-3.2.2 → ezmsg-3.3.0}/extensions/ezmsg-sigproc/tests/test_downsample.py +133 -145
- {ezmsg-3.2.2 → ezmsg-3.3.0}/extensions/ezmsg-sigproc/tests/test_window.py +140 -155
- ezmsg-3.2.2/ezmsg/testing/__init__.py → ezmsg-3.3.0/extensions/ezmsg-sigproc/tests/util.py +6 -7
- {ezmsg-3.2.2 → ezmsg-3.3.0}/extensions/ezmsg-websocket/examples/ezmsg_websocket.py +38 -25
- ezmsg-3.3.0/extensions/ezmsg-websocket/ezmsg/websocket/__init__.py +1 -0
- ezmsg-3.3.0/extensions/ezmsg-websocket/ezmsg/websocket/__version__.py +1 -0
- ezmsg-3.2.2/extensions/ezmsg-websocket/ezmsg/websocket/__init__.py → ezmsg-3.3.0/extensions/ezmsg-websocket/ezmsg/websocket/units.py +40 -48
- ezmsg-3.3.0/extensions/ezmsg-websocket/setup.py +7 -0
- ezmsg-3.3.0/extensions/ezmsg-zmq/ezmsg/zmq/__init__.py +1 -0
- ezmsg-3.3.0/extensions/ezmsg-zmq/ezmsg/zmq/__version__.py +1 -0
- ezmsg-3.2.2/extensions/ezmsg-zmq/ezmsg/zmq/__init__.py → ezmsg-3.3.0/extensions/ezmsg-zmq/ezmsg/zmq/units.py +73 -72
- ezmsg-3.3.0/extensions/ezmsg-zmq/setup.py +7 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/__init__.py +11 -11
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/__main__.py +2 -1
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/addressable.py +2 -3
- ezmsg-3.3.0/ezmsg/core/backend.py +269 -0
- ezmsg-3.3.0/ezmsg/core/backendprocess.py +378 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/backpressure.py +6 -4
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/collection.py +1 -9
- ezmsg-3.3.0/ezmsg/core/command.py +185 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/component.py +6 -7
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/dag.py +7 -14
- ezmsg-3.3.0/ezmsg/core/graphcontext.py +118 -0
- ezmsg-3.3.0/ezmsg/core/graphserver.py +309 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/message.py +8 -6
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/messagecache.py +12 -9
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/messagemarshal.py +22 -14
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/netprotocol.py +78 -24
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/pubclient.py +85 -78
- ezmsg-3.3.0/ezmsg/core/server.py +158 -0
- ezmsg-3.3.0/ezmsg/core/settings.py +31 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/shmserver.py +87 -145
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/state.py +0 -1
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/stream.py +8 -9
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/subclient.py +49 -41
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/core/unit.py +18 -20
- ezmsg-3.3.0/ezmsg/testing/__init__.py +28 -0
- ezmsg-3.3.0/ezmsg/testing/debuglog.py +1 -0
- ezmsg-3.3.0/ezmsg/testing/multiplier.py +44 -0
- ezmsg-3.3.0/ezmsg/testing/terminate.py +4 -0
- {ezmsg-3.2.2/ezmsg/testing → ezmsg-3.3.0/ezmsg/util}/debuglog.py +4 -5
- ezmsg-3.3.0/ezmsg/util/messagecodec.py +97 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/util/messagegate.py +4 -8
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/util/messagelogger.py +12 -65
- ezmsg-3.3.0/ezmsg/util/messagequeue.py +55 -0
- ezmsg-3.3.0/ezmsg/util/messagereplay.py +91 -0
- ezmsg-3.3.0/ezmsg/util/messages/axisarray.py +223 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/util/rate.py +0 -1
- ezmsg-3.3.0/ezmsg/util/terminate.py +74 -0
- ezmsg-3.3.0/ezmsg/version/__init__.py +1 -0
- ezmsg-3.3.0/ezmsg/version/__version__.py +1 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0/ezmsg.egg-info}/PKG-INFO +5 -4
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg.egg-info/SOURCES.txt +18 -6
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg.egg-info/requires.txt +1 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/setup.cfg +3 -1
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_addressable.py +8 -5
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_attach.py +23 -22
- ezmsg-3.3.0/tests/test_axisarray.py +129 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_connections.py +4 -5
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_dag.py +39 -40
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_graph.py +57 -66
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_perf.py +57 -42
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_run.py +47 -27
- ezmsg-3.3.0/tests/test_shm.py +107 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_state.py +9 -7
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_test.py +1 -1
- ezmsg-3.2.2/docs/source/conf.py +0 -35
- ezmsg-3.2.2/examples/ezmsg_attach.py +0 -8
- ezmsg-3.2.2/extensions/ezmsg-sigproc/ezmsg/sigproc/downsample.py +0 -69
- ezmsg-3.2.2/extensions/ezmsg-sigproc/ezmsg/sigproc/ewmfilter.py +0 -121
- ezmsg-3.2.2/extensions/ezmsg-sigproc/ezmsg/sigproc/messages.py +0 -51
- ezmsg-3.2.2/extensions/ezmsg-sigproc/ezmsg/sigproc/sampler.py +0 -253
- ezmsg-3.2.2/extensions/ezmsg-sigproc/ezmsg/sigproc/synth.py +0 -236
- ezmsg-3.2.2/extensions/ezmsg-sigproc/ezmsg/sigproc/timeseriesmessage.py +0 -1
- ezmsg-3.2.2/extensions/ezmsg-sigproc/ezmsg/sigproc/window.py +0 -112
- ezmsg-3.2.2/extensions/ezmsg-sigproc/setup.py +0 -7
- ezmsg-3.2.2/extensions/ezmsg-sigproc/tests/test_tsmessage.py +0 -28
- ezmsg-3.2.2/extensions/ezmsg-websocket/setup.py +0 -7
- ezmsg-3.2.2/extensions/ezmsg-zmq/setup.py +0 -7
- ezmsg-3.2.2/ezmsg/core/__version__.py +0 -1
- ezmsg-3.2.2/ezmsg/core/backend.py +0 -215
- ezmsg-3.2.2/ezmsg/core/backendprocess.py +0 -259
- ezmsg-3.2.2/ezmsg/core/command.py +0 -114
- ezmsg-3.2.2/ezmsg/core/graphcontext.py +0 -98
- ezmsg-3.2.2/ezmsg/core/graphserver.py +0 -320
- ezmsg-3.2.2/ezmsg/core/settings.py +0 -27
- ezmsg-3.2.2/ezmsg/testing/multiplier.py +0 -47
- ezmsg-3.2.2/ezmsg/testing/terminate.py +0 -38
- ezmsg-3.2.2/ezmsg/util/__init__.py +0 -0
- ezmsg-3.2.2/ezmsg/util/messages.py +0 -182
- ezmsg-3.2.2/ezmsg/util/stampedmessage.py +0 -13
- ezmsg-3.2.2/tests/test_shm.py +0 -100
- {ezmsg-3.2.2 → ezmsg-3.3.0}/LICENSE +0 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg/testing/lfo.py +0 -0
- {ezmsg-3.2.2/examples → ezmsg-3.3.0/ezmsg/util}/__init__.py +0 -0
- {ezmsg-3.2.2/extensions/ezmsg-sigproc/ezmsg/sigproc → ezmsg-3.3.0/ezmsg/util/messages}/__init__.py +0 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg.egg-info/dependency_links.txt +0 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg.egg-info/entry_points.txt +0 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/ezmsg.egg-info/top_level.txt +0 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/pyproject.toml +0 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/setup.py +0 -0
- {ezmsg-3.2.2 → ezmsg-3.3.0}/tests/test_unit.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ezmsg
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: A simple DAG-based computation model
|
|
5
5
|
Home-page: https://github.com/iscoe/ezmsg
|
|
6
6
|
Author: Griffin Milsap
|
|
@@ -17,16 +17,17 @@ License-File: LICENSE
|
|
|
17
17
|
|
|
18
18
|
Messaging and Multiprocessing.
|
|
19
19
|
|
|
20
|
-
`ezmsg` is a pure-
|
|
20
|
+
`ezmsg` is a pure-Python implementation of a directed acyclic graph (DAG) pub/sub messaging pattern based on [`labgraph`](https://github.com/facebookresearch/labgraph) which is optimized and intended for use in constructing real-time software. `ezmsg` implements much of the `labgraph` API (with a few notable differences), and owes a lot of its design to the `labgraph` developers/project.
|
|
21
21
|
|
|
22
|
-
`ezmsg` is very fast and uses Python's
|
|
22
|
+
`ezmsg` is very fast and uses Python's `multiprocessing.shared_memory` module to facilitate efficient message passing without C++ or any compilation/build tooling.
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
`pip install ezmsg`
|
|
26
26
|
|
|
27
27
|
## Dependencies
|
|
28
28
|
|
|
29
|
-
Due to reliance on `multiprocessing.shared_memory`, `ezmsg` requires __minimum Python 3.8__.
|
|
29
|
+
* Due to reliance on `multiprocessing.shared_memory`, `ezmsg` requires __minimum Python 3.8__.
|
|
30
|
+
* `typing_extensions`
|
|
30
31
|
|
|
31
32
|
Testing `ezmsg` requires:
|
|
32
33
|
* `pytest`
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Messaging and Multiprocessing.
|
|
4
4
|
|
|
5
|
-
`ezmsg` is a pure-
|
|
5
|
+
`ezmsg` is a pure-Python implementation of a directed acyclic graph (DAG) pub/sub messaging pattern based on [`labgraph`](https://github.com/facebookresearch/labgraph) which is optimized and intended for use in constructing real-time software. `ezmsg` implements much of the `labgraph` API (with a few notable differences), and owes a lot of its design to the `labgraph` developers/project.
|
|
6
6
|
|
|
7
|
-
`ezmsg` is very fast and uses Python's
|
|
7
|
+
`ezmsg` is very fast and uses Python's `multiprocessing.shared_memory` module to facilitate efficient message passing without C++ or any compilation/build tooling.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
`pip install ezmsg`
|
|
11
11
|
|
|
12
12
|
## Dependencies
|
|
13
13
|
|
|
14
|
-
Due to reliance on `multiprocessing.shared_memory`, `ezmsg` requires __minimum Python 3.8__.
|
|
14
|
+
* Due to reliance on `multiprocessing.shared_memory`, `ezmsg` requires __minimum Python 3.8__.
|
|
15
|
+
* `typing_extensions`
|
|
15
16
|
|
|
16
17
|
Testing `ezmsg` requires:
|
|
17
18
|
* `pytest`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
|
|
3
|
+
# -- Project information
|
|
4
|
+
|
|
5
|
+
project = "ezmsg"
|
|
6
|
+
copyright = "2022, JHU/APL"
|
|
7
|
+
author = "JHU/APL"
|
|
8
|
+
|
|
9
|
+
release = "3.0"
|
|
10
|
+
version = "3.0.0"
|
|
11
|
+
|
|
12
|
+
# -- General configuration
|
|
13
|
+
|
|
14
|
+
extensions = [
|
|
15
|
+
"sphinx.ext.duration",
|
|
16
|
+
"sphinx.ext.doctest",
|
|
17
|
+
"sphinx.ext.autodoc",
|
|
18
|
+
"sphinx.ext.autosummary",
|
|
19
|
+
"sphinx.ext.intersphinx",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
intersphinx_mapping = {
|
|
23
|
+
"python": ("https://docs.python.org/3/", None),
|
|
24
|
+
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
|
|
25
|
+
}
|
|
26
|
+
intersphinx_disabled_domains = ["std"]
|
|
27
|
+
|
|
28
|
+
templates_path = ["_templates"]
|
|
29
|
+
|
|
30
|
+
# -- Options for HTML output
|
|
31
|
+
|
|
32
|
+
html_theme = "sphinx_rtd_theme"
|
|
33
|
+
|
|
34
|
+
# -- Options for EPUB output
|
|
35
|
+
epub_show_urls = "footnote"
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
import logging
|
|
3
2
|
|
|
4
3
|
import ezmsg.core as ez
|
|
5
|
-
from ezmsg.
|
|
4
|
+
from ezmsg.util.debuglog import DebugLog
|
|
6
5
|
|
|
7
6
|
from typing import AsyncGenerator, Optional
|
|
8
7
|
|
|
9
|
-
logger = logging.getLogger(__name__)
|
|
10
|
-
|
|
11
8
|
|
|
12
9
|
# Terminator -- Arnold Schwarzenegger
|
|
13
10
|
|
|
11
|
+
|
|
14
12
|
class TerminatorSettings(ez.Settings):
|
|
15
13
|
term_after: float = 1.0 # sec
|
|
16
14
|
|
|
@@ -23,6 +21,7 @@ class Terminator(ez.Unit):
|
|
|
23
21
|
await asyncio.sleep(self.SETTINGS.term_after)
|
|
24
22
|
raise ez.NormalTermination
|
|
25
23
|
|
|
24
|
+
|
|
26
25
|
# Generator -- A Pure Publisher
|
|
27
26
|
|
|
28
27
|
|
|
@@ -32,7 +31,6 @@ class GeneratorSettings(ez.Settings):
|
|
|
32
31
|
|
|
33
32
|
|
|
34
33
|
class Generator(ez.Unit):
|
|
35
|
-
|
|
36
34
|
SETTINGS: GeneratorSettings
|
|
37
35
|
|
|
38
36
|
OUTPUT = ez.OutputStream(int)
|
|
@@ -47,12 +45,12 @@ class Generator(ez.Unit):
|
|
|
47
45
|
|
|
48
46
|
# Modulus -- A Pure Modifier
|
|
49
47
|
|
|
48
|
+
|
|
50
49
|
class ModulusSettings(ez.Settings):
|
|
51
50
|
mod: int = 3
|
|
52
51
|
|
|
53
52
|
|
|
54
53
|
class Modulus(ez.Unit):
|
|
55
|
-
|
|
56
54
|
SETTINGS: ModulusSettings
|
|
57
55
|
|
|
58
56
|
INPUT = ez.InputStream(int)
|
|
@@ -66,6 +64,7 @@ class Modulus(ez.Unit):
|
|
|
66
64
|
|
|
67
65
|
# Listener -- A Pure Subscriber
|
|
68
66
|
|
|
67
|
+
|
|
69
68
|
class ListenerState(ez.State):
|
|
70
69
|
value: Optional[int] = None
|
|
71
70
|
|
|
@@ -82,56 +81,58 @@ class Listener(ez.Unit):
|
|
|
82
81
|
|
|
83
82
|
# Weird passthrough collection
|
|
84
83
|
|
|
84
|
+
|
|
85
85
|
class PassthroughCollection(ez.Collection):
|
|
86
86
|
INPUT = ez.InputStream(int)
|
|
87
87
|
OUTPUT = ez.OutputStream(int)
|
|
88
88
|
|
|
89
89
|
def network(self) -> ez.NetworkDefinition:
|
|
90
|
-
return (
|
|
91
|
-
(self.INPUT, self.OUTPUT),
|
|
92
|
-
)
|
|
90
|
+
return ((self.INPUT, self.OUTPUT),)
|
|
93
91
|
|
|
94
92
|
|
|
95
93
|
# CORNER CASES
|
|
96
94
|
|
|
97
|
-
|
|
95
|
+
|
|
96
|
+
class EmptySystem(ez.Collection):
|
|
98
97
|
...
|
|
99
98
|
|
|
100
99
|
|
|
101
|
-
class EmptyTerminateSystem(ez.
|
|
100
|
+
class EmptyTerminateSystem(ez.Collection):
|
|
102
101
|
TERMINATE = Terminator()
|
|
103
102
|
|
|
104
103
|
|
|
105
|
-
class OnlyPassthroughSystem(ez.
|
|
104
|
+
class OnlyPassthroughSystem(ez.Collection):
|
|
106
105
|
TERMINATE = Terminator()
|
|
107
106
|
PASSTHROUGH = PassthroughCollection()
|
|
108
107
|
|
|
109
108
|
def configure(self) -> None:
|
|
110
|
-
logger.info(
|
|
109
|
+
ez.logger.info("No output expected")
|
|
111
110
|
|
|
112
111
|
|
|
113
112
|
# SYSTEMS WITH HANGING PUBS AND SUBS
|
|
114
113
|
|
|
115
|
-
|
|
114
|
+
|
|
115
|
+
class PubNoSubSystem(ez.Collection):
|
|
116
116
|
TERMINATE = Terminator()
|
|
117
117
|
GENERATE = Generator()
|
|
118
118
|
LOG = DebugLog()
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
class SubNoPubSystem(ez.
|
|
121
|
+
class SubNoPubSystem(ez.Collection):
|
|
122
122
|
TERMINATE = Terminator()
|
|
123
123
|
LISTEN = Listener()
|
|
124
124
|
|
|
125
125
|
def configure(self) -> None:
|
|
126
|
-
logger.info(
|
|
126
|
+
ez.logger.info("No output expected")
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
class NoPubNoSubSystem(ez.
|
|
129
|
+
class NoPubNoSubSystem(ez.Collection):
|
|
130
130
|
TERMINATE = Terminator()
|
|
131
131
|
MODULUS = Modulus()
|
|
132
132
|
|
|
133
133
|
def configure(self) -> None:
|
|
134
|
-
logger.info(
|
|
134
|
+
ez.logger.info("No output expected")
|
|
135
|
+
|
|
135
136
|
|
|
136
137
|
# Systems with collections that have hanging pubs and subs
|
|
137
138
|
|
|
@@ -153,26 +154,25 @@ class SubNoPubCollection(ez.Collection):
|
|
|
153
154
|
LISTEN = Listener()
|
|
154
155
|
|
|
155
156
|
def network(self) -> ez.NetworkDefinition:
|
|
156
|
-
return (
|
|
157
|
-
(self.INPUT, self.LISTEN.INPUT),
|
|
158
|
-
)
|
|
157
|
+
return ((self.INPUT, self.LISTEN.INPUT),)
|
|
159
158
|
|
|
160
159
|
|
|
161
|
-
class PubNoSubCollectionSystem(ez.
|
|
160
|
+
class PubNoSubCollectionSystem(ez.Collection):
|
|
162
161
|
TERMINATE = Terminator()
|
|
163
162
|
COLLECTION = PubNoSubCollection()
|
|
164
163
|
|
|
165
164
|
|
|
166
|
-
class SubNoPubCollectionSystem(ez.
|
|
165
|
+
class SubNoPubCollectionSystem(ez.Collection):
|
|
167
166
|
TERMINATE = Terminator()
|
|
168
167
|
COLLECTION = SubNoPubCollection()
|
|
169
168
|
|
|
170
169
|
def configure(self) -> None:
|
|
171
|
-
logger.info(
|
|
170
|
+
ez.logger.info("No output expected")
|
|
172
171
|
|
|
173
172
|
|
|
174
173
|
# Passthrough Collection Tests
|
|
175
174
|
|
|
175
|
+
|
|
176
176
|
class PubNoSubPassthroughCollection(ez.Collection):
|
|
177
177
|
COLLECTION = PubNoSubCollection()
|
|
178
178
|
PASSTHROUGH = PassthroughCollection()
|
|
@@ -199,20 +199,20 @@ class SubNoPubPassthroughCollection(ez.Collection):
|
|
|
199
199
|
)
|
|
200
200
|
|
|
201
201
|
|
|
202
|
-
class PubNoSubPassthroughCollectionSystem(ez.
|
|
202
|
+
class PubNoSubPassthroughCollectionSystem(ez.Collection):
|
|
203
203
|
TERMINATE = Terminator()
|
|
204
204
|
COLLECTION = PubNoSubPassthroughCollection()
|
|
205
205
|
|
|
206
206
|
|
|
207
|
-
class SubNoPubPassthroughCollectionSystem(ez.
|
|
207
|
+
class SubNoPubPassthroughCollectionSystem(ez.Collection):
|
|
208
208
|
TERMINATE = Terminator()
|
|
209
209
|
COLLECTION = SubNoPubPassthroughCollection()
|
|
210
210
|
|
|
211
211
|
def configure(self) -> None:
|
|
212
|
-
logger.info(
|
|
212
|
+
ez.logger.info("No output expected")
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
class PassthroughSystem(ez.
|
|
215
|
+
class PassthroughSystem(ez.Collection):
|
|
216
216
|
TERMINATE = Terminator()
|
|
217
217
|
GENERATE = Generator()
|
|
218
218
|
PASSTHROUGH = PassthroughCollection()
|
|
@@ -221,12 +221,11 @@ class PassthroughSystem(ez.System):
|
|
|
221
221
|
def network(self) -> ez.NetworkDefinition:
|
|
222
222
|
return (
|
|
223
223
|
(self.GENERATE.OUTPUT, self.PASSTHROUGH.INPUT),
|
|
224
|
-
(self.PASSTHROUGH.OUTPUT, self.LOG.INPUT)
|
|
224
|
+
(self.PASSTHROUGH.OUTPUT, self.LOG.INPUT),
|
|
225
225
|
)
|
|
226
226
|
|
|
227
227
|
|
|
228
|
-
if __name__ ==
|
|
229
|
-
|
|
228
|
+
if __name__ == "__main__":
|
|
230
229
|
test_systems = [
|
|
231
230
|
EmptySystem,
|
|
232
231
|
EmptyTerminateSystem,
|
|
@@ -242,5 +241,5 @@ if __name__ == '__main__':
|
|
|
242
241
|
]
|
|
243
242
|
|
|
244
243
|
for system in test_systems:
|
|
245
|
-
logger.info(f
|
|
246
|
-
ez.
|
|
244
|
+
ez.logger.info(f"Testing { system.__name__ }")
|
|
245
|
+
ez.run(system())
|
|
@@ -3,8 +3,8 @@ import array
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
import ezmsg.core as ez
|
|
5
5
|
|
|
6
|
-
from ezmsg.
|
|
7
|
-
from ezmsg.
|
|
6
|
+
from ezmsg.util.debuglog import DebugLog, DebugLogSettings
|
|
7
|
+
from ezmsg.util.terminate import TerminateOnTimeout as TerminateTest
|
|
8
8
|
|
|
9
9
|
from typing import AsyncGenerator
|
|
10
10
|
|
|
@@ -20,7 +20,6 @@ class CountSettings(ez.Settings):
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class Count(ez.Unit):
|
|
23
|
-
|
|
24
23
|
SETTINGS: CountSettings
|
|
25
24
|
|
|
26
25
|
OUTPUT = ez.OutputStream(int)
|
|
@@ -31,8 +30,7 @@ class Count(ez.Unit):
|
|
|
31
30
|
while True:
|
|
32
31
|
await asyncio.sleep(0.1)
|
|
33
32
|
yield self.OUTPUT, CountMessage(
|
|
34
|
-
value=count,
|
|
35
|
-
arr=array.array('b', [0x00] * (2 ** count))
|
|
33
|
+
value=count, arr=array.array("b", [0x00] * (2**count))
|
|
36
34
|
)
|
|
37
35
|
count = count + 1
|
|
38
36
|
|
|
@@ -41,12 +39,11 @@ class Count(ez.Unit):
|
|
|
41
39
|
|
|
42
40
|
|
|
43
41
|
class CountSystem(ez.System):
|
|
44
|
-
|
|
45
42
|
COUNT = Count()
|
|
46
43
|
TERM = TerminateTest()
|
|
47
44
|
|
|
48
|
-
SUB1 = DebugLog(DebugLogSettings(name=
|
|
49
|
-
SUB2 = DebugLog(DebugLogSettings(name=
|
|
45
|
+
SUB1 = DebugLog(DebugLogSettings(name="SUB1"))
|
|
46
|
+
SUB2 = DebugLog(DebugLogSettings(name="SUB2"))
|
|
50
47
|
|
|
51
48
|
def network(self) -> ez.NetworkDefinition:
|
|
52
49
|
return (
|
|
@@ -59,8 +56,7 @@ class CountSystem(ez.System):
|
|
|
59
56
|
return (self.COUNT, self.SUB1, self.SUB2)
|
|
60
57
|
|
|
61
58
|
|
|
62
|
-
if __name__ ==
|
|
63
|
-
|
|
59
|
+
if __name__ == "__main__":
|
|
64
60
|
# import multiprocessing
|
|
65
61
|
# multiprocessing.set_start_method('spawn', force=True)
|
|
66
62
|
|