afght12 commited on
Commit
b2b4327
·
verified ·
1 Parent(s): 1562935

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -48,18 +48,34 @@ def make_query(client: CommuneClient) -> tuple[dict[int, int], dict[int, str]]:
48
  "SubspaceModule": [
49
  ("Name", [netuid]),
50
  ("Emission", []),
 
 
51
  ],
52
  }
53
  emission_dict: dict[int, int] = {}
54
  name_dict: dict[int, str] = {}
55
  result = client.query_batch_map(request_dict)
 
56
  emission = result["Emission"]
57
  netuid_emission = emission[netuid]
 
 
 
 
 
58
  names = result["Name"]
59
  highest_uid = max(names.keys())
60
  for uid in range(highest_uid + 1):
61
- emission_dict[uid] = netuid_emission[uid]
62
- name_dict[uid] = names[uid]
 
 
 
 
 
 
 
 
63
 
64
  return emission_dict, name_dict
65
 
 
48
  "SubspaceModule": [
49
  ("Name", [netuid]),
50
  ("Emission", []),
51
+ ("Incentive", []),
52
+ ("Dividends", []),
53
  ],
54
  }
55
  emission_dict: dict[int, int] = {}
56
  name_dict: dict[int, str] = {}
57
  result = client.query_batch_map(request_dict)
58
+
59
  emission = result["Emission"]
60
  netuid_emission = emission[netuid]
61
+ incentive = result["Incentive"]
62
+ netuid_incentive = incentive[netuid]
63
+ dividends = result["Dividends"]
64
+ netuid_dividends = dividends[netuid]
65
+
66
  names = result["Name"]
67
  highest_uid = max(names.keys())
68
  for uid in range(highest_uid + 1):
69
+
70
+ emission = netuid_emission[uid]
71
+
72
+ if emission != 0:
73
+ incentive = netuid_incentive[uid]
74
+ dividends = netuid_dividends[uid]
75
+
76
+ if incentive > dividends:
77
+ emission_dict[uid] = netuid_emission[uid]
78
+ name_dict[uid] = names[uid]
79
 
80
  return emission_dict, name_dict
81