From 8ee49c1a4521714021f0c0306b7c3ca7d8ff222a Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 5 Jul 2024 14:22:46 +0200 Subject: [PATCH 1/2] Refactor code for speed and clarity --- README.md | 2 +- count_stars.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d2a1e83..3533f45 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Track the daily growth of GitHub stars over a time period to gauge the open-source popularity of various repositories. -[![Ultralytics Actions](https://github.com/ultralytics/stars/actions/workflows/format.yml/badge.svg)](https://github.com/ultralytics/stars/actions/workflows/format.yml) Discord +[![Ultralytics Actions](https://github.com/ultralytics/stars/actions/workflows/format.yml/badge.svg)](https://github.com/ultralytics/stars/actions/workflows/format.yml) Discord Ultralytics Forums ## 📌 Requirements diff --git a/count_stars.py b/count_stars.py index 0d5f585..81a2f4e 100644 --- a/count_stars.py +++ b/count_stars.py @@ -29,6 +29,7 @@ def run( # days = (datetime.now() - date).total_seconds() / 86400 # compute number of days # days = 30 # specify days directly, i.e. last 30 days + """Counts GitHub stars for specified repositories over a given period and optionally saves user information.""" # Get repos with open("repos.yaml", "r") as f: repos = yaml.safe_load(f)["repositories"] From 071984317c4e800af6136361bd32e9a55a944189 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 5 Jul 2024 14:28:04 +0200 Subject: [PATCH 2/2] Update count_stars.py --- count_stars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/count_stars.py b/count_stars.py index 81a2f4e..3eec224 100644 --- a/count_stars.py +++ b/count_stars.py @@ -24,12 +24,12 @@ def run( days=30, # trailing days to analyze save=False, # save user info ): + """Counts GitHub stars for specified repositories over a given period and optionally saves user information.""" # Settings # date = datetime(2022, 3, 1) # count stars since this day, i.e. March 1st 2022 # days = (datetime.now() - date).total_seconds() / 86400 # compute number of days # days = 30 # specify days directly, i.e. last 30 days - """Counts GitHub stars for specified repositories over a given period and optionally saves user information.""" # Get repos with open("repos.yaml", "r") as f: repos = yaml.safe_load(f)["repositories"]