|
1 | 1 | from pathlib import Path |
| 2 | +from typing import Any |
2 | 3 |
|
3 | 4 | from pydantic import BaseModel, ValidationError |
4 | | -from workflows.recipe import wrap_subscribe |
| 5 | +from workflows.recipe import RecipeWrapper, wrap_subscribe |
5 | 6 |
|
6 | 7 | from cryoemservices.services.common_service import CommonService |
7 | | -from cryoemservices.util.models import MockRW |
8 | 8 |
|
9 | 9 |
|
10 | 10 | class AlignImagesParameters(BaseModel): |
@@ -35,19 +35,13 @@ def initializing(self): |
35 | 35 | allow_non_recipe_messages=True, |
36 | 36 | ) |
37 | 37 |
|
38 | | - def call_align_images(self, rw, header, message): |
| 38 | + def call_align_images( |
| 39 | + self, |
| 40 | + rw: RecipeWrapper, |
| 41 | + header: dict[str, Any], |
| 42 | + message: dict[str, Any] | None, |
| 43 | + ): |
39 | 44 | """Pass incoming message to the relevant plugin function.""" |
40 | | - # Encase message in ReceipeWrapper if none was provided |
41 | | - if not rw: |
42 | | - self.log.info("Received a simple message") |
43 | | - if not isinstance(message, dict): |
44 | | - self.log.error("Rejected invalid simple message") |
45 | | - self._reject_message(header, requeue=False) |
46 | | - return |
47 | | - # Create a wrapper-like object to be passed to functions |
48 | | - rw = MockRW(self._transport) |
49 | | - rw.recipe_step = {"paramters": message} |
50 | | - |
51 | 45 | try: |
52 | 46 | if isinstance(message, dict): |
53 | 47 | params = AlignImagesParameters( |
|
0 commit comments