Skip to content

Commit f97cbfc

Browse files
camfairchildEugene-hu
authored andcommitted
Add raw spec for local test and new bins (#1243)
* add spec and new bins * fix config netuid * use dot get * check if config netuid is list * add start to mockstatus * add attr to mock neuron * add info to mock from neurons * change ordering of neuron dict to namespace * remove test for wandb for axon * use regex for looser match * fix blacklist metagraph mock * use real mock netuid * use mock network and netuid in constructor * fix patch * patch delegate check * use mock network and netuid * remove check for wallet hotkey * fix tests for subtensor init * dont set netuid for overview test * typo in docstring * add mock status stop * add low mock tx limit * oops typo * use dot get * add wait for final and incl args * use args during setup * update bins and use 100ms blocktime * pass block arg * remove bittensor.logging and a old test * use random port * backward fix * fix block time to 1s * compile no symb on linux * compile no symb mac * remove useless init on var * use dot get for new flags * update test durations * update test durations * use dot get for config * output error msg * mock to_default * remove to defaults in help * reduce neruons, remove flaky test * deactivate test * mvoe key pair tests out of the subtensor interface --------- Co-authored-by: Eugene <etesting007@gmail.com>
1 parent b5e83f6 commit f97cbfc

File tree

20 files changed

+3591
-675
lines changed

20 files changed

+3591
-675
lines changed

.test_durations

Lines changed: 438 additions & 0 deletions
Large diffs are not rendered by default.

bin/btcli

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,20 @@ if __name__ == '__main__':
2525
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2626
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2727
# DEALINGS IN THE SOFTWARE.
28+
<<<<<<< HEAD:bin/btcli
29+
=======
30+
31+
import bittensor
32+
import unittest
33+
34+
class TestWandb(unittest.TestCase):
35+
def test_dendrite(self):
36+
mock_wallet = bittensor.wallet( _mock = True )
37+
dendrite = bittensor.dendrite( wallet = mock_wallet)
38+
dendrite.to_wandb()
39+
del dendrite
40+
41+
def test_metagraph(self):
42+
metagraph = bittensor.metagraph( _mock= True )
43+
metagraph.to_wandb()
44+
>>>>>>> Add raw spec for local test and new bins (#1243):tests/unit_tests/bittensor_tests/test_wandb.py

bittensor/_cli/commands/delegates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def add_args( parser: argparse.ArgumentParser ):
523523

524524
@staticmethod
525525
def check_config( config: 'bittensor.Config' ):
526-
if not config.get( 'all', d=None ) and not config.is_set('wallet.name') and not config.no_prompt:
526+
if not config.get( 'all', d=None ) and config.wallet.get('name') == bittensor.defaults.wallet.name and not config.no_prompt:
527527
wallet_name = Prompt.ask("Enter wallet name", default = bittensor.defaults.wallet.name)
528528
config.wallet.name = str(wallet_name)
529529

bittensor/_cli/commands/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def run (cli):
149149

150150
@staticmethod
151151
def check_config( config: 'bittensor.Config' ):
152-
if not config.get( 'all', d=None ) and not config.is_set('wallet.name') and not config.no_prompt:
152+
if not config.get( 'all', d=None ) and config.wallet.get('name') == bittensor.defaults.wallet.name and not config.no_prompt:
153153
wallet_name = Prompt.ask("Enter wallet name", default = bittensor.defaults.wallet.name)
154154
config.wallet.name = str(wallet_name)
155155

bittensor/_cli/commands/overview.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def add_args( parser: argparse.ArgumentParser ):
333333

334334
@staticmethod
335335
def check_config( config: 'bittensor.Config' ):
336-
if not config.is_set('wallet.name') and not config.no_prompt and not config.get( 'all', d=None ):
336+
if config.wallet.get('name') == bittensor.defaults.wallet.name and not config.no_prompt and not config.get( 'all', d=None ):
337337
wallet_name = Prompt.ask("Enter wallet name", default = bittensor.defaults.wallet.name)
338338
config.wallet.name = str(wallet_name)
339339

@@ -342,3 +342,4 @@ def check_config( config: 'bittensor.Config' ):
342342
config.netuid = [int(config.netuid)]
343343
else:
344344
config.netuid = [int(netuid) for netuid in config.netuid]
345+

bittensor/_cli/commands/unstake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def check_config( cls, config: 'bittensor.Config' ):
3232
wallet_name = Prompt.ask("Enter wallet name", default = bittensor.defaults.wallet.name)
3333
config.wallet.name = str(wallet_name)
3434

35-
if not config.get( 'hotkey_ss58address', d=None ) and config.is_set('wallet.hotkey') and not config.no_prompt and not config.get('all_hotkeys') and not config.get('hotkeys'):
35+
if not config.get('hotkey_ss58address') and config.wallet.get('hotkey') == bittensor.defaults.wallet.hotkey and not config.no_prompt and not config.get('all_hotkeys') and not config.get('hotkeys'):
3636
hotkey = Prompt.ask("Enter hotkey name", default = bittensor.defaults.wallet.hotkey)
3737
config.wallet.hotkey = str(hotkey)
3838

bittensor/_cli/commands/wallets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def check_config( config: 'bittensor.Config' ):
4747
if not config.is_set('wallet.name') and not config.no_prompt:
4848
wallet_name = Prompt.ask("Enter wallet name", default = bittensor.defaults.wallet.name)
4949
config.wallet.name = str(wallet_name)
50+
5051
if config.mnemonic == None and config.get( 'seed', d=None ) == None and config.get( 'json', d=None ) == None:
5152
prompt_answer = Prompt.ask("Enter mnemonic, seed, or json file location")
5253
if prompt_answer.startswith("0x"):
@@ -211,6 +212,7 @@ def check_config( config: 'bittensor.Config' ):
211212
if not config.is_set('wallet.hotkey') and not config.no_prompt:
212213
hotkey = Prompt.ask("Enter hotkey name", default = bittensor.defaults.wallet.hotkey)
213214
config.wallet.hotkey = str(hotkey)
215+
214216
if config.mnemonic == None and config.get( 'seed', d=None ) == None and config.get( 'json', d=None ) == None:
215217
prompt_answer = Prompt.ask("Enter mnemonic, seed, or json file location")
216218
if prompt_answer.startswith("0x"):

0 commit comments

Comments
 (0)