MCPcopy Create free account
hub / github.com/pytorch/pytorch / gen_commit

Method gen_commit

scripts/release_notes/commitlist.py:115–136  ·  view source on GitHub ↗
(commit_hash)

Source from the content-addressed store, hash-verified

113
114 @staticmethod
115 def gen_commit(commit_hash):
116 feature_item = get_commit_data_cache().get(commit_hash)
117 features = features_to_dict(feature_item)
118 category, topic = CommitList.categorize(features)
119 a1, a2, a3 = (features["accepters"] + ("", "", ""))[:3]
120 if features["pr_number"] is not None:
121 pr_link = f"https://github.com/pytorch/pytorch/pull/{features['pr_number']}"
122 else:
123 pr_link = None
124 files_changed_str = " ".join(features["files_changed"])
125 return Commit(
126 commit_hash,
127 category,
128 topic,
129 features["title"],
130 files_changed_str,
131 pr_link,
132 features["author"],
133 a1,
134 a2,
135 a3,
136 )
137
138 @staticmethod
139 def category_remapper(category: str) -> str:

Callers 1

get_commits_betweenMethod · 0.80

Calls 6

get_commit_data_cacheFunction · 0.90
features_to_dictFunction · 0.90
CommitClass · 0.85
getMethod · 0.45
categorizeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected