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#
Exceptions#
Raised when there's an error loading the config file. |
Classes#
Manages configuration for Bittensor modules with nested namespace support. |
|
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:
parser (argparse.ArgumentParser)
strict (bool)
default (Any)
- is_set(param_name)#
Checks if a parameter was explicitly set.
- 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:
parser (argparse.ArgumentParser)
strict (bool)
default (Any)
- 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#