run2_robust_community_metrics
Robust Python logic for community pulse metrics with substring label matching and precise PR status handling.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 92
- Forks
- 7
01 前言 Front Matter
- name
- run2_robust_community_metrics
- description
- Robust Python logic for community pulse metrics with substring label matching and precise PR status handling.
03 SKILL.md 正文
Robust Community Metrics
This skill focuses on precision and robustness when calculating metrics from GitHub JSON data.
Substring Label Matching (The "Bug" Filter)
To follow the requirement of matching any label containing a substring:
def is_bug_report(issue, substring='bug'):
return any(substring in label['name'].lower() for label in issue.get('labels', []))
Precise PR Status (Merged vs. Closed)
In GitHub, a PR can be open or closed. A closed PR might be merged.
- Merged:
pull_request.merged_atis not null. - Closed (Unmerged):
state == "closed"ANDpull_request.merged_atis null.
Time-to-Merge Calculation
Always use datetime.fromisoformat and handle UTC offsets (replacing 'Z' with '+00:00').
def get_merge_days(created_at_str, merged_at_str):
created = datetime.fromisoformat(created_at_str.replace('Z', '+00:00'))
merged = datetime.fromisoformat(merged_at_str.replace('Z', '+00:00'))
return (merged - created).total_seconds() / (24 * 3600)
Handling Large Data Sets
When dealing with more than 100 items, ensure the processing script can merge multiple JSON files or handle an array of items.
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.