7
7
import fundingutils
8
8
9
9
# 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" )
11
11
12
12
# Session state initialization
13
13
if 'round_id' not in st .session_state :
@@ -57,7 +57,7 @@ def load_data(round_id, chain_id, csv=None):
57
57
324 : "ZKSync" , 8453 : "Base" , 42161 : "Arbitrum" , 43114 : "Avalanche" ,
58
58
534352 : "Scroll" , 1329 : "SEI" }
59
59
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
61
61
token = rounds ['token' ].values [0 ] if 'token' in rounds else 'ETH'
62
62
sybilDefense = rounds ['sybil_defense' ].values [0 ] if 'sybil_defense' in rounds else 'None'
63
63
df = utils .get_round_votes (round_id , chain_id )
@@ -104,7 +104,8 @@ def process_csv(df, csv):
104
104
return df
105
105
106
106
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" )
108
109
col1 , col2 = st .columns (2 )
109
110
col1 .write (f"**Chain:** { data ['blockchain_mapping' ][data ['chain_id' ]]} " )
110
111
col1 .write (f"**Matching Cap:** { data ['rounds' ]['matching_cap_amount' ].values [0 ]:.2f} %" )
@@ -156,12 +157,6 @@ def handle_wallet_filtering():
156
157
return csv
157
158
return None
158
159
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
165
160
166
161
def calculate_verified_vs_unverified (scores , donations_df , score_threshold ):
167
162
verified_mask = scores ['rawScore' ] >= score_threshold
@@ -331,6 +326,7 @@ def display_matching_distribution(output_df):
331
326
mime = 'text/csv'
332
327
)
333
328
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 ()} ' )
334
330
335
331
def create_summary_dataframe (output_df , matching_df , token_code ):
336
332
summary_df = output_df [['projectName' , 'matchedUSD' ]].copy ()
@@ -364,8 +360,9 @@ def display_summary(summary_df):
364
360
)
365
361
366
362
def create_matching_distribution_chart (summary_df , token_symbol ):
363
+ summary_df = summary_df .sort_values (f'Matching Funds ({ token_symbol } )' , ascending = True )
367
364
fig = px .bar (
368
- summary_df . sort_values ( f'Matching Funds ( { token_symbol } )' , ascending = True ) ,
365
+ summary_df ,
369
366
x = f'Matching Funds ({ token_symbol } )' ,
370
367
y = 'Project' ,
371
368
orientation = 'h' ,
@@ -384,7 +381,7 @@ def create_matching_distribution_chart(summary_df, token_symbol):
384
381
return fig
385
382
386
383
def main ():
387
- st .image ('657c7ed16b14af693c08b92d_GTC-Logotype-Dark.png' , width = 300 )
384
+ st .image ('assets/ 657c7ed16b14af693c08b92d_GTC-Logotype-Dark.png' , width = 300 )
388
385
389
386
round_id , chain_id = validate_input ()
390
387
@@ -393,9 +390,6 @@ def main():
393
390
394
391
data = load_data (round_id , chain_id , csv )
395
392
396
- with st .expander ("Advanced: Override Matching Funds Available" , expanded = False ):
397
- data ['rounds' ] = handle_matching_funds_override (data ['rounds' ])
398
-
399
393
display_round_settings (data )
400
394
401
395
matching_amount = data ['rounds' ]['matching_funds_available' ].astype (float ).values [0 ]
@@ -421,7 +415,7 @@ def main():
421
415
st .subheader ('Download Matching Distribution' )
422
416
strategy_choice = select_matching_strategy ()
423
417
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])
425
419
426
420
display_matching_distribution (output_df )
427
421
0 commit comments