Skip to main content

config

source code

module core.types.config


source code

function validate_config_dict

validate_config_dict(
o: Any,
partial: bool = False,
skip_filepaths: bool = False
)None

Check, whether a given object is a correct ConfigDict Raises a pydantic.ValidationError if the object is invalid.

This should always be used when loading the object from a JSON file!


source code

class TimeDict

TypedDict:

{
hour: int;
minute: int;
second: int;
}

source code

class TimeDictPartial

TypedDict: like TimeDict, but all fields are optional.


source code

class ConfigSubDicts

Class that contains TypedDicts for sections of the config file.


source code

class ConfigDict

TypedDict:

{
general: {
version: "4.0.7";
seconds_per_core_interval: float;
test_mode: bool;
station_id: str;
min_sun_elevation: float;
},
opus: {
em27_ip: str;
executable_path: str;
experiment_path: str;
macro_path: str;
username: str;
password: str;
},
camtracker: {
config_path: str;
executable_path: str;
learn_az_elev_path: str;
sun_intensity_path: str;
motor_offset_threshold: float;
},
error_email: {
sender_address: str;
sender_password: str;
notify_recipients: bool;
recipients: str;
},
measurement_decision: {
mode: "automatic" | "manual" | "cli";
manual_decision_result: bool;
cli_decision_result: bool;
},
measurement_triggers: {
consider_time: bool;
consider_sun_elevation: bool;
consider_helios: bool;
start_time: {
hour: int;
minute: int;
second: int;
};
stop_time: {
hour: int;
minute: int;
second: int;
};
min_sun_elevation: float;
},
tum_plc: null | {
ip: str;
version: 1 | 2;
controlled_by_user: bool;
},
helios: null | {
camera_id: int;
evaluation_size: int;
seconds_per_interval: float;
edge_detection_threshold: float;
save_images: bool;
},
upload: null | {
host: str;
user: str;
password: str;
upload_ifgs: bool;
src_directory_ifgs: str;
dst_directory_ifgs: str;
remove_src_ifgs_after_upload: bool;
upload_helios: bool;
dst_directory_helios: str;
remove_src_helios_after_upload: bool;
},
}

Or expressed using ConfigSubDicts:

{
general: ConfigSubDicts.General;
opus: ConfigSubDicts.Opus;
camtracker: ConfigSubDicts.Camtracker;
error_email: ConfigSubDicts.ErrorEmail;
measurement_decision: ConfigSubDicts.MeasurementDecision;
measurement_triggers: ConfigSubDicts.MeasurementTriggers;
tum_plc: null | ConfigSubDicts.TumPlc;
helios: null | ConfigSubDicts.Helios;
upload: null | ConfigSubDicts.Upload;
}

source code

class ConfigDictPartial

TypedDict: like ConfigDict, but all fields are optional.


source code

class ValidationError

Will be raised in any custom checks on config dicts have failed: file-existence, ip-format, min/max-range