Skip to content

Commit 93cdec0

Browse files
committed
Switched to using built-in types instead of 'typing' module ones
1 parent bb7c2c4 commit 93cdec0

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/murfey/util/config.py

Lines changed: 18 additions & 18 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 Dict, List, Literal, Optional, Union
7+
from typing import Literal, Optional, Union
88

99
import yaml
1010
from backports.entry_points_selectable import entry_points
@@ -26,16 +26,16 @@ class MachineConfig(BaseModel, extra=Extra.allow): # type: ignore
2626
# Hardware and software -----------------------------------------------------------
2727
camera: str = "FALCON"
2828
superres: bool = False
29-
calibrations: Dict[str, Dict[str, Union[dict, float]]]
30-
acquisition_software: List[str]
31-
software_versions: Dict[str, str] = {}
32-
software_settings_output_directories: Dict[str, List[str]] = {}
33-
data_required_substrings: Dict[str, Dict[str, List[str]]] = {}
29+
calibrations: dict[str, dict[str, Union[dict, float]]]
30+
acquisition_software: list[str]
31+
software_versions: dict[str, str] = {}
32+
software_settings_output_directories: dict[str, list[str]] = {}
33+
data_required_substrings: dict[str, dict[str, list[str]]] = {}
3434

3535
# Client side directory setup -----------------------------------------------------
36-
data_directories: List[Path]
36+
data_directories: list[Path]
3737
create_directories: list[str] = ["atlas"]
38-
analyse_created_directories: List[str] = []
38+
analyse_created_directories: list[str] = []
3939
gain_reference_directory: Optional[Path] = None
4040
eer_fractionation_file_template: str = ""
4141

@@ -48,9 +48,9 @@ class MachineConfig(BaseModel, extra=Extra.allow): # type: ignore
4848
allow_removal: bool = False
4949

5050
# Upstream data download setup
51-
upstream_data_directories: List[Path] = [] # Previous sessions
51+
upstream_data_directories: list[Path] = [] # Previous sessions
5252
upstream_data_download_directory: Optional[Path] = None # Set by microscope config
53-
upstream_data_tiff_locations: List[str] = ["processed"] # Location of CLEM TIFFs
53+
upstream_data_tiff_locations: list[str] = ["processed"] # Location of CLEM TIFFs
5454

5555
# Data processing setup -----------------------------------------------------------
5656
# General processing setup
@@ -59,7 +59,7 @@ class MachineConfig(BaseModel, extra=Extra.allow): # type: ignore
5959
gain_directory_name: str = "processing"
6060
processed_directory_name: str = "processed"
6161
processed_extra_directory: str = ""
62-
recipes: Dict[str, str] = {
62+
recipes: dict[str, str] = {
6363
"em-spa-bfactor": "em-spa-bfactor",
6464
"em-spa-class2d": "em-spa-class2d",
6565
"em-spa-class3d": "em-spa-class3d",
@@ -75,10 +75,10 @@ class MachineConfig(BaseModel, extra=Extra.allow): # type: ignore
7575
initial_model_search_directory: str = "processing/initial_model"
7676

7777
# Data analysis plugins
78-
external_executables: Dict[str, str] = {}
79-
external_executables_eer: Dict[str, str] = {}
80-
external_environment: Dict[str, str] = {}
81-
plugin_packages: Dict[str, Path] = {}
78+
external_executables: dict[str, str] = {}
79+
external_executables_eer: dict[str, str] = {}
80+
external_environment: dict[str, str] = {}
81+
plugin_packages: dict[str, Path] = {}
8282

8383
# Server and network setup --------------------------------------------------------
8484
# Configurations and URLs
@@ -93,7 +93,7 @@ class MachineConfig(BaseModel, extra=Extra.allow): # type: ignore
9393
notifications_queue: str = "pato_notification"
9494

9595

96-
def from_file(config_file_path: Path, instrument: str = "") -> Dict[str, MachineConfig]:
96+
def from_file(config_file_path: Path, instrument: str = "") -> dict[str, MachineConfig]:
9797
with open(config_file_path, "r") as config_stream:
9898
config = yaml.safe_load(config_stream)
9999
return {
@@ -110,7 +110,7 @@ class Security(BaseModel):
110110
auth_algorithm: str = ""
111111
auth_url: str = ""
112112
sqlalchemy_pooling: bool = True
113-
allow_origins: List[str] = ["*"]
113+
allow_origins: list[str] = ["*"]
114114
session_validation: str = ""
115115
session_token_timeout: Optional[int] = None
116116
auth_type: Literal["password", "cookie"] = "password"
@@ -179,7 +179,7 @@ def get_security_config() -> Security:
179179

180180

181181
@lru_cache(maxsize=1)
182-
def get_machine_config(instrument_name: str = "") -> Dict[str, MachineConfig]:
182+
def get_machine_config(instrument_name: str = "") -> dict[str, MachineConfig]:
183183
machine_config = {
184184
"": MachineConfig(
185185
acquisition_software=[],

0 commit comments

Comments
 (0)