Skip to content

Commit 74871e1

Browse files
committed
Starting to add some description to configuration
1 parent aed6c98 commit 74871e1

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

src/murfey/cli/generate_config.py

Whitespace-only changes.

src/murfey/util/config.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from typing import Dict, List, Literal, Optional, Union
88

99
import yaml
10-
from pydantic import BaseModel, BaseSettings
10+
from pydantic import BaseModel, BaseSettings, Field
1111

1212

1313
class MachineConfig(BaseModel):
@@ -16,25 +16,48 @@ class MachineConfig(BaseModel):
1616
data_directories: Dict[Path, str]
1717
rsync_basepath: Path
1818
default_model: Path
19-
display_name: str = ""
20-
instrument_name: str = ""
21-
image_path: Optional[Path] = None
19+
display_name: str = Field(
20+
default="",
21+
description="Name of instrument used for display purposes, i.e. Krios I",
22+
)
23+
instrument_name: str = Field(
24+
default="",
25+
description="Computer friendly instrument reference name, i.e. m02. Must not contain special characters or whitespace",
26+
)
27+
image_path: Optional[Path] = Field(
28+
default=None,
29+
description="Path to an image of the instrument for display purposes",
30+
)
2231
software_versions: Dict[str, str] = {}
2332
external_executables: Dict[str, str] = {}
2433
external_executables_eer: Dict[str, str] = {}
2534
external_environment: Dict[str, str] = {}
2635
rsync_module: str = ""
27-
create_directories: Dict[str, str] = {"atlas": "atlas"}
36+
create_directories: Dict[str, str] = Field(
37+
default={"atlas": "atlas"},
38+
description="Directories to be created within each visit",
39+
)
2840
analyse_created_directories: List[str] = []
2941
gain_reference_directory: Optional[Path] = None
3042
eer_fractionation_file_template: str = ""
43+
gain_reference_directory: Optional[Path] = Field(
44+
default=None,
45+
description="Directory in which the gain reference is written from the detector",
46+
)
3147
processed_directory_name: str = "processed"
3248
gain_directory_name: str = "processing"
3349
node_creator_queue: str = "node_creator"
34-
superres: bool = False
35-
camera: str = "FALCON"
50+
superres: bool = Field(
51+
default=False, description="Is the detector on this instrument a GATAN K3?"
52+
)
53+
camera: Literal["FALCON", "K3", ""] = Field(
54+
default="FALCON",
55+
description="What camera is the instrument equipped with? Only relevant for TEM instruments. Use the option closest to your case. This is used to determine whether the gain reference needs to be binned down from superres",
56+
)
3657
data_required_substrings: Dict[str, Dict[str, List[str]]] = {}
37-
allow_removal: bool = False
58+
allow_removal: bool = Field(
59+
default=False, description="Allow original files to be removed after rsync"
60+
)
3861
modular_spa: bool = False
3962
data_transfer_enabled: bool = True
4063
processing_enabled: bool = True

0 commit comments

Comments
 (0)