Coverage for fiqus/data/DataSettings.py: 100%
23 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-12-27 02:39 +0100
« prev ^ index » next coverage.py v7.4.4, created at 2024-12-27 02:39 +0100
1from typing import Literal, Optional
3from pydantic import BaseModel, Field
6class Condor(BaseModel):
7 """
8 Class for running using HTCondor queuing (only on Linux)
9 """
11 error: Optional[str] = Field(
12 default=None,
13 title="error",
14 description="Error file name and extension, like error.txt",
15 )
16 output: Optional[str] = Field(
17 default=None,
18 title="output",
19 description="Output file name and extension, like output.txt",
20 )
21 log: Optional[str] = Field(
22 default=None,
23 title="log",
24 description="Log file name and extension, like log.txt",
25 )
26 request_cpus: Optional[int] = Field(
27 default=None,
28 title="request_cpus",
29 description="Number of CPUs to request on each machine",
30 )
31 request_memory: Optional[str] = Field(
32 default=None,
33 title="request_memory",
34 description="Amount of memory to request on each machine as a string (e.g., '16G')",
35 )
36 request_disk: Optional[str] = Field(
37 default=None,
38 title="request_disk",
39 description="Amount of disk space to request on each machine as a string (e.g., '16G')",
40 )
41 singularity_image_path: Optional[str] = Field(
42 default=None,
43 title="SingularityImagePath",
44 description="Full path to Singularity image",
45 )
46 cerngetdp_version: Optional[str] = Field(
47 default=None,
48 title="CERNGetDP Version",
49 description="Version of CERNGetDP to be used",
50 )
51 should_transfer_files: Literal["YES", "NO"] = Field(
52 default="YES",
53 title="should_transfer_files",
54 description="Sets if files should be transferred",
55 )
56 max_run_time: Optional[int] = Field(
57 default=None,
58 title="MaxRuntime",
59 description=(
60 "Specifies maximum run time in seconds to request for the job to go into"
61 " the queue"
62 ),
63 )
64 eos_relative_output_path: Optional[str] = Field(
65 default=None,
66 title="eos_relative_output_path",
67 description=(
68 "This is relative path in the user eos folder. This path gets appended to"
69 " the root path: root://eosuser.cern.ch//eos/user/u/username"
70 ),
71 )
72 big_mem_job: Optional[bool] = Field(
73 default=None,
74 title="BigMemJob",
75 description=(
76 "If true a machine with 1TB of RAM and 24 cores is requested. Expect longer"
77 " queuing time"
78 ),
79 )
81class Subproc(BaseModel):
82 """
83 Class for running using subprocess calls (on Windows)
84 """
86 executable: Optional[str] = Field(
87 default=None,
88 title="executable",
89 description="Executable or script to run, like run_fiqus.py",
90 )
91 full_output_path: Optional[str] = Field(
92 default=None,
93 title="full_output_path",
94 description="A full path to the output folder",
95 )
98class DataSettings(BaseModel):
99 """
100 Configuration for HTCondor and
101 """
103 GetDP_path: Optional[str] = Field(
104 default=None,
105 title="GetDP_path",
106 description=(
107 "Full path to GetDP executable. This is only needed and used on Windows"
108 ),
109 )
111 base_path_model_files: Optional[str] = Field(
112 default=None,
113 title="base_path_model_files",
114 description=(
115 "Path to the base model folder where model files are stored that are needed to run FiQuS."
116 "This is only needed when the files are not in the same folder as the input yaml (e.g., on HTCondor)"
117 )
118 )
120 htcondor: Condor = Condor()
121 subproc: Subproc = Subproc()