pigeon-tem-comms 0.1.0__py3-none-any.whl

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.
TEM_comms/__init__.py ADDED
@@ -0,0 +1,37 @@
1
+ from . import buffer
2
+ from . import camera
3
+ from . import scope
4
+ from . import stage
5
+ from . import tile
6
+
7
+ import importlib.metadata
8
+
9
+
10
+ __version__ = importlib.metadata.version("TEM_comms")
11
+
12
+ topics = {
13
+ "buffer.status": buffer.Status,
14
+ "camera.command": camera.Command,
15
+ "camera.image": camera.Image,
16
+ "camera.settings": camera.Settings,
17
+ "camera.status": camera.Status,
18
+ "scope.command": scope.Command,
19
+ "scope.status": scope.Status,
20
+ "stage.aperture.command": stage.aperture.Command,
21
+ "stage.aperture.status": stage.aperture.Status,
22
+ "stage.motion.command": stage.motion.Command,
23
+ "stage.motion.status": stage.motion.Status,
24
+ "stage.rotation.command": stage.rotation.Command,
25
+ "stage.rotation.status": stage.rotation.Status,
26
+ "tile.jpeg": tile.JPEG,
27
+ "tile.minimap": tile.Minimap,
28
+ "tile.processed": tile.Processed,
29
+ "tile.raw": tile.Raw,
30
+ "tile.statistics.focus": tile.statistics.Focus,
31
+ "tile.statistics.histogram": tile.statistics.Histogram,
32
+ "tile.statistics.min_max_mean": tile.statistics.MinMaxMean,
33
+ "tile.transform": tile.Transform,
34
+ }
35
+
36
+
37
+ msgs = (topics, __version__)
TEM_comms/buffer.py ADDED
@@ -0,0 +1,7 @@
1
+ from emarfarap import BaseMessage
2
+
3
+
4
+ class Status(BaseMessage):
5
+ queue_length: int
6
+ free_space: int
7
+ upload_rate: int
TEM_comms/camera.py ADDED
@@ -0,0 +1,23 @@
1
+ from emarfarap import BaseMessage
2
+
3
+ class Command(BaseMessage):
4
+ tile_id: str
5
+
6
+ class Image(BaseMessage):
7
+ tile_id: str
8
+ path: str
9
+
10
+ class Settings(BaseMessage):
11
+ exposure: float | None = None
12
+ width: int | None = None
13
+ height: int | None = None
14
+
15
+ class Status(BaseMessage):
16
+ exposure: float
17
+ width: int
18
+ height: int
19
+ temp: float
20
+ target_temp: float
21
+ device_name: str
22
+ device_model_id: int
23
+ device_sn: str
TEM_comms/scope.py ADDED
@@ -0,0 +1,21 @@
1
+ from emarfarap import BaseMessage
2
+ from typing import Literal
3
+ from pydantic import model_validator
4
+
5
+ class Command(BaseMessage):
6
+ focus: int | None = None
7
+ mag_mode: Literal["LM", "MAG1", "MAG2"] | None = None
8
+ mag: int | None = None
9
+
10
+ @model_validator(mode="after")
11
+ def check_mag(self):
12
+ assert (self.mag_mode is None) == (self.mag is None)
13
+ return self
14
+
15
+
16
+ class Status(BaseMessage):
17
+ focus: int
18
+ aperture: str | None
19
+ mag_mode: str
20
+ mag: int
21
+ tank_voltage: int
@@ -0,0 +1,3 @@
1
+ from . import aperture
2
+ from . import motion
3
+ from . import rotation
@@ -0,0 +1,10 @@
1
+ from emarfarap import BaseMessage
2
+
3
+ class Command(BaseMessage):
4
+ aperture_id: int | None = None
5
+ calibrate: bool = False
6
+
7
+ class Status(BaseMessage):
8
+ current_aperture: int
9
+ calibrated: bool
10
+ error: str = ""
@@ -0,0 +1,12 @@
1
+ from emarfarap import BaseMessage
2
+
3
+ class Command(BaseMessage):
4
+ x: int | None = None
5
+ y: int | None = None
6
+ calibrate: bool = False
7
+
8
+ class Status(BaseMessage):
9
+ x: int
10
+ y: int
11
+ in_motion: bool
12
+ error: str = ""
@@ -0,0 +1,12 @@
1
+ from emarfarap import BaseMessage
2
+
3
+ class Command(BaseMessage):
4
+ angle_x: float | None = None
5
+ angle_y: float | None = None
6
+ calibrate: bool = False
7
+
8
+ class Status(BaseMessage):
9
+ angle_x: float
10
+ angle_y: float
11
+ in_motion: bool
12
+ error: str = ""
@@ -0,0 +1,33 @@
1
+ from emarfarap import BaseMessage
2
+ from . import statistics
3
+
4
+
5
+ class JPEG(BaseMessage):
6
+ tile_id: str
7
+ path: str
8
+
9
+
10
+ class Minimap(BaseMessage):
11
+ tile_id: str
12
+ path: str
13
+
14
+
15
+ class Processed(BaseMessage):
16
+ tile_id: str
17
+ path: str
18
+
19
+
20
+ class Raw(BaseMessage):
21
+ tile_id: str
22
+ montage_id: str
23
+ path: str
24
+ row: int
25
+ column: int
26
+ overlap: float
27
+
28
+
29
+ class Transform(BaseMessage):
30
+ tile_id: str
31
+ rotation: float
32
+ x: float
33
+ y: float
@@ -0,0 +1,15 @@
1
+ from emarfarap import BaseMessage
2
+
3
+ class Focus(BaseMessage):
4
+ tile_id: str
5
+ focus: float
6
+
7
+ class Histogram(BaseMessage):
8
+ tile_id: str
9
+ path: str
10
+
11
+ class MinMaxMean(BaseMessage):
12
+ tile_id: str
13
+ min: int
14
+ max: int
15
+ mean: int
@@ -0,0 +1,11 @@
1
+ Copyright 2024 Allen Institute
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,17 @@
1
+ Metadata-Version: 2.1
2
+ Name: pigeon-tem-comms
3
+ Version: 0.1.0
4
+ Summary: Pigeon messages for the next generation TEM imaging system.
5
+ Author-email: Cameron Devine <cameron.devine@alleninstitute.org>
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: pigeon-client
10
+ Requires-Dist: pydantic
11
+
12
+ [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/AllenInstitute/TEM_comms/test.yaml)](https://github.com/AllenInstitute/TEM_comms/actions)
13
+ [![PyPI - Version](https://img.shields.io/pypi/v/pigeon-tem-comms)](https://pypi.org/project/pigeon-tem-comms/)
14
+
15
+ # TEM Comms
16
+
17
+ TEM Comms is a set of [Pydantic](https://docs.pydantic.dev/latest/) models to be used as messages with [Pigeon](https://github.com/AllenInstitute/pigeon) for the [Allen Institute's](https://alleninstitute.org/) next generation transmission electron microscope (TEM) [image acquisition system](https://alleninstitute.github.io/TEM_architecture/).
@@ -0,0 +1,16 @@
1
+ TEM_comms/__init__.py,sha256=J5MBiI6dQibGSzEfDI689JU3pdoqugBNCx24WO4NTNY,1132
2
+ TEM_comms/buffer.py,sha256=H3RxH9QkR4N8uKOqDJeH-H3d73fw8gGiga7bmN_gXX0,126
3
+ TEM_comms/camera.py,sha256=q1VUhUcgliA7AFiGmC6hRF9KuqOYmd44P5UsOTGMfPE,443
4
+ TEM_comms/scope.py,sha256=TLUVd2uxVin7kY5eAeL8ZyJSkJr4A3OULY83xal3oS0,504
5
+ TEM_comms/stage/__init__.py,sha256=xeB18s-MGkc83BsfWkUc0W3YwxoHVK-QfLAPfRelcFQ,66
6
+ TEM_comms/stage/aperture.py,sha256=s6MxwgsX0aVCUIT3mHHDZXtmSg-XNE3dqx3EWa-3Kds,220
7
+ TEM_comms/stage/motion.py,sha256=6ZPHJu_WGu2TYLYbp_FmIjsXGDqqTvUBxNCVKBgw9Ns,230
8
+ TEM_comms/stage/rotation.py,sha256=9QpNtyD2iBW51mL0WJ_2nIcso4i51_FMJQEjAhI_vyU,262
9
+ TEM_comms/tile/__init__.py,sha256=CIwc7YH5FenTfNglBVUY5T7l3zZMPRh7RoM1vcGUUFg,461
10
+ TEM_comms/tile/statistics.py,sha256=gbsA43iWf2Bs7rlFZR8m0m0cQysxSeu0He9S6x7EH6Y,245
11
+ pigeon_tem_comms-0.1.0.dist-info/LICENSE,sha256=tZfQIUX7uNGacTb751ZWInVenJl6OwYQihcGbYrKSts,1463
12
+ pigeon_tem_comms-0.1.0.dist-info/METADATA,sha256=d3vooVtjyuJfhhseEotveYay9yv5MP7cPKf1d4hb9UQ,985
13
+ pigeon_tem_comms-0.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
14
+ pigeon_tem_comms-0.1.0.dist-info/entry_points.txt,sha256=KFi0hPNwGY3gEmJF_8_smglVpfbU24lcCy0t_TJPgtg,36
15
+ pigeon_tem_comms-0.1.0.dist-info/top_level.txt,sha256=3_1RcQ7xvS2dJEYnPIigo9snoKcSXSNJzPqunY0qydI,10
16
+ pigeon_tem_comms-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.43.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [pigeon.msgs]
2
+ msgs = TEM_comms:msgs
@@ -0,0 +1 @@
1
+ TEM_comms