5.1.1.3. FedEval.config

5.1.1.3.1. Submodules

5.1.1.3.2. Package Contents

5.1.1.3.2.1. Classes

ClientConfigurationManagerInterface

an interface of ConfigurationManager from the client side,

ConfigurationManager

the base class of singletons.

ConfigurationManagerInterface

Helper class that provides a standard way to create an ABC using

ServerConfigurationManagerInterface

an interface of ConfigurationManager from the central server side,

ServerFlaskInterface

Generic enumeration.

Role

Generic enumeration.

5.1.1.3.2.2. Attributes

DEFAULT_D_CFG_FILENAME_YAML

DEFAULT_MDL_CFG_FILENAME_YAML

DEFAULT_RT_CFG_FILENAME_YAML

RawConfigurationDict

ClientId

FedEval.config.DEFAULT_D_CFG_FILENAME_YAML = '1_data_config.yml'
FedEval.config.DEFAULT_MDL_CFG_FILENAME_YAML = '2_model_config.yml'
FedEval.config.DEFAULT_RT_CFG_FILENAME_YAML = '3_runtime_config.yml'
class FedEval.config.ClientConfigurationManagerInterface[source]

Bases: abc.ABC

an interface of ConfigurationManager from the client side, regulating the essential functions as clients.

Raises:

NotImplementedError – called without implementation.

class FedEval.config.ConfigurationManager(data_config: RawConfigurationDict = _DEFAULT_D_CFG, model_config: RawConfigurationDict = _DEFAULT_MDL_CFG, runtime_config: RawConfigurationDict = _DEFAULT_RT_CFG, thread_safe: bool = False)[source]

Bases: FedEval.config.singleton.Singleton, ConfigurationManagerInterface, ClientConfigurationManagerInterface, ServerConfigurationManagerInterface, _CfgYamlInterface, _CfgJsonInterface, _CfgFileInterface, _RoledConfigurationInterface

the base class of singletons. Each cls on the inheritance tree can own only one instance.

property data_unique_id
property config_unique_id
property data_dir_name: str

The output directory of the clients’ data.

Returns:

the name of the data directory.

Return type:

str

property log_dir_path: str

the path of the base of log directory.

property history_record_path: str

the path of the history record.

property job_id: str
property encoding: str

the encoding scheme during (de)serialization.

property data_config_filename: str
property model_config_filename: str
property runtime_config_filename: str
property data_config: _DataConfig
property model_config: _ModelConfig
property runtime_config: _RuntimeConfig
property num_of_train_clients_contacted_per_round: int

the number of clients selected to participate the main federated process in each round.

property num_of_eval_clients_contacted_per_round: int

the number of clients selected to participate the main federated process in each round.

property role: FedEval.config.role.Role

return the role of this runtime entity.

Raises:

AttributeError – called without role configured.

Returns:

the role of this runtime entity.

Return type:

Role

__init_once_lock
__initiated = False
_init_file_names(data_config_filename: str = DEFAULT_D_CFG_FILENAME_YAML, model_config_filename: str = DEFAULT_MDL_CFG_FILENAME_YAML, runtime_config_filename: str = DEFAULT_RT_CFG_FILENAME_YAML) None[source]
classmethod generate_unique_id(data_config: dict, model_config: dict, runtime_config: dict)[source]
static _get_md5(config_string)[source]
static load_configs(src_path, serializer: str | _CfgSerializer = _CfgSerializer.YAML, data_config_filename: str = DEFAULT_D_CFG_FILENAME_YAML, model_config_filename: str = DEFAULT_MDL_CFG_FILENAME_YAML, runtime_config_filename: str = DEFAULT_RT_CFG_FILENAME_YAML, encoding=_DEFAULT_ENCODING) Tuple[RawConfigurationDict, RawConfigurationDict, RawConfigurationDict][source]
static save_configs(data_cfg: RawConfigurationDict, model_cfg: RawConfigurationDict, runtime_cfg: RawConfigurationDict, dst_path, data_config_filename: str = DEFAULT_D_CFG_FILENAME_YAML, model_config_filename: str = DEFAULT_MDL_CFG_FILENAME_YAML, runtime_config_filename: str = DEFAULT_RT_CFG_FILENAME_YAML, encoding=_DEFAULT_ENCODING, serializer: str | _CfgSerializer = _CfgSerializer.YAML)[source]
static from_files(src_path: str, data_config_filename: str = DEFAULT_D_CFG_FILENAME_YAML, model_config_filename: str = DEFAULT_MDL_CFG_FILENAME_YAML, runtime_config_filename: str = DEFAULT_RT_CFG_FILENAME_YAML, serializer: str | _CfgSerializer = _CfgSerializer.YAML, encoding=_DEFAULT_ENCODING)[source]
to_files(dst_dir_path: str, serializer: str | _CfgSerializer = _CfgSerializer.YAML, encoding: str | None = None) None[source]
__init_role() None
class FedEval.config.ConfigurationManagerInterface[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract property data_config_filename: str
abstract property model_config_filename: str
abstract property runtime_config_filename: str
abstract property data_config: RawConfigurationDict
abstract property model_config: _ModelConfig
abstract property runtime_config: RawConfigurationDict
abstract property job_id
FedEval.config.RawConfigurationDict
class FedEval.config.ServerConfigurationManagerInterface[source]

Bases: abc.ABC

an interface of ConfigurationManager from the central server side, regulating the essential functions as clients.

Raises:

NotImplementedError – called without implementation.

abstract property num_of_train_clients_contacted_per_round: int
class FedEval.config.ServerFlaskInterface[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

Dashboard = '/dashboard'
Status = '/status'
DownloadPattern = '/download/{}'
class FedEval.config.Role[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

Server = 'server'
Client = 'client'
FedEval.config.ClientId