xtl.config.settings module#

This module defines a set of Options Pydantic models that are used to configure various aspects of XTL. The main class that holds all settings is XTLSettings.

pydantic model xtl.config.settings.AutomatePermissionsSettings[source]#

Bases: Settings

Permission handling when using :mod:xtl.automate

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field directories: FilePermissions = FilePermissions(value='rwx------')#

Permissions octal for directories

Validated by:
  • _custom_validation

field files: FilePermissions = FilePermissions(value='rw-------')#

Permissions octal for files

Validated by:
  • _custom_validation

field update: bool = False#

Update permissions of the output files after execution of external jobs

Validated by:
  • _custom_validation

pydantic model xtl.config.settings.AutomateSettings[source]#

Bases: Settings

Settings for xtl.automate

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field compute_site: ComputeSite = ComputeSite.LOCAL#
Validated by:
  • _custom_validation

field permissions: AutomatePermissionsSettings = AutomatePermissionsSettings(update=False, files=FilePermissions(value='rw-------'), directories=FilePermissions(value='rwx------'))#
Validated by:
  • _custom_validation

pydantic model xtl.config.settings.CLIAutoprocSettings[source]#

Bases: Settings

Settings for xtl.autoproc CLI

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field collect_logs: bool = False#

Collect logs during xtl.autoproc runs

Validated by:
  • _custom_validation

field logs_dir: Path | None = None#

Directory for storing logs

Validated by:
  • _custom_validation

pydantic model xtl.config.settings.CLIConsoleFormatSettings[source]#

Bases: Settings

CLI console formatting settings

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field rich: bool = True#

Enable rich formatted output

Validated by:
  • _custom_validation

field striped_tables: bool = True#

Alternating row colors in tables

Validated by:
  • _custom_validation

pydantic model xtl.config.settings.CLISettings[source]#

Bases: Settings

Settings for CLI tools

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field autoproc: CLIAutoprocSettings = CLIAutoprocSettings(collect_logs=False, logs_dir=None)#
Validated by:
  • _custom_validation

field format: CLIConsoleFormatSettings = CLIConsoleFormatSettings(rich=True, striped_tables=True)#
Validated by:
  • _custom_validation

pydantic model xtl.config.settings.DependenciesSettings[source]#

Bases: Settings

Settings for external tools and dependencies

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field autoproc: DependencySettings = DependencySettings(path=None, modules=None)#
Validated by:
  • _custom_validation

pydantic model xtl.config.settings.DependencySettings[source]#

Bases: Settings

Generic external dependency settings

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field modules: list[str] | None = None#

Modules that provide the dependency

Validated by:
  • _custom_validation

field path: Path | None = None#

Directory containing binaries

Validated by:
  • _custom_validation

pydantic model xtl.config.settings.Settings[source]#

Bases: Options

Base class for settings in XTL.

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Validators:
  • _custom_validation » all fields

pydantic model xtl.config.settings.UnitsSettings[source]#

Bases: Settings

Physical units

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field temperature: str = 'C'#

C for Celsius, K for Kelvin, F for Fahrenheit

Validated by:
  • _custom_validation

pydantic model xtl.config.settings.XTLSettings[source]#

Bases: Settings

Settings for XTL

Config:
  • arbitrary_types_allowed: bool = True

  • validate_default: bool = True

  • validate_assignment: bool = True

  • use_enum_values: bool = True

  • extra: str = allow

Fields:
Validators:
  • _custom_validation » all fields

field automate: AutomateSettings = AutomateSettings(compute_site='local', permissions=AutomatePermissionsSettings(update=False, files=FilePermissions(value='rw-------'), directories=FilePermissions(value='rwx------')))#

Settings for the xtl.automate module

Validated by:
  • _custom_validation

field cli: CLISettings = CLISettings(format=CLIConsoleFormatSettings(rich=True, striped_tables=True), autoproc=CLIAutoprocSettings(collect_logs=False, logs_dir=None))#

Settings for CLI tools provided by XTL

Validated by:
  • _custom_validation

field dependencies: DependenciesSettings = DependenciesSettings(autoproc=DependencySettings(path=None, modules=None))#

Settings for external tools and dependencies used by XTL

Validated by:
  • _custom_validation

field units: UnitsSettings = UnitsSettings(temperature='C')#

Settings for physical units used in XTL

Validated by:
  • _custom_validation

field version: str = '0.1.0rc1'#

Version string of the XTL package

Validated by:
  • _custom_validation

classmethod initialize()[source]#

Initialize by reading an xtl.toml file. Determines whether to load a local or global configuration file, and initializes the settings accordingly. If neither file exists, it initializes with default values.

Once the settings are loaded, a version compatibility check is performed.

Returns:

An instance of XTLSettings

Return type:

XTLSettings

global_config: ClassVar[Path]#

Path to the global configuration file, typically located in the XTL installation directory.

local_config: ClassVar[Path]#

Path to the local configuration file, located in the current working directory.