(commit_hash)
| 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: |
no test coverage detected