@@ -20,26 +20,26 @@ def get_json(endpoint: str, token: Optional[str] = None):
2020 resp .raise_for_status ()
2121 return resp .json ()
2222
23-
24- def prepare_github_data (fetch_date = "2025-10-01" ):
23+
24+ def prepare_github_data ():
25+
2526 GA4GH_json = get_json (api_constants .GITHUB_REPOS_API )
2627
2728 gh_df = pd .DataFrame .from_records (GA4GH_json )
28-
29+ fetch_date = gh_df [ "created_at" ]. max ()
2930
3031 gh_df ["last_updated" ] = pd .to_datetime (gh_df ["last_updated" ], utc = True , errors = "raise" )
3132 gh_df ["pushed_at" ] = pd .to_datetime (gh_df ["pushed_at" ], utc = True , errors = "raise" )
3233 gh_df ["created_on" ] = pd .to_datetime (gh_df ["created_on" ], utc = True , errors = "raise" )
3334
34- target_date = pd .to_datetime (fetch_date , utc = True )
35+ target_date = pd .to_datetime ("today" , utc = True )
3536
36- # Use absolute timedeltas so days-since values are never negative
37- gh_df ["days_since_pushed_at" ] = (target_date - gh_df ["pushed_at" ]).abs ().dt .days
38- gh_df ["days_since_last_updated" ] = (target_date - gh_df ["last_updated" ]).abs ().dt .days
37+ gh_df ["days_since_pushed_at" ] = (target_date - gh_df ["pushed_at" ]).dt .days
38+ gh_df ["days_since_last_updated" ] = (target_date - gh_df ["last_updated" ]).dt .days
3939
4040 gh_df ["activity_score" ] = (
41- 1 / (1 + gh_df ["days_since_pushed_at" ])
42- + 1 / (1 + gh_df ["days_since_last_updated" ])
41+ ( 1 / (1 + gh_df ["days_since_pushed_at" ]) )
42+ + ( 1 / (1 + gh_df ["days_since_last_updated" ]) )
4343 )
4444
4545 # Top 15 active repos
0 commit comments