Skip to content

Commit 93ebb07

Browse files
committed
Modernised type hints
1 parent 2b25266 commit 93ebb07

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/murfey/util/config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import socket
55
from functools import lru_cache
66
from pathlib import Path
7-
from typing import Any, Dict, List, Literal, Mapping, Optional, Union
7+
from typing import Any, Literal, Mapping, Optional
88

99
import yaml
1010
from backports.entry_points_selectable import entry_points
@@ -82,7 +82,7 @@ class MachineConfig(BaseModel):
8282
),
8383
# NOTE: This is a placeholder for a key that will be implemented in the future
8484
)
85-
calibrations: dict[str, dict[str, Union[dict, float]]] = Field(
85+
calibrations: dict[str, dict[str, dict | float]] = Field(
8686
default={},
8787
description=(
8888
"Nested dictionary containing the calibrations for this microscope. "
@@ -405,7 +405,7 @@ class MachineConfig(BaseModel):
405405
description="URL to where users can authenticate their Murfey sessions.",
406406
)
407407

408-
# RabbitMQ-specifc keys
408+
# RabbitMQ-specific keys
409409
failure_queue: str = Field(
410410
default="",
411411
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__(
481481

482482
def machine_config_from_file(
483483
config_file_path: Path, instrument: str = ""
484-
) -> Dict[str, MachineConfig]:
484+
) -> dict[str, MachineConfig]:
485485
with open(config_file_path, "r") as config_stream:
486486
config = yaml.safe_load(config_stream)
487487
return {
@@ -510,7 +510,7 @@ class GlobalConfig(BaseModel):
510510
session_token_timeout: Optional[int] = (
511511
None # seconds; typically the length of a microscope session plus a bit
512512
)
513-
allow_origins: List[str] = ["*"] # Restrict to only certain hostnames
513+
allow_origins: list[str] = ["*"] # Restrict to only certain hostnames
514514

515515

516516
def global_config_from_file(config_file_path: Path) -> GlobalConfig:
@@ -563,7 +563,7 @@ def get_global_config() -> GlobalConfig:
563563

564564

565565
@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]:
567567
machine_config = {
568568
"": MachineConfig(
569569
acquisition_software=[],

0 commit comments

Comments
 (0)