ezmsg-tools 0.1.0__tar.gz → 0.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_tools-0.1.0 → ezmsg_tools-0.3.0}/.github/workflows/python-tests.yml +1 -1
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/PKG-INFO +58 -35
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/README.md +44 -30
- ezmsg_tools-0.3.0/docs/source/index.md +16 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/pyproject.toml +21 -9
- ezmsg_tools-0.3.0/scripts_nbs/generator/eeg_generator_graph.py +74 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/scripts_nbs/profiler/ecog_preproc.py +1 -1
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/src/ezmsg/tools/__version__.py +2 -2
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/src/ezmsg/tools/dag.py +32 -13
- ezmsg_tools-0.1.0/src/ezmsg/tools/perfmon/main.py → ezmsg_tools-0.3.0/src/ezmsg/tools/perfmon/cli.py +4 -0
- ezmsg_tools-0.3.0/src/ezmsg/tools/sigmon/cli.py +265 -0
- ezmsg_tools-0.3.0/src/ezmsg/tools/sigmon/dag_widget.py +160 -0
- ezmsg_tools-0.3.0/src/ezmsg/tools/viewer/cli.py +256 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/tests/test_shmem_mirror.py +2 -4
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/tests/test_shmem_sink.py +2 -4
- ezmsg_tools-0.1.0/docs/source/index.rst +0 -69
- ezmsg_tools-0.1.0/scripts_nbs/profiler/mp_demo.py +0 -44
- ezmsg_tools-0.1.0/src/ezmsg/tools/proc.py +0 -87
- ezmsg_tools-0.1.0/src/ezmsg/tools/sigmon/main.py +0 -95
- ezmsg_tools-0.1.0/src/ezmsg/tools/sigmon/ui/base.py +0 -96
- ezmsg_tools-0.1.0/src/ezmsg/tools/sigmon/ui/dag.py +0 -101
- ezmsg_tools-0.1.0/src/ezmsg/tools/sigmon/ui/timeseries.py +0 -263
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/.github/workflows/docs.yml +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/.github/workflows/python-publish.yml +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/.gitignore +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/.pre-commit-config.yaml +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/LICENSE +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/docs/Makefile +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/docs/make.bat +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/docs/source/_templates/autosummary/module.rst +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/docs/source/api/index.rst +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/docs/source/conf.py +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/scripts_nbs/orphan/run_attach.py +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/scripts_nbs/profiler/parse_profiler.ipynb +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/scripts_nbs/profiler/profiler.py +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/src/ezmsg/tools/__init__.py +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/src/ezmsg/tools/perfmon/__init__.py +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/src/ezmsg/tools/shmem/__init__.py +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/src/ezmsg/tools/shmem/shmem.py +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/src/ezmsg/tools/shmem/shmem_mirror.py +0 -0
- {ezmsg_tools-0.1.0 → ezmsg_tools-0.3.0}/src/ezmsg/tools/sigmon/__init__.py +0 -0
- {ezmsg_tools-0.1.0/src/ezmsg/tools/sigmon/ui → ezmsg_tools-0.3.0/src/ezmsg/tools/viewer}/__init__.py +0 -0
|
@@ -1,33 +1,48 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ezmsg-tools
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: ezmsg namespace package containing tools for working with ezmsg graphs.
|
|
5
5
|
Author-email: Chadwick Boulay <chadwick.boulay@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
License-File: LICENSE
|
|
8
|
-
Requires-Python: >=3.
|
|
9
|
-
Requires-Dist: ezmsg>=3.6.
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Requires-Dist: ezmsg>=3.6.2
|
|
10
10
|
Requires-Dist: numpy>=1.26.0
|
|
11
|
+
Requires-Dist: typer>=0.24.1
|
|
11
12
|
Provides-Extra: perfmon
|
|
12
13
|
Requires-Dist: dash-bootstrap-components>=1.6.0; extra == 'perfmon'
|
|
13
14
|
Requires-Dist: dash-extensions>=1.0.19; extra == 'perfmon'
|
|
14
15
|
Requires-Dist: dash>=2.18.2; extra == 'perfmon'
|
|
15
|
-
Requires-Dist: ezmsg-baseproc; extra == 'perfmon'
|
|
16
|
+
Requires-Dist: ezmsg-baseproc>=1.1.0; extra == 'perfmon'
|
|
16
17
|
Requires-Dist: pandas>=2.2.3; extra == 'perfmon'
|
|
17
18
|
Requires-Dist: plotly>=5.24.1; extra == 'perfmon'
|
|
18
19
|
Requires-Dist: pygtail>=0.14.0; extra == 'perfmon'
|
|
19
20
|
Requires-Dist: typer>=0.15.1; extra == 'perfmon'
|
|
20
21
|
Provides-Extra: sigmon
|
|
21
|
-
Requires-Dist:
|
|
22
|
+
Requires-Dist: ezmsg-qt; extra == 'sigmon'
|
|
23
|
+
Requires-Dist: pandas; extra == 'sigmon'
|
|
24
|
+
Requires-Dist: phosphor>=0.4; extra == 'sigmon'
|
|
22
25
|
Requires-Dist: pygraphviz>=1.14; extra == 'sigmon'
|
|
26
|
+
Requires-Dist: pyside6>=6.7; extra == 'sigmon'
|
|
23
27
|
Requires-Dist: typer>=0.15.1; extra == 'sigmon'
|
|
28
|
+
Provides-Extra: viewer
|
|
29
|
+
Requires-Dist: ezmsg-qt; extra == 'viewer'
|
|
30
|
+
Requires-Dist: phosphor>=0.4; extra == 'viewer'
|
|
31
|
+
Requires-Dist: pyside6>=6.7; extra == 'viewer'
|
|
32
|
+
Requires-Dist: typer>=0.15.1; extra == 'viewer'
|
|
24
33
|
Description-Content-Type: text/markdown
|
|
25
34
|
|
|
26
35
|
# ezmsg-tools
|
|
27
36
|
|
|
28
37
|
A namespace package for [ezmsg](https://github.com/iscoe/ezmsg) to visualize running graphs and data.
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
Key features:
|
|
40
|
+
|
|
41
|
+
* **Graph visualization** - Visualize ezmsg graph topologies
|
|
42
|
+
* **Data visualization** - Real-time data plotting and monitoring
|
|
43
|
+
* **Debug tools** - Tools for debugging ezmsg pipelines
|
|
44
|
+
|
|
45
|
+
> The data visualization is highly fragile. Expect bugs.
|
|
31
46
|
|
|
32
47
|
## Installation
|
|
33
48
|
|
|
@@ -41,6 +56,18 @@ On Mac, you should use brew:
|
|
|
41
56
|
* `export CFLAGS="-I $(brew --prefix graphviz)/include"`
|
|
42
57
|
* `export LDFLAGS="-L $(brew --prefix graphviz)/lib"`
|
|
43
58
|
|
|
59
|
+
On Windows, follow the instructions [here](https://pygraphviz.github.io/documentation/stable/install.html#windows). Short version:
|
|
60
|
+
|
|
61
|
+
* Download and install [Visual C/C++](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
|
|
62
|
+
* Download and install [graphviz](https://gitlab.com/graphviz/graphviz/-/releases). Get the most recent Windows x64 CMake releases.
|
|
63
|
+
* Install pygraphviz in your environment:
|
|
64
|
+
```
|
|
65
|
+
python -m pip install --config-settings="--global-option=build_ext"
|
|
66
|
+
--config-settings="--global-option=-IC:\Program Files\Graphviz\include"
|
|
67
|
+
--config-settings="--global-option=-LC:\Program Files\Graphviz\lib"
|
|
68
|
+
pygraphviz
|
|
69
|
+
```
|
|
70
|
+
|
|
44
71
|
### Release
|
|
45
72
|
|
|
46
73
|
Install the latest release from pypi with: `pip install ezmsg-tools` (or `uv add ...` or `poetry add ...`).
|
|
@@ -49,26 +76,36 @@ More than likely, you will want to include at least one of the extras when insta
|
|
|
49
76
|
|
|
50
77
|
`pip install "ezmsg-tools[all]"`
|
|
51
78
|
|
|
52
|
-
|
|
79
|
+
Or install the latest development version:
|
|
53
80
|
|
|
54
|
-
|
|
81
|
+
`pip install "ezmsg-tools[all] @ git+https://github.com/ezmsg-org/ezmsg-tools.git@dev"`
|
|
55
82
|
|
|
56
|
-
|
|
83
|
+
## Getting Started
|
|
57
84
|
|
|
58
|
-
|
|
59
|
-
* Using `poetry`: `poetry add "git+https://github.com/ezmsg-org/ezmsg-tools.git@dev"`
|
|
60
|
-
* Using `uv`: `uv add git+https://github.com/ezmsg-org/ezmsg-tools --branch dev`
|
|
85
|
+
This package includes some entrypoints with useful tools.
|
|
61
86
|
|
|
62
|
-
|
|
87
|
+
### ezmsg-signal-monitor
|
|
63
88
|
|
|
64
|
-
|
|
89
|
+
The pipeline must be running on a graph service exposed on the network. For example, first, run the GraphService on an open port:
|
|
65
90
|
|
|
66
|
-
|
|
91
|
+
`ezmsg --address 127.0.0.1:25978 start`
|
|
67
92
|
|
|
68
|
-
|
|
93
|
+
Then run your usual pipeline but make sure it attaches to the graph address by passing `graph_address=("127.0.0.1", 25978)` as a kwarg to `ez.run`.
|
|
94
|
+
|
|
95
|
+
While the pipeline is running, you can run the signal-monitor tool with (`uv run`) `ezmsg-signal-monitor --graph-addr 127.0.0.1:25978`.
|
|
96
|
+
|
|
97
|
+
This launches a window with graph visualized on the left. Click on a node's output box to get a live visualization on the right side of the screen plotting the data as it leaves that node. Use `a` to toggle auto-scaling. With auto-scaling off, use `-`, and `=` to zoom out and in, respectively. See the [phosphor docs](https://www.ezmsg.org/phosphor/) for the full list of keyboard shortcuts.
|
|
98
|
+
|
|
99
|
+
> Currently only 2-D outputs are supported!
|
|
100
|
+
|
|
101
|
+
Don't forget to shutdown your graph service when you are done, e.g.: `ezmsg --address 127.0.0.1:25978 shutdown`
|
|
69
102
|
|
|
70
103
|
### ezmsg-performance-monitor
|
|
71
104
|
|
|
105
|
+
**DEPRECATED**
|
|
106
|
+
|
|
107
|
+
> ezmsg will soon includes a built-in performance monitor that can be used instead of this tool.
|
|
108
|
+
|
|
72
109
|
This tool operates on logfiles created by ezmsg. Logfiles will automatically be created when running a pipeline containing nodes decorated with `ezmsg.sigproc.util.profile.profile_subpub`,
|
|
73
110
|
and if the `EZMSG_LOGLEVEL` environment variable is set to DEBUG. The logfiles will be created in `~/.ezmsg/profile/ezprofiler.log` by default but this can be changed with the `EZMSG_PROFILE` environment variable.
|
|
74
111
|
|
|
@@ -77,25 +114,11 @@ You can decorate other nodes with `ezmsg.sigproc.util.profile.profile_subpub` to
|
|
|
77
114
|
|
|
78
115
|
During a run with profiling enabled, the logfiles will be created in the specified location. You may wish to additionally create a graph file: (`uv run`) `EZMSG_LOGLEVEL=WARN ezmsg mermaid > ~/.ezmsg/profile/ezprofiler.mermaid`
|
|
79
116
|
|
|
80
|
-
During or after a pipeline run with profiling enabled, you can run (`uv run `) `performance-monitor` to visualize the performance of the nodes in the pipeline.
|
|
117
|
+
During or after a pipeline run with profiling enabled, you can run (`uv run `) `ezmsg-performance-monitor` to visualize the performance of the nodes in the pipeline.
|
|
81
118
|
|
|
82
119
|
> Unlike `signal-monitor`, this tool does not require the pipeline to attach to an existing graph service because it relies exclusively on the logfile.
|
|
83
120
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
The pipeline must be running on a graph service exposed on the network. For example, first, run the GraphService on an open port:
|
|
87
|
-
|
|
88
|
-
`ezmsg --address 127.0.0.1:25978 start`
|
|
89
|
-
|
|
90
|
-
Then run your usual pipeline but make sure it attaches to the graph address by passing `graph_address=("127.0.0.1", 25978)` as a kwarg to `ez.run`.
|
|
91
|
-
|
|
92
|
-
While the pipeline is running, you can run the signal-monitor tool with (`uv run`) `signal-monitor --graph-addr 127.0.0.1:25978`.
|
|
93
|
-
|
|
94
|
-
This launches a window with graph visualized on the left. Click on a node's output box to get a live visualization on the right side of the screen plotting the data as it leaves that node. Use `a` to toggle auto-scaling. With auto-scaling off, use `-`, and `=` to zoom out and in, respectively.
|
|
95
|
-
|
|
96
|
-
> Currently only 2-D outputs are supported!
|
|
97
|
-
|
|
98
|
-
Don't forget to shutdown your graph service when you are done, e.g.: `ezmsg --address 127.0.0.1:25978 shutdown`
|
|
121
|
+
> This performance monitor is soon to be deprecated in favor of monitoring tools built-in to ezmsg.
|
|
99
122
|
|
|
100
123
|
## Developers
|
|
101
124
|
|
|
@@ -105,9 +128,9 @@ We use [`uv`](https://docs.astral.sh/uv/getting-started/installation/) for devel
|
|
|
105
128
|
2. Fork ezmsg-tools and clone your fork to your local computer.
|
|
106
129
|
3. Open a terminal and `cd` to the cloned folder.
|
|
107
130
|
4. Make sure `pygraphviz` [pre-requisites](#pre-requisites) are installed.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
131
|
+
5. `uv sync --all-extras` to create a .venv and install ezmsg-tools including dev and test dependencies.
|
|
132
|
+
6. (Optional) Install pre-commit hooks: `uv run pre-commit install`
|
|
133
|
+
7. After editing code and making commits, Run the test suite before making a PR: `uv run pytest`
|
|
111
134
|
|
|
112
135
|
## Troubleshooting
|
|
113
136
|
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
A namespace package for [ezmsg](https://github.com/iscoe/ezmsg) to visualize running graphs and data.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Key features:
|
|
6
|
+
|
|
7
|
+
* **Graph visualization** - Visualize ezmsg graph topologies
|
|
8
|
+
* **Data visualization** - Real-time data plotting and monitoring
|
|
9
|
+
* **Debug tools** - Tools for debugging ezmsg pipelines
|
|
10
|
+
|
|
11
|
+
> The data visualization is highly fragile. Expect bugs.
|
|
6
12
|
|
|
7
13
|
## Installation
|
|
8
14
|
|
|
@@ -16,6 +22,18 @@ On Mac, you should use brew:
|
|
|
16
22
|
* `export CFLAGS="-I $(brew --prefix graphviz)/include"`
|
|
17
23
|
* `export LDFLAGS="-L $(brew --prefix graphviz)/lib"`
|
|
18
24
|
|
|
25
|
+
On Windows, follow the instructions [here](https://pygraphviz.github.io/documentation/stable/install.html#windows). Short version:
|
|
26
|
+
|
|
27
|
+
* Download and install [Visual C/C++](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
|
|
28
|
+
* Download and install [graphviz](https://gitlab.com/graphviz/graphviz/-/releases). Get the most recent Windows x64 CMake releases.
|
|
29
|
+
* Install pygraphviz in your environment:
|
|
30
|
+
```
|
|
31
|
+
python -m pip install --config-settings="--global-option=build_ext"
|
|
32
|
+
--config-settings="--global-option=-IC:\Program Files\Graphviz\include"
|
|
33
|
+
--config-settings="--global-option=-LC:\Program Files\Graphviz\lib"
|
|
34
|
+
pygraphviz
|
|
35
|
+
```
|
|
36
|
+
|
|
19
37
|
### Release
|
|
20
38
|
|
|
21
39
|
Install the latest release from pypi with: `pip install ezmsg-tools` (or `uv add ...` or `poetry add ...`).
|
|
@@ -24,26 +42,36 @@ More than likely, you will want to include at least one of the extras when insta
|
|
|
24
42
|
|
|
25
43
|
`pip install "ezmsg-tools[all]"`
|
|
26
44
|
|
|
27
|
-
|
|
45
|
+
Or install the latest development version:
|
|
28
46
|
|
|
29
|
-
|
|
47
|
+
`pip install "ezmsg-tools[all] @ git+https://github.com/ezmsg-org/ezmsg-tools.git@dev"`
|
|
30
48
|
|
|
31
|
-
|
|
49
|
+
## Getting Started
|
|
32
50
|
|
|
33
|
-
|
|
34
|
-
* Using `poetry`: `poetry add "git+https://github.com/ezmsg-org/ezmsg-tools.git@dev"`
|
|
35
|
-
* Using `uv`: `uv add git+https://github.com/ezmsg-org/ezmsg-tools --branch dev`
|
|
51
|
+
This package includes some entrypoints with useful tools.
|
|
36
52
|
|
|
37
|
-
|
|
53
|
+
### ezmsg-signal-monitor
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
The pipeline must be running on a graph service exposed on the network. For example, first, run the GraphService on an open port:
|
|
40
56
|
|
|
41
|
-
|
|
57
|
+
`ezmsg --address 127.0.0.1:25978 start`
|
|
42
58
|
|
|
43
|
-
|
|
59
|
+
Then run your usual pipeline but make sure it attaches to the graph address by passing `graph_address=("127.0.0.1", 25978)` as a kwarg to `ez.run`.
|
|
60
|
+
|
|
61
|
+
While the pipeline is running, you can run the signal-monitor tool with (`uv run`) `ezmsg-signal-monitor --graph-addr 127.0.0.1:25978`.
|
|
62
|
+
|
|
63
|
+
This launches a window with graph visualized on the left. Click on a node's output box to get a live visualization on the right side of the screen plotting the data as it leaves that node. Use `a` to toggle auto-scaling. With auto-scaling off, use `-`, and `=` to zoom out and in, respectively. See the [phosphor docs](https://www.ezmsg.org/phosphor/) for the full list of keyboard shortcuts.
|
|
64
|
+
|
|
65
|
+
> Currently only 2-D outputs are supported!
|
|
66
|
+
|
|
67
|
+
Don't forget to shutdown your graph service when you are done, e.g.: `ezmsg --address 127.0.0.1:25978 shutdown`
|
|
44
68
|
|
|
45
69
|
### ezmsg-performance-monitor
|
|
46
70
|
|
|
71
|
+
**DEPRECATED**
|
|
72
|
+
|
|
73
|
+
> ezmsg will soon includes a built-in performance monitor that can be used instead of this tool.
|
|
74
|
+
|
|
47
75
|
This tool operates on logfiles created by ezmsg. Logfiles will automatically be created when running a pipeline containing nodes decorated with `ezmsg.sigproc.util.profile.profile_subpub`,
|
|
48
76
|
and if the `EZMSG_LOGLEVEL` environment variable is set to DEBUG. The logfiles will be created in `~/.ezmsg/profile/ezprofiler.log` by default but this can be changed with the `EZMSG_PROFILE` environment variable.
|
|
49
77
|
|
|
@@ -52,25 +80,11 @@ You can decorate other nodes with `ezmsg.sigproc.util.profile.profile_subpub` to
|
|
|
52
80
|
|
|
53
81
|
During a run with profiling enabled, the logfiles will be created in the specified location. You may wish to additionally create a graph file: (`uv run`) `EZMSG_LOGLEVEL=WARN ezmsg mermaid > ~/.ezmsg/profile/ezprofiler.mermaid`
|
|
54
82
|
|
|
55
|
-
During or after a pipeline run with profiling enabled, you can run (`uv run `) `performance-monitor` to visualize the performance of the nodes in the pipeline.
|
|
83
|
+
During or after a pipeline run with profiling enabled, you can run (`uv run `) `ezmsg-performance-monitor` to visualize the performance of the nodes in the pipeline.
|
|
56
84
|
|
|
57
85
|
> Unlike `signal-monitor`, this tool does not require the pipeline to attach to an existing graph service because it relies exclusively on the logfile.
|
|
58
86
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
The pipeline must be running on a graph service exposed on the network. For example, first, run the GraphService on an open port:
|
|
62
|
-
|
|
63
|
-
`ezmsg --address 127.0.0.1:25978 start`
|
|
64
|
-
|
|
65
|
-
Then run your usual pipeline but make sure it attaches to the graph address by passing `graph_address=("127.0.0.1", 25978)` as a kwarg to `ez.run`.
|
|
66
|
-
|
|
67
|
-
While the pipeline is running, you can run the signal-monitor tool with (`uv run`) `signal-monitor --graph-addr 127.0.0.1:25978`.
|
|
68
|
-
|
|
69
|
-
This launches a window with graph visualized on the left. Click on a node's output box to get a live visualization on the right side of the screen plotting the data as it leaves that node. Use `a` to toggle auto-scaling. With auto-scaling off, use `-`, and `=` to zoom out and in, respectively.
|
|
70
|
-
|
|
71
|
-
> Currently only 2-D outputs are supported!
|
|
72
|
-
|
|
73
|
-
Don't forget to shutdown your graph service when you are done, e.g.: `ezmsg --address 127.0.0.1:25978 shutdown`
|
|
87
|
+
> This performance monitor is soon to be deprecated in favor of monitoring tools built-in to ezmsg.
|
|
74
88
|
|
|
75
89
|
## Developers
|
|
76
90
|
|
|
@@ -80,9 +94,9 @@ We use [`uv`](https://docs.astral.sh/uv/getting-started/installation/) for devel
|
|
|
80
94
|
2. Fork ezmsg-tools and clone your fork to your local computer.
|
|
81
95
|
3. Open a terminal and `cd` to the cloned folder.
|
|
82
96
|
4. Make sure `pygraphviz` [pre-requisites](#pre-requisites) are installed.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
97
|
+
5. `uv sync --all-extras` to create a .venv and install ezmsg-tools including dev and test dependencies.
|
|
98
|
+
6. (Optional) Install pre-commit hooks: `uv run pre-commit install`
|
|
99
|
+
7. After editing code and making commits, Run the test suite before making a PR: `uv run pytest`
|
|
86
100
|
|
|
87
101
|
## Troubleshooting
|
|
88
102
|
|
|
@@ -6,18 +6,20 @@ authors = [
|
|
|
6
6
|
]
|
|
7
7
|
license = "MIT"
|
|
8
8
|
readme = "README.md"
|
|
9
|
-
requires-python = ">=3.
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
10
|
dynamic = ["version"]
|
|
11
11
|
dependencies = [
|
|
12
|
-
"ezmsg>=3.6.
|
|
12
|
+
"ezmsg>=3.6.2",
|
|
13
13
|
"numpy>=1.26.0",
|
|
14
|
+
"typer>=0.24.1",
|
|
14
15
|
]
|
|
15
16
|
|
|
16
17
|
[dependency-groups]
|
|
17
18
|
dev = [
|
|
18
19
|
"pre-commit>=4.0.0",
|
|
19
20
|
"scipy>=1.14.1",
|
|
20
|
-
"ezmsg-sigproc>=2.
|
|
21
|
+
"ezmsg-sigproc>=2.18.0",
|
|
22
|
+
"ezmsg-simbiophys>=1.4.1",
|
|
21
23
|
{include-group = "lint"},
|
|
22
24
|
{include-group = "test"},
|
|
23
25
|
]
|
|
@@ -25,8 +27,8 @@ lint = [
|
|
|
25
27
|
"ruff>=0.12.9",
|
|
26
28
|
]
|
|
27
29
|
test = [
|
|
28
|
-
"ezmsg-sigproc>=1.6.0",
|
|
29
30
|
"pytest>=8.3.3",
|
|
31
|
+
"ezmsg-simbiophys>=1.4.1",
|
|
30
32
|
]
|
|
31
33
|
docs = [
|
|
32
34
|
"sphinx>=7.0",
|
|
@@ -45,17 +47,26 @@ perfmon = [
|
|
|
45
47
|
"typer>=0.15.1",
|
|
46
48
|
"pygtail>=0.14.0",
|
|
47
49
|
"dash-bootstrap-components>=1.6.0",
|
|
48
|
-
"ezmsg-baseproc",
|
|
50
|
+
"ezmsg-baseproc>=1.1.0",
|
|
49
51
|
]
|
|
50
52
|
sigmon = [
|
|
51
|
-
"
|
|
53
|
+
"PySide6>=6.7",
|
|
52
54
|
"pygraphviz>=1.14",
|
|
53
55
|
"typer>=0.15.1",
|
|
56
|
+
"phosphor>=0.4",
|
|
57
|
+
"pandas",
|
|
58
|
+
"ezmsg-qt",
|
|
59
|
+
]
|
|
60
|
+
viewer = [
|
|
61
|
+
"PySide6>=6.7",
|
|
62
|
+
"typer>=0.15.1",
|
|
63
|
+
"phosphor>=0.4",
|
|
64
|
+
"ezmsg-qt",
|
|
54
65
|
]
|
|
55
66
|
|
|
56
67
|
[project.scripts]
|
|
57
|
-
ezmsg-performance-monitor = "ezmsg.tools.perfmon.
|
|
58
|
-
ezmsg-signal-monitor = "ezmsg.tools.sigmon.
|
|
68
|
+
ezmsg-performance-monitor = "ezmsg.tools.perfmon.cli:main"
|
|
69
|
+
ezmsg-signal-monitor = "ezmsg.tools.sigmon.cli:main"
|
|
59
70
|
|
|
60
71
|
[build-system]
|
|
61
72
|
requires = ["hatchling", "hatch-vcs"]
|
|
@@ -89,4 +100,5 @@ known-third-party = ["ezmsg"]
|
|
|
89
100
|
|
|
90
101
|
[tool.uv.sources]
|
|
91
102
|
# Uncomment to use development version of ezmsg from git
|
|
92
|
-
ezmsg = { git = "https://github.com/ezmsg-org/ezmsg.git", branch = "
|
|
103
|
+
#ezmsg = { git = "https://github.com/ezmsg-org/ezmsg.git", branch = "dev" }
|
|
104
|
+
ezmsg-qt = { git = "https://github.com/ezmsg-org/ezmsg-qt.git", branch = "dynamic_subscriber" }
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""Test graph for sigmon development.
|
|
2
|
+
|
|
3
|
+
Generates synthetic EEG (time-domain) and routes a copy through
|
|
4
|
+
Window + Spectrum to produce frequency-domain data. Both branches
|
|
5
|
+
terminate at a no-op Sink so the topics exist in the graph for
|
|
6
|
+
sigmon to subscribe to.
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
uv run python scripts/eeg_generator_graph.py
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import ezmsg.core as ez
|
|
13
|
+
from ezmsg.sigproc.spectrum import Spectrum, SpectrumSettings
|
|
14
|
+
from ezmsg.sigproc.window import Window, WindowSettings
|
|
15
|
+
from ezmsg.simbiophys import EEGSynth, EEGSynthSettings
|
|
16
|
+
from ezmsg.util.messages.axisarray import AxisArray
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Sink(ez.Unit):
|
|
20
|
+
"""Consumes messages and does nothing."""
|
|
21
|
+
|
|
22
|
+
INPUT_SIGNAL = ez.InputStream(AxisArray)
|
|
23
|
+
|
|
24
|
+
@ez.subscriber(INPUT_SIGNAL)
|
|
25
|
+
async def on_message(self, msg: AxisArray) -> None:
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def main() -> None:
|
|
30
|
+
eeg = EEGSynth(
|
|
31
|
+
EEGSynthSettings(
|
|
32
|
+
fs=2000.0,
|
|
33
|
+
n_time=100,
|
|
34
|
+
n_ch=16,
|
|
35
|
+
alpha_freq=10.5,
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
win = Window(
|
|
40
|
+
WindowSettings(
|
|
41
|
+
axis="time",
|
|
42
|
+
window_dur=0.5,
|
|
43
|
+
window_shift=0.2,
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
spec = Spectrum(
|
|
48
|
+
SpectrumSettings(
|
|
49
|
+
axis="time",
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
time_sink = Sink()
|
|
54
|
+
freq_sink = Sink()
|
|
55
|
+
|
|
56
|
+
ez.run(
|
|
57
|
+
components={
|
|
58
|
+
"EEG": eeg,
|
|
59
|
+
"WIN": win,
|
|
60
|
+
"SPEC": spec,
|
|
61
|
+
"TIME_SINK": time_sink,
|
|
62
|
+
"FREQ_SINK": freq_sink,
|
|
63
|
+
},
|
|
64
|
+
connections=(
|
|
65
|
+
(eeg.OUTPUT_SIGNAL, time_sink.INPUT_SIGNAL),
|
|
66
|
+
(eeg.OUTPUT_SIGNAL, win.INPUT_SIGNAL),
|
|
67
|
+
(win.OUTPUT_SIGNAL, spec.INPUT_SIGNAL),
|
|
68
|
+
(spec.OUTPUT_SIGNAL, freq_sink.INPUT_SIGNAL),
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
if __name__ == "__main__":
|
|
74
|
+
main()
|
|
@@ -7,9 +7,9 @@ from ezmsg.sigproc.butterworthfilter import ButterworthFilter
|
|
|
7
7
|
from ezmsg.sigproc.downsample import Downsample
|
|
8
8
|
from ezmsg.sigproc.scaler import AdaptiveStandardScaler
|
|
9
9
|
from ezmsg.sigproc.slicer import Slicer
|
|
10
|
-
from ezmsg.sigproc.synth import EEGSynth
|
|
11
10
|
from ezmsg.sigproc.wavelets import CWT, MinPhaseMode
|
|
12
11
|
from ezmsg.sigproc.window import Anchor
|
|
12
|
+
from ezmsg.simbiophys.eeg import EEGSynth
|
|
13
13
|
from ezmsg.util.terminate import TerminateOnTotal
|
|
14
14
|
|
|
15
15
|
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.
|
|
32
|
-
__version_tuple__ = version_tuple = (0,
|
|
31
|
+
__version__ = version = '0.3.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 3, 0)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import logging
|
|
2
3
|
import typing
|
|
3
4
|
from collections import defaultdict
|
|
4
5
|
from typing import TYPE_CHECKING
|
|
@@ -10,31 +11,49 @@ import pandas as pd
|
|
|
10
11
|
if TYPE_CHECKING:
|
|
11
12
|
import pygraphviz
|
|
12
13
|
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
def get_graph(graph_address: typing.Tuple[str, int], timeout: float = 5.0) -> "pygraphviz.AGraph":
|
|
15
18
|
import pygraphviz as pgv
|
|
16
19
|
|
|
17
20
|
# Create a graphviz object with our graph components as nodes and our connections as edges.
|
|
18
21
|
G = pgv.AGraph(name="ezmsg-graphviz", strict=False, directed=True)
|
|
19
22
|
G.graph_attr["label"] = "ezmsg-graphviz"
|
|
20
23
|
G.graph_attr["rankdir"] = "TB"
|
|
21
|
-
# G.graph_attr["outputorder"] = "edgesfirst"
|
|
22
|
-
# G.graph_attr["ratio"] = "1.0"
|
|
23
|
-
# G.node_attr["shape"] = "circle"
|
|
24
|
-
# G.node_attr["fixedsize"] = "true"
|
|
25
24
|
G.node_attr["fontsize"] = "8"
|
|
26
25
|
G.node_attr["fontcolor"] = "#000000"
|
|
27
26
|
G.node_attr["style"] = "filled"
|
|
28
27
|
G.edge_attr["color"] = "#0000FF"
|
|
29
28
|
G.edge_attr["style"] = "setlinewidth(2)"
|
|
30
29
|
|
|
31
|
-
# Get the dag from the GraphService
|
|
30
|
+
# Get the dag from the GraphService with timeout
|
|
32
31
|
loop = asyncio.new_event_loop()
|
|
33
32
|
asyncio.set_event_loop(loop)
|
|
34
|
-
|
|
33
|
+
|
|
34
|
+
async def dag_with_timeout():
|
|
35
|
+
return await asyncio.wait_for(ez.graphserver.GraphService(address=graph_address).dag(), timeout=timeout)
|
|
36
|
+
|
|
37
|
+
try:
|
|
38
|
+
dag = loop.run_until_complete(dag_with_timeout())
|
|
39
|
+
except asyncio.TimeoutError:
|
|
40
|
+
logger.warning(f"GraphService.dag() timed out after {timeout}s - returning empty graph")
|
|
41
|
+
return G
|
|
42
|
+
except (ConnectionRefusedError, OSError) as e:
|
|
43
|
+
logger.warning(f"GraphService.dag() connection failed: {e} - returning empty graph")
|
|
44
|
+
return G
|
|
45
|
+
except Exception as e:
|
|
46
|
+
logger.warning(f"GraphService.dag() failed: {type(e).__name__}: {e} - returning empty graph")
|
|
47
|
+
return G
|
|
48
|
+
finally:
|
|
49
|
+
loop.close()
|
|
35
50
|
|
|
36
51
|
# Retrieve a description of the graph
|
|
37
52
|
graph_connections = dag.graph.copy()
|
|
53
|
+
|
|
54
|
+
# Handle empty graph - return early with minimal valid AGraph
|
|
55
|
+
if not graph_connections:
|
|
56
|
+
return G
|
|
38
57
|
# graph_connections is a dict with format
|
|
39
58
|
# {
|
|
40
59
|
# 'apath/unit/port': {'some/other_unit/port', 'yet/another/unit/port'},
|
|
@@ -42,14 +61,14 @@ def get_graph(graph_address: typing.Tuple[str, int]) -> "pygraphviz.AGraph":
|
|
|
42
61
|
# where 'port' might be a pub (out) stream or a sub (input) stream.
|
|
43
62
|
|
|
44
63
|
b_refresh_dag = False
|
|
64
|
+
_monitor_topics = {"VISBUFF/INPUT_SIGNAL", "SIGMON/INPUT"}
|
|
45
65
|
for k, v in graph_connections.items():
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
ez.graphserver.GraphService(address=graph_address).disconnect(k,
|
|
50
|
-
)
|
|
66
|
+
for sub in v:
|
|
67
|
+
if any(mt in sub for mt in _monitor_topics):
|
|
68
|
+
b_refresh_dag = True
|
|
69
|
+
asyncio.run(ez.graphserver.GraphService(address=graph_address).disconnect(k, sub))
|
|
51
70
|
if b_refresh_dag:
|
|
52
|
-
dag =
|
|
71
|
+
dag = asyncio.run(ez.graphserver.GraphService(address=graph_address).dag())
|
|
53
72
|
graph_connections = dag.graph.copy()
|
|
54
73
|
|
|
55
74
|
# Generate UUID node names
|