thoth.common.config package

Submodules

thoth.common.config.base module

A base class for configuration entries.

class thoth.common.config.base.ConfigEntryBase[source]

Bases: object

A base class for configuration entries.

classmethod from_dict(dict_: Dict[str, str]) → thoth.common.config.base.ConfigEntryBase[source]

Instantiate hardware related information from its dictionary representation.

to_dict(without_none: bool = False) → Dict[str, Union[str, int, None]][source]

Convert runtime environment object representation to a dict.

thoth.common.config.hardware_information module

Representation of hardware available with serialization/deserialization methods.

class thoth.common.config.hardware_information.HardwareInformation(cpu_family: int = None, cpu_model: int = None)[source]

Bases: thoth.common.config.base.ConfigEntryBase

Representation for hardware related information.

cpu_family
cpu_model

thoth.common.config.operating_system module

Representation of operating system available with serialization/deserialization methods.

class thoth.common.config.operating_system.OperatingSystem(name: str = None, version: str = None)[source]

Bases: thoth.common.config.base.ConfigEntryBase

Representation for hardware related information.

name
version

thoth.common.config.runtime_environment module

Representation of runtime environment entry collapsing hardware, runtime and other information.

class thoth.common.config.runtime_environment.RuntimeEnvironment(hardware: thoth.common.config.hardware_information.HardwareInformation, operating_system: thoth.common.config.operating_system.OperatingSystem, python_version: str = None, cuda_version: str = None, name: str = None, fully_specified: Optional[bool] = None)[source]

Bases: object

An entry collapsing configuration options in the user configuration file.

cuda_version
classmethod from_dict(dict_: Optional[Dict[Any, Any]] = None) → thoth.common.config.runtime_environment.RuntimeEnvironment[source]

Parse one configuration entry from a dictionary.

hardware
is_fully_specified() → bool[source]

Pre-cache check if the given runtime environment is fully specified.

classmethod load(content: Optional[str] = None) → thoth.common.config.runtime_environment.RuntimeEnvironment[source]

Load runtime environment information from file or from a JSON representation, transparently.

name
operating_system
python_version
to_dict(without_none: bool = False) → Dict[str, Any][source]

Convert runtime environment configuration to a dict representation.

to_string() → str[source]

Convert runtime environment configuration to a string representation.

Module contents

Representation of configuration entries in Thoth.

class thoth.common.config.HardwareInformation(cpu_family: int = None, cpu_model: int = None)[source]

Bases: thoth.common.config.base.ConfigEntryBase

Representation for hardware related information.

cpu_family
cpu_model
class thoth.common.config.OperatingSystem(name: str = None, version: str = None)[source]

Bases: thoth.common.config.base.ConfigEntryBase

Representation for hardware related information.

name
version
class thoth.common.config.RuntimeEnvironment(hardware: thoth.common.config.hardware_information.HardwareInformation, operating_system: thoth.common.config.operating_system.OperatingSystem, python_version: str = None, cuda_version: str = None, name: str = None, fully_specified: Optional[bool] = None)[source]

Bases: object

An entry collapsing configuration options in the user configuration file.

cuda_version
classmethod from_dict(dict_: Optional[Dict[Any, Any]] = None) → thoth.common.config.runtime_environment.RuntimeEnvironment[source]

Parse one configuration entry from a dictionary.

hardware
is_fully_specified() → bool[source]

Pre-cache check if the given runtime environment is fully specified.

classmethod load(content: Optional[str] = None) → thoth.common.config.runtime_environment.RuntimeEnvironment[source]

Load runtime environment information from file or from a JSON representation, transparently.

name
operating_system
python_version
to_dict(without_none: bool = False) → Dict[str, Any][source]

Convert runtime environment configuration to a dict representation.

to_string() → str[source]

Convert runtime environment configuration to a string representation.