|
3 | 3 | import logging |
4 | 4 | from itertools import count |
5 | 5 | from pathlib import Path |
6 | | -from typing import Any, Dict, List, Optional, OrderedDict, Tuple |
| 6 | +from typing import Any, Optional, OrderedDict |
7 | 7 |
|
8 | 8 | import xmltodict |
9 | 9 |
|
@@ -50,10 +50,10 @@ def _file_transferred_to( |
50 | 50 |
|
51 | 51 |
|
52 | 52 | def _grid_square_metadata_file( |
53 | | - f: Path, data_directories: List[Path], visit: str, grid_square: int |
| 53 | + f: Path, data_directories: list[Path], visit: str, grid_square: int |
54 | 54 | ) -> Path: |
55 | 55 | base_dir, mid_dir = find_longest_data_directory(f, data_directories) |
56 | | - if not base_dir: |
| 56 | + if not base_dir or not mid_dir: |
57 | 57 | raise ValueError(f"Could not determine grid square metadata path for {f}") |
58 | 58 | metadata_file = ( |
59 | 59 | base_dir |
@@ -113,7 +113,7 @@ def __init__(self, acquisition_software: str, basepath: Path, token: str): |
113 | 113 | super().__init__("SPA", acquisition_software, token) |
114 | 114 | self._basepath = basepath |
115 | 115 | self._processing_job_stash: dict = {} |
116 | | - self._foil_holes: Dict[int, List[int]] = {} |
| 116 | + self._foil_holes: dict[int, list[int]] = {} |
117 | 117 |
|
118 | 118 | def gather_metadata( |
119 | 119 | self, metadata_file: Path, environment: MurfeyInstanceEnvironment | None = None |
@@ -287,7 +287,7 @@ def _position_analysis( |
287 | 287 | and self._foil_holes.get(grid_square) is None |
288 | 288 | ): |
289 | 289 | self._foil_holes[grid_square] = [] |
290 | | - gs_pix_position: Tuple[ |
| 290 | + gs_pix_position: tuple[ |
291 | 291 | Optional[int], |
292 | 292 | Optional[int], |
293 | 293 | Optional[float], |
@@ -586,7 +586,7 @@ def _register_processing_job( |
586 | 586 | self, |
587 | 587 | tag: str, |
588 | 588 | environment: MurfeyInstanceEnvironment, |
589 | | - parameters: Dict[str, Any] | None = None, |
| 589 | + parameters: dict[str, Any] | None = None, |
590 | 590 | ): |
591 | 591 | return |
592 | 592 |
|
|
0 commit comments