|
4 | 4 | import socket |
5 | 5 | from functools import lru_cache |
6 | 6 | from pathlib import Path |
7 | | -from typing import Any, Dict, List, Literal, Mapping, Optional, Union |
| 7 | +from typing import Any, Literal, Mapping, Optional |
8 | 8 |
|
9 | 9 | import yaml |
10 | 10 | from backports.entry_points_selectable import entry_points |
@@ -82,7 +82,7 @@ class MachineConfig(BaseModel): |
82 | 82 | ), |
83 | 83 | # NOTE: This is a placeholder for a key that will be implemented in the future |
84 | 84 | ) |
85 | | - calibrations: dict[str, dict[str, Union[dict, float]]] = Field( |
| 85 | + calibrations: dict[str, dict[str, dict | float]] = Field( |
86 | 86 | default={}, |
87 | 87 | description=( |
88 | 88 | "Nested dictionary containing the calibrations for this microscope. " |
@@ -405,7 +405,7 @@ class MachineConfig(BaseModel): |
405 | 405 | description="URL to where users can authenticate their Murfey sessions.", |
406 | 406 | ) |
407 | 407 |
|
408 | | - # RabbitMQ-specifc keys |
| 408 | + # RabbitMQ-specific keys |
409 | 409 | failure_queue: str = Field( |
410 | 410 | default="", |
411 | 411 | description="Name of RabbitMQ queue where failed API calls will be recorded.", |
@@ -481,7 +481,7 @@ def __validate_default_model_if_processing_enabled_and_spa_possible__( |
481 | 481 |
|
482 | 482 | def machine_config_from_file( |
483 | 483 | config_file_path: Path, instrument: str = "" |
484 | | -) -> Dict[str, MachineConfig]: |
| 484 | +) -> dict[str, MachineConfig]: |
485 | 485 | with open(config_file_path, "r") as config_stream: |
486 | 486 | config = yaml.safe_load(config_stream) |
487 | 487 | return { |
@@ -510,7 +510,7 @@ class GlobalConfig(BaseModel): |
510 | 510 | session_token_timeout: Optional[int] = ( |
511 | 511 | None # seconds; typically the length of a microscope session plus a bit |
512 | 512 | ) |
513 | | - allow_origins: List[str] = ["*"] # Restrict to only certain hostnames |
| 513 | + allow_origins: list[str] = ["*"] # Restrict to only certain hostnames |
514 | 514 |
|
515 | 515 |
|
516 | 516 | def global_config_from_file(config_file_path: Path) -> GlobalConfig: |
@@ -563,7 +563,7 @@ def get_global_config() -> GlobalConfig: |
563 | 563 |
|
564 | 564 |
|
565 | 565 | @lru_cache(maxsize=1) |
566 | | -def get_machine_config(instrument_name: str = "") -> Dict[str, MachineConfig]: |
| 566 | +def get_machine_config(instrument_name: str = "") -> dict[str, MachineConfig]: |
567 | 567 | machine_config = { |
568 | 568 | "": MachineConfig( |
569 | 569 | acquisition_software=[], |
|
0 commit comments