bikes.settings

Define settings for the application.

 1"""Define settings for the application."""
 2
 3# %% IMPORTS
 4
 5import pydantic as pdt
 6import pydantic_settings as pdts
 7
 8from bikes import jobs
 9
10# %% SETTINGS
11
12
13class Settings(pdts.BaseSettings, strict=True, frozen=True, extra="forbid"):
14    """Base class for application settings.
15
16    Use settings to provide high-level preferences.
17    i.e., to separate settings from provider (e.g., CLI).
18    """
19
20
21class MainSettings(Settings):
22    """Main settings of the application.
23
24    Parameters:
25        job (jobs.JobKind): job to run.
26    """
27
28    job: jobs.JobKind = pdt.Field(..., discriminator="KIND")
class Settings(pydantic_settings.main.BaseSettings):
14class Settings(pdts.BaseSettings, strict=True, frozen=True, extra="forbid"):
15    """Base class for application settings.
16
17    Use settings to provide high-level preferences.
18    i.e., to separate settings from provider (e.g., CLI).
19    """

Base class for application settings.

Use settings to provide high-level preferences. i.e., to separate settings from provider (e.g., CLI).

model_config: ClassVar[pydantic_settings.main.SettingsConfigDict] = {'extra': 'forbid', 'arbitrary_types_allowed': True, 'validate_default': True, 'case_sensitive': False, 'env_prefix': '', 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_parse_none_str': None, 'env_parse_enums': None, 'cli_prog_name': None, 'cli_parse_args': None, 'cli_settings_source': None, 'cli_parse_none_str': None, 'cli_hide_none_type': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_use_class_docs_for_groups': False, 'cli_prefix': '', 'json_file': None, 'json_file_encoding': None, 'yaml_file': None, 'yaml_file_encoding': None, 'toml_file': None, 'secrets_dir': None, 'protected_namespaces': ('model_', 'settings_'), 'strict': True, 'frozen': True}
model_fields = {}
model_computed_fields = {}
Inherited Members
pydantic_settings.main.BaseSettings
BaseSettings
settings_customise_sources
pydantic.main.BaseModel
model_extra
model_fields_set
model_construct
model_copy
model_dump
model_dump_json
model_json_schema
model_parametrized_name
model_post_init
model_rebuild
model_validate
model_validate_json
model_validate_strings
dict
json
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
class MainSettings(Settings):
22class MainSettings(Settings):
23    """Main settings of the application.
24
25    Parameters:
26        job (jobs.JobKind): job to run.
27    """
28
29    job: jobs.JobKind = pdt.Field(..., discriminator="KIND")

Main settings of the application.

Arguments:
  • job (jobs.JobKind): job to run.
model_config: ClassVar[pydantic_settings.main.SettingsConfigDict] = {'extra': 'forbid', 'arbitrary_types_allowed': True, 'validate_default': True, 'case_sensitive': False, 'env_prefix': '', 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_parse_none_str': None, 'env_parse_enums': None, 'cli_prog_name': None, 'cli_parse_args': None, 'cli_settings_source': None, 'cli_parse_none_str': None, 'cli_hide_none_type': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_use_class_docs_for_groups': False, 'cli_prefix': '', 'json_file': None, 'json_file_encoding': None, 'yaml_file': None, 'yaml_file_encoding': None, 'toml_file': None, 'secrets_dir': None, 'protected_namespaces': ('model_', 'settings_'), 'strict': True, 'frozen': True}
model_fields = {'job': FieldInfo(annotation=Union[TuningJob, TrainingJob, PromotionJob, InferenceJob, EvaluationsJob, ExplanationsJob], required=True, discriminator='KIND')}
model_computed_fields = {}
Inherited Members
pydantic_settings.main.BaseSettings
BaseSettings
settings_customise_sources
pydantic.main.BaseModel
model_extra
model_fields_set
model_construct
model_copy
model_dump
model_dump_json
model_json_schema
model_parametrized_name
model_post_init
model_rebuild
model_validate
model_validate_json
model_validate_strings
dict
json
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs