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)
Exceptions#
Raised when there's an error loading the config file. |
Classes#
Manages configuration for Bittensor modules with nested namespace support. |
|
Dict with attribute-style access and a configurable default value. |
Module Contents#
- class bittensor.core.config.Config(parser=None, args=None, strict=False, default=DEFAULTS)#
Bases:
DefaultMunchManages configuration for Bittensor modules with nested namespace support.
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
parser (argparse.ArgumentParser)
strict (bool)
default (Any)
- is_set(param_name)#
Checks if a parameter was explicitly set.
- class bittensor.core.config.DefaultMunch(default=None, *args, **kwargs)#
Bases:
dictDict with attribute-style access and a configurable default value.
Drop-in replacement for munch.DefaultMunch using only the stdlib. The default value (returned for missing keys) is stored on the instance via
object.__setattr__so it never collides with dict entries.Initialize self. See help(type(self)) for accurate signature.
- classmethod fromDict(d, _default=None)#
Recursively creates a DefaultMunch from a plain dict.
- toDict()#
Recursively converts this object to a plain dict.