11from argparse import ArgumentParser
2- import os
32import shlex
43import subprocess
54from datetime import date
6- import json
5+ import time
76
87from sdg_utils import get_all_issues , parse_issue , combine_projects_rounds
98from project_selection import select_proposals_to_fund
@@ -12,7 +11,11 @@ def allocate_funds(issues, budget, funding_limit, seed=None):
1211
1312 proposals = [(issue ['project_name' ], issue ['amount_requested' ], issue ['funded_amount' ]) for issue in issues ]
1413 funded = select_proposals_to_fund (budget , funding_limit , proposals , seed = seed )
15-
14+ print ('-' * 60 )
15+ print ("Funded projects:" )
16+ for project in funded :
17+ print (f"- { project } " )
18+ print ('-' * 60 )
1619 for issue in issues :
1720 if issue ['project_name' ] in funded :
1821 command = f'gh issue edit { issue ["issue_number" ]} --add-label "funded"'
@@ -35,15 +38,13 @@ def main():
3538 sdg_issues .append (result )
3639 sdg_issues_round = [sdg for sdg in sdg_issues if sdg ['round_number' ] == arguments .round and
3740 sdg ['year' ] == date .today ().year and
38- not sdg ['awarded' ]]
41+ not sdg ['awarded' ]]
3942 #Filter only this year and combine to calculate all they've been funded ask
4043 sdg_prev_rounds = [sdg_p for sdg_p in sdg_issues if sdg_p ['round_number' ] != arguments .round and sdg_p ['year' ] == date .today ().year ]
41- print ("only this round" )
4244 combine_projects_rounds (sdg_issues_round , sdg_prev_rounds )
43- seed = int (f"{ date .today ():%d%w%j} { arguments .round } " )
45+ seed = int (time .time ())
46+ print (f"Using seed: { seed } " )
4447 allocate_funds (sdg_issues_round , arguments .budget , arguments .funding_limit , seed = seed )
4548
4649if __name__ == "__main__" :
4750 main ()
48-
49-
0 commit comments