From bad4d75abdf8e862b13a43bb931104e663386496 Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Sat, 17 Oct 2026 09:25:41 +0000 Subject: [PATCH 01/11] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0README=E5=92=8C?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 +++++++++++++++ main.py | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 main.py diff --git a/README.md b/README.md index c2a78565..e0718459 100644 --- a/README.md +++ b/README.md @@ -121,3 +121,18 @@ graph LR style A fill:#f3e5f5 ``` + + +## 我的贡献想法和计划 + +- 姓名:李思其 +- 学号:2411010051 + +### 对项目的了解 +OpenHUTB 是一个包含人车模拟器、交通数字孪生、神经原理等多个方向的开源社区。我觉得把文档整理好,能让更多新手容易上手参与贡献。 + +### 我的贡献计划 +1. 先阅读现有的文档和贡献指南,熟悉项目结构。 +2. 帮忙补充和润色 README 里的快速开始步骤,让说明更清楚。 +3. 测试一下 main.py 脚本,确保能正常运行。 +4. 后续如果有时间,想学习一下 traffic_twin 相关的文档。 \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 00000000..3f6f4b27 --- /dev/null +++ b/main.py @@ -0,0 +1,9 @@ +def main(): + print("欢迎来到 OpenHUTB 开源社区!") + print("核心项目:hutb, doc, traffic_twin, neuro, PFC, move") + print("在线文档:https://openhutb.github.io/") + print("讨论区:https://github.com/orgs/OpenHUTB/discussions") + print("贡献指南:CONTRIBUTING.md") + +if __name__ == "__main__": + main() \ No newline at end of file From 74d72450714dc8b7bf6503d5d123cb12d78babdf Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Sat, 17 Oct 2026 10:13:25 +0000 Subject: [PATCH 02/11] =?UTF-8?q?docs:=20=E5=A2=9E=E5=8A=A0py=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B4=E9=83=A8=E6=B3=A8=E9=87=8A=EF=BC=8C=E6=B8=85?= =?UTF-8?q?=E7=90=86=E9=87=8D=E5=A4=8D=E7=9A=84=E5=AF=BC=E5=85=A5=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 ++++------------ main.py | 10 ++++++++++ reports/reports_guide.md | 2 ++ src/git_commit_stats.py | 10 ++++++++-- 4 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 reports/reports_guide.md diff --git a/README.md b/README.md index e0718459..2d0eff29 100644 --- a/README.md +++ b/README.md @@ -123,16 +123,8 @@ graph LR ``` -## 我的贡献想法和计划 - -- 姓名:李思其 -- 学号:2411010051 - -### 对项目的了解 -OpenHUTB 是一个包含人车模拟器、交通数字孪生、神经原理等多个方向的开源社区。我觉得把文档整理好,能让更多新手容易上手参与贡献。 - ### 我的贡献计划 -1. 先阅读现有的文档和贡献指南,熟悉项目结构。 -2. 帮忙补充和润色 README 里的快速开始步骤,让说明更清楚。 -3. 测试一下 main.py 脚本,确保能正常运行。 -4. 后续如果有时间,想学习一下 traffic_twin 相关的文档。 \ No newline at end of file +1.新增了 main.py 模块入口,用于快速展示社区核心信息和链接。 +2.新建了 reports_guide.md,说明了报告文件夹的用途。 +3.为 src/git_commit_stats.py 增加了注释,并清理了重复导入的代码。 +后续会积极参与同学的代码审核工作。 \ No newline at end of file diff --git a/main.py b/main.py index 3f6f4b27..0f55f6e7 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,14 @@ +""" +main.py - OpenHUTB 社区信息入口模块 + +本脚本作为 OpenHUTB 社区信息的快速查看入口, +运行后将在终端打印核心项目列表、在线文档及社区讨论区链接。 +""" + def main(): + """ + 主函数:负责打印社区相关信息。 + """ print("欢迎来到 OpenHUTB 开源社区!") print("核心项目:hutb, doc, traffic_twin, neuro, PFC, move") print("在线文档:https://openhutb.github.io/") diff --git a/reports/reports_guide.md b/reports/reports_guide.md new file mode 100644 index 00000000..948575ec --- /dev/null +++ b/reports/reports_guide.md @@ -0,0 +1,2 @@ +这个文件夹里放的都是自动生成的统计报告。我看了一下名字,基本都是带日期的(比如 2026-05-08 这种),应该是用来记录每个阶段的提交数据的。 +注意别手动去改里面的数据,如果数据不对,得去跑 src 里的脚本重新生成,不然数据就对不上了。 \ No newline at end of file diff --git a/src/git_commit_stats.py b/src/git_commit_stats.py index 6c928f4c..6d0c5e1e 100644 --- a/src/git_commit_stats.py +++ b/src/git_commit_stats.py @@ -1,3 +1,8 @@ +""" +git_commit_stats.py +本脚本用于统计 Git 仓库的提交数据,并输出为 CSV 文件。 +支持通过参数指定时间段,并可通过 JSON 文件过滤特定用户。 +""" # python git_commit_stats.py --since "2026-02-27 18:00" --until "2026-03-08 00:00"运行指定时间段的提交统计,结果输出到 commit_stats.csv 文件中。可以通过 --ignore 参数指定一个 JSON 文件,里面包含需要屏蔽的用户(按邮箱或用户名)。如果不指定 --ignore 参数,则默认使用 ignore_users.json 文件作为屏蔽列表。 import subprocess import argparse @@ -18,8 +23,9 @@ def load_ignore_users(file_path): except Exception as e: print(f"读取屏蔽列表失败: {e}") return [] -import subprocess -from collections import Counter +# import subprocess +# from collections import Counter +# 上面两行已经写过,应该删掉 def get_commits(since=None, until=None, ignore_list=[]): # 使用 %ae(邮箱)作为唯一键,%an(用户名)作为显示名 From 8534df1490f3de329ba0fdce53da45aa79826439 Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Mon, 26 Oct 2026 23:14:21 +0800 Subject: [PATCH 03/11] Delete main.py Signed-off-by: ovo75u <1444654239@qq.com> --- main.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 main.py diff --git a/main.py b/main.py deleted file mode 100644 index 0f55f6e7..00000000 --- a/main.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -main.py - OpenHUTB 社区信息入口模块 - -本脚本作为 OpenHUTB 社区信息的快速查看入口, -运行后将在终端打印核心项目列表、在线文档及社区讨论区链接。 -""" - -def main(): - """ - 主函数:负责打印社区相关信息。 - """ - print("欢迎来到 OpenHUTB 开源社区!") - print("核心项目:hutb, doc, traffic_twin, neuro, PFC, move") - print("在线文档:https://openhutb.github.io/") - print("讨论区:https://github.com/orgs/OpenHUTB/discussions") - print("贡献指南:CONTRIBUTING.md") - -if __name__ == "__main__": - main() \ No newline at end of file From 89cc8a35d673aa15054f3ce257a7864757f6f7d5 Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Mon, 26 Oct 2026 23:15:01 +0800 Subject: [PATCH 04/11] Update README.md Signed-off-by: ovo75u <1444654239@qq.com> --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 2d0eff29..c2a78565 100644 --- a/README.md +++ b/README.md @@ -121,10 +121,3 @@ graph LR style A fill:#f3e5f5 ``` - - -### 我的贡献计划 -1.新增了 main.py 模块入口,用于快速展示社区核心信息和链接。 -2.新建了 reports_guide.md,说明了报告文件夹的用途。 -3.为 src/git_commit_stats.py 增加了注释,并清理了重复导入的代码。 -后续会积极参与同学的代码审核工作。 \ No newline at end of file From 17fb043813dddb2c9d87a538efaff1b9b5e2beb6 Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Mon, 26 Oct 2026 23:15:33 +0800 Subject: [PATCH 05/11] Update git_commit_stats.py Signed-off-by: ovo75u <1444654239@qq.com> --- src/git_commit_stats.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/git_commit_stats.py b/src/git_commit_stats.py index 6d0c5e1e..5f099b50 100644 --- a/src/git_commit_stats.py +++ b/src/git_commit_stats.py @@ -23,9 +23,6 @@ def load_ignore_users(file_path): except Exception as e: print(f"读取屏蔽列表失败: {e}") return [] -# import subprocess -# from collections import Counter -# 上面两行已经写过,应该删掉 def get_commits(since=None, until=None, ignore_list=[]): # 使用 %ae(邮箱)作为唯一键,%an(用户名)作为显示名 From 08f49d1fddfbd7926a2a62070586a30d2e8ad31b Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Mon, 26 Oct 2026 23:20:30 +0800 Subject: [PATCH 06/11] Update reports_guide.md Signed-off-by: ovo75u <1444654239@qq.com> --- reports/reports_guide.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/reports/reports_guide.md b/reports/reports_guide.md index 948575ec..2e2b5eb2 100644 --- a/reports/reports_guide.md +++ b/reports/reports_guide.md @@ -1,2 +1,15 @@ -这个文件夹里放的都是自动生成的统计报告。我看了一下名字,基本都是带日期的(比如 2026-05-08 这种),应该是用来记录每个阶段的提交数据的。 -注意别手动去改里面的数据,如果数据不对,得去跑 src 里的脚本重新生成,不然数据就对不上了。 \ No newline at end of file +# reports 文件夹 + +这里头主要放 OpenHUTB 项目跑自动化统计时生成的数据报告,基本都是 CSV 这些格式。后面要是想追溯某个时间段的项目活跃度或者提交记录,来这个目录翻就行。 + +报告不用手动弄,跑 `src` 目录下的 `git_commit_stats.py` 脚本就自动生成了。 + +想自己出一份报告的话,大概这么搞: + +1. 先确认电脑里有 Python 环境。 +2. 切到项目根目录,把命令行终端开起来。 +3. 跑下面的命令,比如统计特定时间段的提交: + +```bash +python src/git_commit_stats.py --since "2026-02-27 18:00" --until "2026-03-08 00:00" --output reports/commit_stats.csv +``` From a4374496d24dc53cb7555e76680706dd0b546c6f Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Mon, 26 Oct 2026 23:21:49 +0800 Subject: [PATCH 07/11] Update reports_guide.md Signed-off-by: ovo75u <1444654239@qq.com> --- reports/reports_guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reports/reports_guide.md b/reports/reports_guide.md index 2e2b5eb2..a1d4cd94 100644 --- a/reports/reports_guide.md +++ b/reports/reports_guide.md @@ -4,10 +4,10 @@ 报告不用手动弄,跑 `src` 目录下的 `git_commit_stats.py` 脚本就自动生成了。 -想自己出一份报告的话,大概这么搞: +举例子,出报告的步骤: 1. 先确认电脑里有 Python 环境。 -2. 切到项目根目录,把命令行终端开起来。 +2. 切到项目根目录,把命令行终端打开。 3. 跑下面的命令,比如统计特定时间段的提交: ```bash From 0d5b24c679ae285b9cfe75d2f982ef1cfb4300a4 Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Mon, 26 Oct 2026 23:31:28 +0800 Subject: [PATCH 08/11] Update index.md Signed-off-by: ovo75u <1444654239@qq.com> --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 20b00c26..d808032b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -69,5 +69,5 @@ OpenHUTB 的其他非主要平台包括 [gitee](https://gitee.com/OpenHUTB)、[g ___ -如果对文档中的任何问题可以在 [本文档的源码仓库](https://github.com/OpenHUTB/.github) 中的 [问题](https://github.com/OpenHUTB/.github/issues) 页面讨论或者提交 [拉取请求](https://github.com/OpenHUTB/.github/blob/master/CONTRIBUTING.md) 直接修改文档。 +如果对文档中的任何问题可以在 [本文档的源码仓库](https://github.com/OpenHUTB/.github) 中的 [问题](https://github.com/OpenHUTB/.github/issues) 页面讨论或者提交 [拉取请求](https://github.com/OpenHUTB/.github/pulls) 直接修改文档。 From dac3c0009a698b803ae8a71f4a2fd9106d8bd297 Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Thu, 29 Oct 2026 20:49:15 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ovo75u <1444654239@qq.com> --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index d808032b..20b00c26 100644 --- a/docs/index.md +++ b/docs/index.md @@ -69,5 +69,5 @@ OpenHUTB 的其他非主要平台包括 [gitee](https://gitee.com/OpenHUTB)、[g ___ -如果对文档中的任何问题可以在 [本文档的源码仓库](https://github.com/OpenHUTB/.github) 中的 [问题](https://github.com/OpenHUTB/.github/issues) 页面讨论或者提交 [拉取请求](https://github.com/OpenHUTB/.github/pulls) 直接修改文档。 +如果对文档中的任何问题可以在 [本文档的源码仓库](https://github.com/OpenHUTB/.github) 中的 [问题](https://github.com/OpenHUTB/.github/issues) 页面讨论或者提交 [拉取请求](https://github.com/OpenHUTB/.github/blob/master/CONTRIBUTING.md) 直接修改文档。 From 77a2565026c3be899be8068b1082a8ffa5bd55b5 Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Thu, 29 Oct 2026 20:58:31 +0800 Subject: [PATCH 10/11] =?UTF-8?q?docs:=20=E4=BF=AE=E6=AD=A3=20reports=20?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E8=AF=B4=E6=98=8E=E5=B9=B6=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8A=A5=E5=91=8A=E4=B8=8E=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ovo75u <1444654239@qq.com> --- reports/README.md | 18 ++++++++++++++++++ reports/reports_guide.md | 15 --------------- 2 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 reports/README.md delete mode 100644 reports/reports_guide.md diff --git a/reports/README.md b/reports/README.md new file mode 100644 index 00000000..933ce19b --- /dev/null +++ b/reports/README.md @@ -0,0 +1,18 @@ +# reports 文件夹说明 + +本目录存放 OpenHUTB 项目自动化统计生成的数据报告,主要为 CSV 格式。 + +## 自动生成的报告 +这些报告由 GitHub Actions 工作流(`repo_metrics_action`)每月自动生成,文件命名包含时间戳(如 `OpenHUTB-2026-10-01T03-13-222-30-days.csv`),用于追溯项目活跃度或提交记录。 + +如果需要查看历史报告,直接在本目录中查找对应的 CSV 文件即可。报告缺失时,需等待下月自动生成,或在 Actions 页面手动触发工作流。 + +## 手动统计工具 +除了自动生成的报告外,项目还提供了一个手动统计脚本 `src/git_commit_stats.py`,用于统计指定时间段内的提交记录。该脚本需要手动运行,不会自动生成报告,也不会影响本目录下的自动报告文件。 + +### 使用方法 +1. 确保本地已安装 Python 环境。 +2. 切换到项目根目录,打开命令行终端。 +3. 运行以下命令,例如统计特定时间段的提交: + ```bash + python src/git_commit_stats.py --since "2026-02-27 18:00" --until "2026-03-08 00:00" --output commit_stats.csv diff --git a/reports/reports_guide.md b/reports/reports_guide.md deleted file mode 100644 index a1d4cd94..00000000 --- a/reports/reports_guide.md +++ /dev/null @@ -1,15 +0,0 @@ -# reports 文件夹 - -这里头主要放 OpenHUTB 项目跑自动化统计时生成的数据报告,基本都是 CSV 这些格式。后面要是想追溯某个时间段的项目活跃度或者提交记录,来这个目录翻就行。 - -报告不用手动弄,跑 `src` 目录下的 `git_commit_stats.py` 脚本就自动生成了。 - -举例子,出报告的步骤: - -1. 先确认电脑里有 Python 环境。 -2. 切到项目根目录,把命令行终端打开。 -3. 跑下面的命令,比如统计特定时间段的提交: - -```bash -python src/git_commit_stats.py --since "2026-02-27 18:00" --until "2026-03-08 00:00" --output reports/commit_stats.csv -``` From 378d969382ee15aba63d05c8ac8239df7ef38d41 Mon Sep 17 00:00:00 2001 From: ovo75u <1444654239@qq.com> Date: Sat, 7 Nov 2026 21:44:55 +0800 Subject: [PATCH 11/11] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85repo=20metrics?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E8=B7=AF=E5=BE=84=E4=B8=8Eaction?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=EF=BC=8C=E5=AE=8C=E5=96=84=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充了.github/workflows/repo_metrics.yml以及action全称,和评审意见保持一致 Signed-off-by: ovo75u <1444654239@qq.com> --- reports/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reports/README.md b/reports/README.md index 933ce19b..807beb8c 100644 --- a/reports/README.md +++ b/reports/README.md @@ -3,7 +3,7 @@ 本目录存放 OpenHUTB 项目自动化统计生成的数据报告,主要为 CSV 格式。 ## 自动生成的报告 -这些报告由 GitHub Actions 工作流(`repo_metrics_action`)每月自动生成,文件命名包含时间戳(如 `OpenHUTB-2026-10-01T03-13-222-30-days.csv`),用于追溯项目活跃度或提交记录。 +这些报告由 GitHub Actions 工作流(`.github/workflows/repo_metrics.yml`,nicklegan/github‑org‑repo‑metrics‑action)每月自动生成,文件命名包含时间戳(如 `OpenHUTB-2026-10-01T03-13-222-30-days.csv`),用于追溯项目活跃度或提交记录。 如果需要查看历史报告,直接在本目录中查找对应的 CSV 文件即可。报告缺失时,需等待下月自动生成,或在 Actions 页面手动触发工作流。