Skip to content

Commit

Permalink
adding a QC status message and bumped version number
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronDevine committed Sep 25, 2024
1 parent 271575f commit 5239f96
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions TEM_comms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from . import tile
from . import ui
from . import montage
from . import qc


topics = {
Expand Down Expand Up @@ -34,4 +35,5 @@
"ui.setup": ui.Setup,
"montage.start": montage.Start,
"montage.finished": montage.Finished,
"qc.status": qc.Status,
}
6 changes: 6 additions & 0 deletions TEM_comms/qc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from pigeon import BaseMessage
from typing import Literal


class Status(BaseMessage):
state: Literal["GOOD", "STOP_AT_END", "STOP_NOW"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pigeon-tem-comms"
version = "0.4.0"
version = "0.4.1"
authors = [
{ name="Cameron Devine", email="[email protected]" },
]
Expand Down
8 changes: 8 additions & 0 deletions tests/test_qc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from TEM_comms.qc import Status
from pydantic import ValidationError
import pytest


def test_bad_status():
with pytest.raises(ValidationError):
Status(state="BAD")

0 comments on commit 5239f96

Please sign in to comment.