Skip to content

Commit adc1b91

Browse files
committed
clean + reorder
1 parent c494cab commit adc1b91

5 files changed

+11
-20
lines changed

Home.py

+9-15
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import fundingutils
88

99
# Page configuration
10-
st.set_page_config(page_title="Matching Results", page_icon="favicon.png", layout="wide")
10+
st.set_page_config(page_title="Matching Results", page_icon="assets/favicon.png", layout="wide")
1111

1212
# Session state initialization
1313
if 'round_id' not in st.session_state:
@@ -57,7 +57,7 @@ def load_data(round_id, chain_id, csv=None):
5757
324: "ZKSync", 8453: "Base", 42161: "Arbitrum", 43114: "Avalanche",
5858
534352: "Scroll", 1329: "SEI"}
5959
rounds = utils.get_round_summary()
60-
rounds = rounds[(rounds['round_id'].str.lower() == round_id) & (rounds['chain_id'] == chain_id)]
60+
rounds = rounds[(rounds['round_id'].str.lower() == round_id) & (rounds['chain_id'] == chain_id)] # FILTER BY ROUND_ID AND CHAIN_ID
6161
token = rounds['token'].values[0] if 'token' in rounds else 'ETH'
6262
sybilDefense = rounds['sybil_defense'].values[0] if 'sybil_defense' in rounds else 'None'
6363
df = utils.get_round_votes(round_id, chain_id)
@@ -104,7 +104,8 @@ def process_csv(df, csv):
104104
return df
105105

106106
def display_round_settings(data):
107-
st.header('⚙️ Round Settings')
107+
st.title(f" {data['rounds']['round_name'].values[0]}: Matching Results")
108+
st.header(f"⚙️ Round Settings")
108109
col1, col2 = st.columns(2)
109110
col1.write(f"**Chain:** {data['blockchain_mapping'][data['chain_id']]}")
110111
col1.write(f"**Matching Cap:** {data['rounds']['matching_cap_amount'].values[0]:.2f}%")
@@ -156,12 +157,6 @@ def handle_wallet_filtering():
156157
return csv
157158
return None
158159

159-
def handle_matching_funds_override(rounds):
160-
matching_funds_available = st.number_input("Matching Funds Available",
161-
value=rounds['matching_funds_available'].astype(float).values[0],
162-
format="%.2f")
163-
rounds['matching_funds_available'] = matching_funds_available
164-
return rounds
165160

166161
def calculate_verified_vs_unverified(scores, donations_df, score_threshold):
167162
verified_mask = scores['rawScore'] >= score_threshold
@@ -331,6 +326,7 @@ def display_matching_distribution(output_df):
331326
mime='text/csv'
332327
)
333328
st.write('You can upload this CSV to manager.gitcoin.co to apply the matching results to your round')
329+
st.header(f'The value of the sum of the matched column is {output_df["matched"].sum()}')
334330

335331
def create_summary_dataframe(output_df, matching_df, token_code):
336332
summary_df = output_df[['projectName', 'matchedUSD']].copy()
@@ -364,8 +360,9 @@ def display_summary(summary_df):
364360
)
365361

366362
def create_matching_distribution_chart(summary_df, token_symbol):
363+
summary_df = summary_df.sort_values(f'Matching Funds ({token_symbol})', ascending=True)
367364
fig = px.bar(
368-
summary_df.sort_values(f'Matching Funds ({token_symbol})', ascending=True),
365+
summary_df,
369366
x=f'Matching Funds ({token_symbol})',
370367
y='Project',
371368
orientation='h',
@@ -384,7 +381,7 @@ def create_matching_distribution_chart(summary_df, token_symbol):
384381
return fig
385382

386383
def main():
387-
st.image('657c7ed16b14af693c08b92d_GTC-Logotype-Dark.png', width=300)
384+
st.image('assets/657c7ed16b14af693c08b92d_GTC-Logotype-Dark.png', width=300)
388385

389386
round_id, chain_id = validate_input()
390387

@@ -393,9 +390,6 @@ def main():
393390

394391
data = load_data(round_id, chain_id, csv)
395392

396-
with st.expander("Advanced: Override Matching Funds Available", expanded=False):
397-
data['rounds'] = handle_matching_funds_override(data['rounds'])
398-
399393
display_round_settings(data)
400394

401395
matching_amount = data['rounds']['matching_funds_available'].astype(float).values[0]
@@ -421,7 +415,7 @@ def main():
421415
st.subheader('Download Matching Distribution')
422416
strategy_choice = select_matching_strategy()
423417
output_df = prepare_output_dataframe(matching_df, strategy_choice, data)
424-
output_df = adjust_matching_overflow(output_df, data['rounds']['matching_funds_available'].values[0], data['config_df']['token_decimals'].iloc[0])
418+
#output_df = adjust_matching_overflow(output_df, data['rounds']['matching_funds_available'].values[0], data['config_df']['token_decimals'].iloc[0])
425419

426420
display_matching_distribution(output_df)
427421

Home_backup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
st.set_page_config(
1111
page_title="Matching Results",
12-
page_icon="favicon.png",
12+
page_icon="assets/favicon.png",
1313
layout="wide",
1414
)
1515

@@ -116,7 +116,7 @@ def load_data(csv=None):
116116

117117

118118

119-
st.image('657c7ed16b14af693c08b92d_GTC-Logotype-Dark.png', width = 300)
119+
st.image('assets/657c7ed16b14af693c08b92d_GTC-Logotype-Dark.png', width = 300)
120120
with st.expander("Advanced: Filter Out Wallets", expanded=False):
121121
st.write('Upload a CSV file with a single column named "address" containing the ETH addresses to filter out. Addresses should include the 0x prefix.')
122122
uploaded_file = st.file_uploader("Upload a CSV file", type="csv")

favicon.png assets/favicon.png

File renamed without changes.

queries/get_token_price_from_dune.sql

-3
This file was deleted.

0 commit comments

Comments
 (0)