bittensor.core.config#

Implementation of the config class, which manages the configuration of different Bittensor modules.

Example

import argparse import bittensor as bt

parser = argparse.ArgumentParser(‘Miner’) bt.Axon.add_args(parser) bt.Subtensor.add_args(parser) bt.Async_subtensor.add_args(parser) bt.Wallet.add_args(parser) bt.logging.add_args(parser) bt.PriorityThreadPoolExecutor.add_args(parser) config = bt.config(parser)

print(config)

Attributes#

T

Exceptions#

InvalidConfigFile

Raised when there's an error loading the config file.

Classes#

Config

Manages configuration for Bittensor modules with nested namespace support.

DefaultConfig

A Config with a set of default values.

Module Contents#

class bittensor.core.config.Config(parser=None, args=None, strict=False, default=None)#

Bases: munch.DefaultMunch

Manages configuration for Bittensor modules with nested namespace support.

Construct a new DefaultMunch. Like collections.defaultdict, the first argument is the default value; subsequent arguments are the same as those for dict.

Parameters:
is_set(param_name)#

Checks if a parameter was explicitly set.

Parameters:

param_name (str)

Return type:

bool

merge(other)#

Merges another Config into this one.

Parameters:

other (Config)

Return type:

None

to_dict()#

Returns the configuration as a dictionary.

Return type:

dict

class bittensor.core.config.DefaultConfig(parser=None, args=None, strict=False, default=None)#

Bases: Config

A Config with a set of default values.

Construct a new DefaultMunch. Like collections.defaultdict, the first argument is the default value; subsequent arguments are the same as those for dict.

Parameters:
classmethod default()#
Abstractmethod:

Return type:

T

Get default config.

exception bittensor.core.config.InvalidConfigFile#

Bases: Exception

Raised when there’s an error loading the config file.

Initialize self. See help(type(self)) for accurate signature.

bittensor.core.config.T#