Skip to content

Commit

Permalink
apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Fairchild committed Oct 24, 2023
1 parent 1fe2c91 commit 506788e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions bittensor/commands/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,17 @@ def run(cli):
netuids = set()
for matrix in weights:
[uid, weights_data] = matrix

normalized_weights = np.array(weights_data)[:, 1] / np.sum(weights_data, axis=0)[1]

normalized_weights = (
np.array(weights_data)[:, 1] / np.sum(weights_data, axis=0)[1]
)
for weight_data, normalized_weight in zip(weights_data, normalized_weights):
[netuid, _] = weight_data
netuids.add(netuid)
if uid not in uid_to_weights:
uid_to_weights[uid] = {}

uid_to_weights[uid][netuid] = normalized_weight


for netuid in netuids:
table.add_column(
Expand All @@ -262,17 +263,13 @@ def run(cli):
for netuid in netuids:
if netuid in uid_weights:
normalized_weight = uid_weights[netuid]
row.append(
"{:0.2f}%".format(normalized_weight * 100)
)
row.append("{:0.2f}%".format(normalized_weight * 100))
else:
row.append("-")
table.add_row(*row)

table.show_footer = True



table.box = None
table.pad_edge = False
table.width = None
Expand Down

0 comments on commit 506788e

Please sign in to comment.