gitflow-analytics 3.9.2__py3-none-any.whl → 3.9.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  """Version information for gitflow-analytics."""
2
2
 
3
- __version__ = "3.9.2"
3
+ __version__ = "3.9.3"
4
4
  __version_info__ = tuple(int(x) for x in __version__.split("."))
@@ -82,11 +82,15 @@ class ActivityScorer:
82
82
  + complexity_score * self.WEIGHTS["complexity"]
83
83
  )
84
84
 
85
+ # Determine if PR data is available for proper normalization
86
+ has_pr_data = prs > 0
87
+
85
88
  return {
86
89
  "raw_score": raw_score,
87
- "normalized_score": self._normalize_score(raw_score),
90
+ "normalized_score": self._normalize_score(raw_score, has_pr_data),
88
91
  "components": components,
89
- "activity_level": self._get_activity_level(raw_score),
92
+ "activity_level": self._get_activity_level(raw_score, has_pr_data),
93
+ "has_pr_data": has_pr_data,
90
94
  }
91
95
 
92
96
  def _calculate_commit_score(self, commits: int) -> float:
@@ -169,8 +173,13 @@ class ActivityScorer:
169
173
 
170
174
  return max(0, file_score + complexity_bonus)
171
175
 
172
- def _normalize_score(self, raw_score: float) -> float:
173
- """Normalize score to 0-100 range."""
176
+ def _normalize_score(self, raw_score: float, has_pr_data: bool = True) -> float:
177
+ """Normalize score to 0-100 range.
178
+
179
+ Args:
180
+ raw_score: The calculated raw activity score
181
+ has_pr_data: Whether PR data was available (affects normalization divisor)
182
+ """
174
183
  # Based on research, a highly productive week might have:
175
184
  # - 15 commits (150 points after scaling)
176
185
  # - 3 PRs of optimal size (180 points)
@@ -178,12 +187,17 @@ class ActivityScorer:
178
187
  # - 20 files changed (50 points)
179
188
  # Total: ~500 points = 100 normalized
180
189
 
181
- normalized = (raw_score / 500) * 100
190
+ # When PR data is unavailable (e.g., weekly reports), adjust divisor
191
+ # since PR component (30% weight) contributes 0
192
+ # Effective max becomes 70% of 50 = 35
193
+ divisor = 35 if not has_pr_data else 50
194
+
195
+ normalized = (raw_score / divisor) * 100
182
196
  return min(100, normalized) # Cap at 100
183
197
 
184
- def _get_activity_level(self, raw_score: float) -> str:
198
+ def _get_activity_level(self, raw_score: float, has_pr_data: bool = True) -> str:
185
199
  """Categorize activity level based on score."""
186
- normalized = self._normalize_score(raw_score)
200
+ normalized = self._normalize_score(raw_score, has_pr_data)
187
201
 
188
202
  if normalized >= 80:
189
203
  return "exceptional"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitflow-analytics
3
- Version: 3.9.2
3
+ Version: 3.9.3
4
4
  Summary: Analyze Git repositories for developer productivity insights
5
5
  Author-email: Bob Matyas <bobmatnyc@gmail.com>
6
6
  License: MIT
@@ -1,5 +1,5 @@
1
1
  gitflow_analytics/__init__.py,sha256=W3Jaey5wuT1nBPehVLTIRkVIyBa5jgYOlBKc_UFfh-4,773
2
- gitflow_analytics/_version.py,sha256=1vJ2cOJm4JBq3ASHO5cRbx3_lFVH3QIh1Caj_cSjWN4,137
2
+ gitflow_analytics/_version.py,sha256=ORQnrflACA8f-2fsqGzATYAmqe7IrUi2k8I6B_HggXY,137
3
3
  gitflow_analytics/cli.py,sha256=pYW6V0b6SRa3-NyOmXGQhf5emcKHUHgOVL2PFOAS8LQ,273331
4
4
  gitflow_analytics/config.py,sha256=XRuxvzLWyn_ML7mDCcuZ9-YFNAEsnt33vIuWxQQ_jxg,1033
5
5
  gitflow_analytics/constants.py,sha256=GXEncUJS9ijOI5KWtQCTANwdqxPfXpw-4lNjhaWTKC4,2488
@@ -47,7 +47,7 @@ gitflow_analytics/integrations/github_integration.py,sha256=52lyq5GNJIlTXIv7iwrk
47
47
  gitflow_analytics/integrations/jira_integration.py,sha256=3DV1hGNs1HxAOSGt2BfqBrWSigRN5H8BT1-G7E_8hGg,28761
48
48
  gitflow_analytics/integrations/orchestrator.py,sha256=u3FKZF2yD5g5HhNFm6nIJe69ZKfU1QLni4S14GDRIrY,13205
49
49
  gitflow_analytics/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
- gitflow_analytics/metrics/activity_scoring.py,sha256=h1uj_6dTKpCwNJfsimfaY0TB3Qaexw7I7IEFutoHwUY,12539
50
+ gitflow_analytics/metrics/activity_scoring.py,sha256=lSrdeH9SVNzeSR80vvzdWBuFcD3BkHsOdSZu97q6Bdg,13171
51
51
  gitflow_analytics/metrics/branch_health.py,sha256=MkfyiUc1nHEakKBJ_uTlvxmofX1QX_s4hm4XBTYKVLM,17522
52
52
  gitflow_analytics/metrics/dora.py,sha256=U4Xk0tr7kPcpR7r-PevYBUDtZPkDIG-w_yS2DJOlTrk,27549
53
53
  gitflow_analytics/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -120,9 +120,9 @@ gitflow_analytics/training/model_loader.py,sha256=xGZLSopGxDhC--2XN6ytRgi2CyjOKY
120
120
  gitflow_analytics/training/pipeline.py,sha256=PQegTk_-OsPexVyRDfiy-3Df-7pcs25C4vPASr-HT9E,19951
121
121
  gitflow_analytics/ui/__init__.py,sha256=UBhYhZMvwlSrCuGWjkIdoP2zNbiQxOHOli-I8mqIZUE,441
122
122
  gitflow_analytics/ui/progress_display.py,sha256=3xJnCOSs1DRVAfS-rTu37EsLfWDFW5-mbv-bPS9NMm4,59182
123
- gitflow_analytics-3.9.2.dist-info/licenses/LICENSE,sha256=xwvSwY1GYXpRpmbnFvvnbmMwpobnrdN9T821sGvjOY0,1066
124
- gitflow_analytics-3.9.2.dist-info/METADATA,sha256=zFtrIA8qcqvHtfmDMA9wqTLf2RQbhweU02RzzqqeerY,36830
125
- gitflow_analytics-3.9.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
126
- gitflow_analytics-3.9.2.dist-info/entry_points.txt,sha256=ZOsX0GLsnMysp5FWPOfP_qyoS7WJ8IgcaDFDxWBYl1g,98
127
- gitflow_analytics-3.9.2.dist-info/top_level.txt,sha256=CQyxZXjKvpSB1kgqqtuE0PCRqfRsXZJL8JrYpJKtkrk,18
128
- gitflow_analytics-3.9.2.dist-info/RECORD,,
123
+ gitflow_analytics-3.9.3.dist-info/licenses/LICENSE,sha256=xwvSwY1GYXpRpmbnFvvnbmMwpobnrdN9T821sGvjOY0,1066
124
+ gitflow_analytics-3.9.3.dist-info/METADATA,sha256=ZmTxikWCnWPdRW7RQSGGEkuexP1jhzPUNL9gmwykQgQ,36830
125
+ gitflow_analytics-3.9.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
126
+ gitflow_analytics-3.9.3.dist-info/entry_points.txt,sha256=ZOsX0GLsnMysp5FWPOfP_qyoS7WJ8IgcaDFDxWBYl1g,98
127
+ gitflow_analytics-3.9.3.dist-info/top_level.txt,sha256=CQyxZXjKvpSB1kgqqtuE0PCRqfRsXZJL8JrYpJKtkrk,18
128
+ gitflow_analytics-3.9.3.dist-info/RECORD,,