Sarkosos commited on
Commit
070b84d
·
1 Parent(s): 5dfbe3b

small fix to dashboard

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -31,11 +31,11 @@ def fetch_throughput_data():
31
 
32
  @st.cache_data(ttl=UPDATE_INTERVAL)
33
  def fetch_metagraph_data():
34
- return utils.get_metagraph(time.time() // UPDATE_INTERVAL)
35
 
36
  @st.cache_data(ttl=UPDATE_INTERVAL)
37
  def fetch_leaderboard_data(df_m, ntop, entity_choice):
38
- return utils.get_leaderboard(df_m, ntop=ntop, entity_choice=entity_choice)
39
 
40
  #### ------ PRODUCTIVITY ------
41
 
@@ -44,14 +44,13 @@ st.subheader('Productivity overview')
44
  st.info('Productivity metrics show how many proteins have been folded, which is the primary goal of the subnet. Metrics are estimated using weights and biases data combined with heuristics.')
45
 
46
  productivity_all = fetch_productivity_data()
47
- completed_jobs = productivity_all['all_time']['total_completed_jobs']
48
 
49
  productivity_24h = productivity_all['last_24h']
50
  completed_jobs = pd.DataFrame(completed_jobs)
51
- completed_jobs['last_event_at'] = pd.to_datetime(completed_jobs['updated_at'])
52
 
53
- unique_folded = completed_jobs.drop_duplicates(subset=['pdb_id'], keep='first')
54
- unique_folded['last_event_at'] = pd.to_datetime(unique_folded['updated_at'])
55
 
56
  m1, m2, m3 = st.columns(3)
57
  m1.metric('Unique proteins folded', f'{len(unique_folded):,.0f}', delta=f'{productivity_24h["unique_folded"]:,.0f} (24h)')
@@ -135,7 +134,7 @@ df_miners = fetch_leaderboard_data(df_m, ntop=ntop, entity_choice=entity_choice)
135
 
136
  # hide colorbar and don't show y axis
137
  st.plotly_chart(
138
- px.bar(df_miners, x='I', color='I', hover_name=entity_choice, text=entity_choice if ntop < 20 else None,
139
  labels={'I':'Incentive', 'trust':'Trust', 'stake':'Stake', '_index':'Rank'},
140
  ).update_layout(coloraxis_showscale=False, yaxis_visible=False),
141
  use_container_width=True,
 
31
 
32
  @st.cache_data(ttl=UPDATE_INTERVAL)
33
  def fetch_metagraph_data():
34
+ return utils.get_metagraph()
35
 
36
  @st.cache_data(ttl=UPDATE_INTERVAL)
37
  def fetch_leaderboard_data(df_m, ntop, entity_choice):
38
+ return utils.get_leaderboard(df_m, entity_choice=entity_choice)
39
 
40
  #### ------ PRODUCTIVITY ------
41
 
 
44
  st.info('Productivity metrics show how many proteins have been folded, which is the primary goal of the subnet. Metrics are estimated using weights and biases data combined with heuristics.')
45
 
46
  productivity_all = fetch_productivity_data()
47
+ completed_jobs = productivity_all['all_time']['total_completed_jobs_data']
48
 
49
  productivity_24h = productivity_all['last_24h']
50
  completed_jobs = pd.DataFrame(completed_jobs)
 
51
 
52
+ unique_folded = productivity_all['all_time']['unique_folded_data']
53
+ # unique_folded['last_event_at'] = pd.to_datetime(unique_folded['updated_at'])
54
 
55
  m1, m2, m3 = st.columns(3)
56
  m1.metric('Unique proteins folded', f'{len(unique_folded):,.0f}', delta=f'{productivity_24h["unique_folded"]:,.0f} (24h)')
 
134
 
135
  # hide colorbar and don't show y axis
136
  st.plotly_chart(
137
+ px.bar(df_miners.iloc[:ntop], x='I', color='I', hover_name=entity_choice, text=entity_choice if ntop < 20 else None,
138
  labels={'I':'Incentive', 'trust':'Trust', 'stake':'Stake', '_index':'Rank'},
139
  ).update_layout(coloraxis_showscale=False, yaxis_visible=False),
140
  use_container_width=True,