Skip to content

Commit c6d08c9

Browse files
edit docstrings
1 parent dacb11e commit c6d08c9

File tree

1 file changed

+55
-55
lines changed

1 file changed

+55
-55
lines changed

bittensor/core/async_subtensor.py

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ async def get_delegate_take(
17851785
percentage of rewards that the delegate claims from its nominators' stakes.
17861786
17871787
Arguments:
1788-
hotkey_ss58: The `SS58` address of the neuron's hotkey.
1788+
hotkey_ss58: The ``SS58`` address of the neuron's hotkey.
17891789
block: The blockchain block number for the query.
17901790
block_hash: The hash of the block to retrieve the subnet unique identifiers from.
17911791
reuse_block: Whether to reuse the last-used block hash.
@@ -2091,7 +2091,7 @@ async def get_netuids_for_hotkey(
20912091
specific subnets within the Bittensor network where the neuron associated with the hotkey is active.
20922092
20932093
Arguments:
2094-
hotkey_ss58: The `SS58` address of the neuron's hotkey.
2094+
hotkey_ss58: The ``SS58`` address of the neuron's hotkey.
20952095
block: The blockchain block number for the query.
20962096
block_hash: The hash of the blockchain block number at which to perform the query.
20972097
reuse_block: Whether to reuse the last-used block hash when retrieving info.
@@ -3107,7 +3107,7 @@ async def get_uid_for_hotkey_on_subnet(
31073107
Retrieves the unique identifier (UID) for a neuron's hotkey on a specific subnet.
31083108
31093109
Arguments:
3110-
hotkey_ss58: The `SS58` address of the neuron's hotkey.
3110+
hotkey_ss58: The ``SS58`` address of the neuron's hotkey.
31113111
netuid: The unique identifier of the subnet.
31123112
block: The blockchain block number for the query.
31133113
block_hash: The blockchain block_hash representation of the block id.
@@ -3307,7 +3307,7 @@ async def is_hotkey_registered_any(
33073307
Checks if a neuron's hotkey is registered on any subnet within the Bittensor network.
33083308
33093309
Arguments:
3310-
hotkey_ss58: The `SS58` address of the neuron's hotkey.
3310+
hotkey_ss58: The ``SS58`` address of the neuron's hotkey.
33113311
block: The blockchain block number for the query.
33123312
block_hash: The blockchain block_hash representation of block id.
33133313
reuse_block: Whether to reuse the last-used block hash.
@@ -3358,9 +3358,9 @@ async def is_subnet_active(
33583358
reuse_block: Whether to reuse the last-used block hash.
33593359
33603360
Returns:
3361-
`True` if subnet is active, `False` otherwise.
3361+
``True`` if subnet is active, ``False`` otherwise.
33623362
3363-
This means whether the `start_call` was initiated or not.
3363+
Note: This means whether the ``start_call`` was initiated or not.
33643364
"""
33653365
query = await self.query_subtensor(
33663366
name="FirstEmissionBlockNumber",
@@ -3400,7 +3400,7 @@ async def max_weight_limit(
34003400
reuse_block: Whether to reuse the last-used block hash.
34013401
34023402
Returns:
3403-
Optional[float]: The value of the MaxWeightsLimit hyperparameter, or `None` if the subnetwork does not
3403+
Optional[float]: The value of the MaxWeightsLimit hyperparameter, or ``None`` if the subnetwork does not
34043404
exist or the parameter is not found.
34053405
"""
34063406
block_hash = await self.determine_block_hash(block, block_hash, reuse_block)
@@ -3422,7 +3422,7 @@ async def metagraph(
34223422
Arguments:
34233423
netuid: The network UID of the subnet to query.
34243424
lite: If true, returns a metagraph using a lightweight sync (no weights, no bonds). Default is
3425-
`True`.
3425+
``True``.
34263426
block: Block number for synchronization, or `None` for the latest block.
34273427
34283428
Returns:
@@ -3460,7 +3460,7 @@ async def min_allowed_weights(
34603460
reuse_block: Whether to reuse the last-used block hash.
34613461
34623462
Returns:
3463-
Optional[int]: The value of the MinAllowedWeights hyperparameter, or `None` if the subnetwork does not
3463+
Optional[int]: The value of the MinAllowedWeights hyperparameter, or ``None`` if the subnetwork does not
34643464
exist or the parameter is not found.
34653465
"""
34663466
block_hash = await self.determine_block_hash(block, block_hash, reuse_block)
@@ -3611,13 +3611,13 @@ async def query_identity(
36113611
reuse_block: Whether to reuse the last-used blockchain block hash.
36123612
36133613
Returns:
3614-
An object containing the identity information of the neuron if found, `None` otherwise.
3614+
An object containing the identity information of the neuron if found, ``None`` otherwise.
36153615
36163616
The identity information can include various attributes such as the neuron's stake, rank, and other
36173617
network-specific details, providing insights into the neuron's role and status within the Bittensor network.
36183618
36193619
Note:
3620-
See the `Bittensor CLI documentation <https://docs.bittensor.com/reference/btcli>`_ for supported identity
3620+
See the ``Bittensor CLI documentation <https://docs.bittensor.com/reference/btcli>``_ for supported identity
36213621
parameters.
36223622
"""
36233623
block_hash = await self.determine_block_hash(block, block_hash, reuse_block)
@@ -3657,7 +3657,7 @@ async def recycle(
36573657
reuse_block: Whether to reuse the last-used blockchain block hash.
36583658
36593659
Returns:
3660-
Optional[Balance]: The value of the 'Burn' hyperparameter if the subnet exists, None otherwise.
3660+
Optional[Balance]: The value of the 'Burn' hyperparameter if the subnet exists, ``None`` otherwise.
36613661
36623662
Understanding the 'Burn' rate is essential for analyzing the network registration usage, particularly how it is
36633663
correlated with user activity and the overall cost of participation in a given subnet.
@@ -3688,14 +3688,14 @@ async def set_reveal_commitment(
36883688
netuid: The unique identifier of the subnetwork.
36893689
data: The data to be committed to the network.
36903690
blocks_until_reveal: The number of blocks from now after which the data will be revealed.
3691-
Defaults to `360` (the number of blocks in one epoch).
3692-
block_time: The number of seconds between each block. Defaults to `12`.
3691+
Defaults to ``360`` (the number of blocks in one epoch).
3692+
block_time: The number of seconds between each block. Defaults to ``12``.
36933693
period: The number of blocks during which the transaction will remain valid after it's
36943694
submitted. If the transaction is not included in a block within that number of blocks, it will expire
36953695
and be rejected. You can think of it as an expiration date for the transaction.
36963696
36973697
Returns:
3698-
bool: `True` if the commitment was successful, `False` otherwise.
3698+
bool: ``True`` if the commitment was successful, ``False`` otherwise.
36993699
37003700
Note: A commitment can be set once per subnet epoch and is reset at the next epoch in the chain automatically.
37013701
"""
@@ -3769,7 +3769,7 @@ async def subnet_exists(
37693769
reuse_block: Whether to reuse the last-used block hash.
37703770
37713771
Returns:
3772-
`True` if the subnet exists, `False` otherwise.
3772+
``True`` if the subnet exists, ``False`` otherwise.
37733773
37743774
This function is critical for verifying the presence of specific subnets in the network,
37753775
enabling a deeper understanding of the network's structure and composition.
@@ -3801,7 +3801,7 @@ async def subnetwork_n(
38013801
reuse_block: Whether to reuse the last-used block hash.
38023802
38033803
Returns:
3804-
Optional[int]: The value of the SubnetworkN hyperparameter, or `None` if the subnetwork does not exist or
3804+
Optional[int]: The value of the SubnetworkN hyperparameter, or ``None`` if the subnetwork does not exist or
38053805
the parameter is not found.
38063806
"""
38073807
block_hash = await self.determine_block_hash(block, block_hash, reuse_block)
@@ -3830,7 +3830,7 @@ async def tempo(
38303830
reuse_block: Whether to reuse the last-used block hash.
38313831
38323832
Returns:
3833-
Optional[int]: The value of the Tempo hyperparameter, or `None` if the subnetwork does not exist or the
3833+
Optional[int]: The value of the Tempo hyperparameter, or ``None`` if the subnetwork does not exist or the
38343834
parameter is not found.
38353835
"""
38363836
block_hash = await self.determine_block_hash(block, block_hash, reuse_block)
@@ -3858,7 +3858,7 @@ async def tx_rate_limit(
38583858
reuse_block: Whether to reuse the last-used block hash.
38593859
38603860
Returns:
3861-
Optional[int]: The transaction rate limit of the network, None if not available.
3861+
Optional[int]: The transaction rate limit of the network, ``None`` if not available.
38623862
38633863
The transaction rate limit is an essential parameter for ensuring the stability and scalability of the Bittensor
38643864
network. It helps in managing network load and preventing congestion, thereby maintaining efficient and
@@ -3876,10 +3876,10 @@ async def wait_for_block(self, block: Optional[int] = None):
38763876
waits for the next block.
38773877
38783878
Arguments:
3879-
block: The block number to wait for. If None, waits for the next block.
3879+
block: The block number to wait for. If ``None``, waits for the next block.
38803880
38813881
Returns:
3882-
bool: True if the target block was reached, False if timeout occurred.
3882+
bool: ``True`` if the target block was reached, ``False`` if timeout occurred.
38833883
38843884
Example:
38853885
import bittensor as bt
@@ -3966,7 +3966,7 @@ async def weights_rate_limit(
39663966
reuse_block: Whether to reuse the last-used blockchain block hash.
39673967
39683968
Returns:
3969-
Optional[int]: The value of the WeightsSetRateLimit hyperparameter, or `None` if the subnetwork does not
3969+
Optional[int]: The value of the WeightsSetRateLimit hyperparameter, or ``None`` if the subnetwork does not
39703970
exist or the parameter is not found.
39713971
"""
39723972
block_hash = await self.determine_block_hash(block, block_hash, reuse_block)
@@ -4076,7 +4076,7 @@ async def sign_and_send_extrinsic(
40764076
and be rejected. You can think of it as an expiration date for the transaction.
40774077
nonce_key: the type on nonce to use. Options are "hotkey" or "coldkey".
40784078
nonce_key: the type on nonce to use. Options are "hotkey", "coldkey", or "coldkeypub".
4079-
raise_error: raises a relevant exception rather than returning `False` if unsuccessful.
4079+
raise_error: raises a relevant exception rather than returning ``False`` if unsuccessful.
40804080
40814081
Returns:
40824082
(success, error message)
@@ -4153,24 +4153,24 @@ async def add_stake(
41534153
Arguments:
41544154
wallet: The wallet to be used for staking.
41554155
hotkey_ss58: The SS58 address of the hotkey associated with the neuron to which you intend to delegate your
4156-
stake. If not specified, the wallet's hotkey will be used. Defaults to `None`.
4156+
stake. If not specified, the wallet's hotkey will be used. Defaults to ``None``.
41574157
netuid: The unique identifier of the subnet to which the neuron belongs.
41584158
amount: The amount of TAO to stake.
41594159
wait_for_inclusion: Waits for the transaction to be included in a block. Defaults to `True`.
41604160
wait_for_finalization: Waits for the transaction to be finalized on the blockchain. Defaults to `False`.
41614161
safe_staking: If true, enables price safety checks to protect against fluctuating prices. The stake will
4162-
only execute if the price change doesn't exceed the rate tolerance. Default is `False`.
4162+
only execute if the price change doesn't exceed the rate tolerance. Default is ``False``.
41634163
allow_partial_stake: If true and safe_staking is enabled, allows partial staking when the full amount would
41644164
exceed the price tolerance. If false, the entire stake fails if it would exceed the tolerance.
4165-
Default is `False`.
4165+
Default is ``False``.
41664166
rate_tolerance: The maximum allowed price change ratio when staking. For example,
41674167
0.005 = 0.5% maximum price increase. Only used when safe_staking is True. Default is ``0.005``.
41684168
period: The number of blocks during which the transaction will remain valid after it's submitted. If the
41694169
transaction is not included in a block within that number of blocks, it will expire and be rejected. You
4170-
can think of it as an expiration date for the transaction. Defaults to `None`.
4170+
can think of it as an expiration date for the transaction. Defaults to ``None``.
41714171
41724172
Returns:
4173-
bool: `True` if the staking is successful, False otherwise.
4173+
bool: ``True`` if the staking is successful, ``False`` otherwise.
41744174
41754175
This function enables neurons to increase their stake in the network, enhancing their influence and potential.
41764176
When safe_staking is enabled, it provides protection against price fluctuations during the time stake is
@@ -4225,7 +4225,7 @@ async def add_liquidity(
42254225
- True and a success message if the extrinsic is successfully submitted or processed.
42264226
- False and an error message if the submission fails or the wallet cannot be unlocked.
42274227
4228-
Note: Adding is allowed even when user liquidity is enabled in specified subnet. Call `toggle_user_liquidity`
4228+
Note: Adding is allowed even when user liquidity is enabled in specified subnet. Call ``toggle_user_liquidity``
42294229
method to enable/disable user liquidity.
42304230
"""
42314231
return await add_liquidity_extrinsic(
@@ -4256,14 +4256,14 @@ async def add_stake_multiple(
42564256
42574257
Arguments:
42584258
wallet: The wallet used for staking.
4259-
hotkey_ss58s: List of `SS58` addresses of hotkeys to stake to.
4259+
hotkey_ss58s: List of ``SS58`` addresses of hotkeys to stake to.
42604260
netui: list of subnet UIDs
42614261
amounts: Corresponding amounts of TAO to stake for each hotkey.
42624262
wait_for_inclusion: Waits for the transaction to be included in a block. Defaults to `True`.
42634263
wait_for_finalization: Waits for the transaction to be finalized on the blockchain. Defaults to `False`.
42644264
42654265
Returns:
4266-
bool: `True` if the staking is successful for all specified neurons, False otherwise.
4266+
bool: ``True`` if the staking is successful for all specified neurons, ``False`` otherwise.
42674267
42684268
This function is essential for managing stakes across multiple neurons, reflecting the dynamic and collaborative
42694269
nature of the Bittensor network.
@@ -4294,7 +4294,7 @@ async def burned_register(
42944294
wallet: The wallet associated with the neuron to be registered.
42954295
netuid: The unique identifier of the subnet.
42964296
wait_for_inclusion: Waits for the transaction to be included in a block. Defaults to
4297-
`False`.
4297+
``False``.
42984298
wait_for_finalization: Waits for the transaction to be finalized on the blockchain.
42994299
period: The number of blocks during which the transaction will remain valid after it's
43004300
submitted. If the transaction is not included in a block within that number of blocks, it will expire
@@ -4911,11 +4911,11 @@ async def set_delegate_take(
49114911
49124912
Arguments:
49134913
wallet: bittensor wallet instance.
4914-
hotkey_ss58: The `SS58` address of the neuron's hotkey.
4914+
hotkey_ss58: The ``SS58`` address of the neuron's hotkey.
49154915
take: Percentage reward for the delegate.
49164916
wait_for_inclusion: Waits for the transaction to be included in a block.
49174917
wait_for_finalization: Waits for the transaction to be finalized on_error: Raises a relevant exception
4918-
rather than returning `False` if unsuccessful.
4918+
rather than returning ``False`` if unsuccessful.
49194919
period: The number of blocks during which the transaction will remain valid after it's
49204920
submitted. If the transaction is not included in a block within that number of blocks, it will expire
49214921
and be rejected. You can think of it as an expiration date for the transaction.
@@ -5568,27 +5568,27 @@ async def unstake_multiple(
55685568
unstake_all: bool = False,
55695569
) -> bool:
55705570
"""
5571-
Performs batch unstaking from multiple hotkey accounts, allowing a neuron to reduce its staked amounts
5572-
efficiently. This function is useful for managing the distribution of stakes across multiple neurons.
5573-
5574-
Arguments:
5575-
wallet: The wallet linked to the coldkey from which the stakes are being
5576-
withdrawn.
5577-
hotkey_ss58s: A list of hotkey `SS58` addresses to unstake from.
5578-
netuids: Subnets unique IDs.
5579-
amounts: The amounts of TAO to unstake from each hotkey. If not provided, unstakes all.
5580-
wait_for_inclusion: Waits for the transaction to be included in a block.
5581-
wait_for_finalization: Waits for the transaction to be finalized on the blockchain.
5582-
period: The number of blocks during which the transaction will remain valid after it's
5583-
submitted. If the transaction is not included in a block within that number of blocks, it will expire
5584-
and be rejected. You can think of it as an expiration date for the transaction.
5585-
unstake_all: If true, unstakes all tokens. Default is `False`. If `True` amounts are ignored.
5586-
5587-
Returns:
5588-
bool: `True` if the batch unstaking is successful, False otherwise.
5589-
5590-
This function allows for strategic reallocation or withdrawal of stakes, aligning with the dynamic stake
5591-
management aspect of the Bittensor network.
5571+
Performs batch unstaking from multiple hotkey accounts, allowing a neuron to reduce its staked amounts
5572+
efficiently. This function is useful for managing the distribution of stakes across multiple neurons.
5573+
5574+
Arguments:
5575+
wallet: The wallet linked to the coldkey from which the stakes are being
5576+
withdrawn.
5577+
hotkey_ss58s: A list of hotkey `SS58` addresses to unstake from.
5578+
netuids: Subnets unique IDs.
5579+
amounts: The amounts of TAO to unstake from each hotkey. If not provided, unstakes all.
5580+
wait_for_inclusion: Waits for the transaction to be included in a block.
5581+
wait_for_finalization: Waits for the transaction to be finalized on the blockchain.
5582+
period: The number of blocks during which the transaction will remain valid after it's
5583+
submitted. If the transaction is not included in a block within that number of blocks, it will expire
5584+
and be rejected. You can think of it as an expiration date for the transaction.
5585+
unstake_all: If true, unstakes all tokens. Default is `False`. If `True` amounts are ignored.
5586+
5587+
Returns:
5588+
bool: `True` if the batch unstaking is successful, False otherwise.
5589+
5590+
This function allows for strategic reallocation or withdrawal of stakes, aligning with the dynamic stake
5591+
management aspect of the Bittensor network.
55925592
"""
55935593
return await unstake_multiple_extrinsic(
55945594
subtensor=self,

0 commit comments

Comments
 (0)