priorityx 0.2.0__tar.gz → 0.2.2__tar.gz
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.
- {priorityx-0.2.0 → priorityx-0.2.2}/PKG-INFO +3 -2
- {priorityx-0.2.0 → priorityx-0.2.2}/README.md +2 -1
- {priorityx-0.2.0 → priorityx-0.2.2}/docs/api-reference.md +14 -7
- {priorityx-0.2.0 → priorityx-0.2.2}/docs/quickstart.md +6 -1
- {priorityx-0.2.0 → priorityx-0.2.2}/examples/incidents/incident_monitoring.py +18 -2
- {priorityx-0.2.0 → priorityx-0.2.2}/pyproject.toml +1 -1
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/__init__.py +1 -1
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/tracking/drivers.py +273 -212
- priorityx-0.2.2/tests/test_drivers.py +243 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/uv.lock +345 -345
- priorityx-0.2.0/src/priorityx/viz/__init__.py +0 -0
- priorityx-0.2.0/tests/test_drivers.py +0 -118
- {priorityx-0.2.0 → priorityx-0.2.2}/.github/workflows/release.yml +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/.github/workflows/test.yml +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/.gitignore +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/LICENSE +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/Makefile +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/docs/methodology.md +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/docs/priority_classification.md +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/examples/README.md +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/examples/bugs/bugs_monitoring.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/examples/violations/violations_monitoring.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/scripts/version.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/core/__init__.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/core/filters.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/core/glmm.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/core/quadrants.py +0 -0
- {priorityx-0.2.0/src/priorityx/drivers → priorityx-0.2.2/src/priorityx/tracking}/__init__.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/tracking/movement.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/tracking/transitions.py +0 -0
- {priorityx-0.2.0/src/priorityx/tracking → priorityx-0.2.2/src/priorityx/utils}/__init__.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/utils/helpers.py +0 -0
- {priorityx-0.2.0/src/priorityx/utils → priorityx-0.2.2/src/priorityx/viz}/__init__.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/viz/matrix.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/viz/timeline.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/src/priorityx/viz/trajectory.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/tests/test_glmm.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/tests/test_quadrants.py +0 -0
- {priorityx-0.2.0 → priorityx-0.2.2}/tests/test_transitions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: priorityx
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Entity prioritization and escalation detection using GLMM statistical models
|
|
5
5
|
Project-URL: Homepage, https://github.com/okkymabruri/priorityx
|
|
6
6
|
Project-URL: Repository, https://github.com/okkymabruri/priorityx
|
|
@@ -49,7 +49,7 @@ pip install priorityx
|
|
|
49
49
|
Set `PRIORITYX_GLMM_SEED` (or call `set_glmm_random_seed()`) before running analyses to obtain repeatable GLMM estimates during debugging or CI checks:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
PRIORITYX_GLMM_SEED=1234 python
|
|
52
|
+
PRIORITYX_GLMM_SEED=1234 python your_script.py
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
```python
|
|
@@ -74,6 +74,7 @@ plot_priority_matrix(results, entity_name="Service", save_plot=True)
|
|
|
74
74
|
- GLMM-based priority matrix (Q1–Q4) with entity-level intercept/slope insights
|
|
75
75
|
- Priority-based transition timeline (Crisis / Investigate / Monitor / Low) with spike markers (`*X`, `*Y`, `*XY`)
|
|
76
76
|
- Cumulative movement tracking and trajectory visualizations
|
|
77
|
+
- Transition driver analysis that surfaces top subcategories causing quadrant shifts with spike summaries
|
|
77
78
|
- Deterministic seeding option for reproducible GLMM runs (set `PRIORITYX_GLMM_SEED`)
|
|
78
79
|
|
|
79
80
|
## Use Cases
|
|
@@ -21,7 +21,7 @@ pip install priorityx
|
|
|
21
21
|
Set `PRIORITYX_GLMM_SEED` (or call `set_glmm_random_seed()`) before running analyses to obtain repeatable GLMM estimates during debugging or CI checks:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
PRIORITYX_GLMM_SEED=1234 python
|
|
24
|
+
PRIORITYX_GLMM_SEED=1234 python your_script.py
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
```python
|
|
@@ -46,6 +46,7 @@ plot_priority_matrix(results, entity_name="Service", save_plot=True)
|
|
|
46
46
|
- GLMM-based priority matrix (Q1–Q4) with entity-level intercept/slope insights
|
|
47
47
|
- Priority-based transition timeline (Crisis / Investigate / Monitor / Low) with spike markers (`*X`, `*Y`, `*XY`)
|
|
48
48
|
- Cumulative movement tracking and trajectory visualizations
|
|
49
|
+
- Transition driver analysis that surfaces top subcategories causing quadrant shifts with spike summaries
|
|
49
50
|
- Deterministic seeding option for reproducible GLMM runs (set `PRIORITYX_GLMM_SEED`)
|
|
50
51
|
|
|
51
52
|
## Use Cases
|
|
@@ -100,8 +100,9 @@ analysis = extract_transition_drivers(
|
|
|
100
100
|
quarter_to="2024-Q3",
|
|
101
101
|
entity_col="service",
|
|
102
102
|
timestamp_col="date",
|
|
103
|
-
subcategory_cols=["type", "category"], # Optional
|
|
104
|
-
|
|
103
|
+
subcategory_cols=["type", "category"], # Optional override; auto-detected if omitted
|
|
104
|
+
top_n_subcategories=5,
|
|
105
|
+
min_subcategory_delta=2,
|
|
105
106
|
)
|
|
106
107
|
```
|
|
107
108
|
|
|
@@ -115,11 +116,18 @@ Analyzes root causes of a quadrant transition.
|
|
|
115
116
|
- `quarter_to`: Ending quarter (e.g., "2024-Q3")
|
|
116
117
|
- `entity_col`: Entity column name
|
|
117
118
|
- `timestamp_col`: Timestamp column name
|
|
118
|
-
- `subcategory_cols`: Optional list of subcategory columns
|
|
119
|
-
- `
|
|
119
|
+
- `subcategory_cols`: Optional list of subcategory columns (auto-detected when omitted)
|
|
120
|
+
- `top_n_subcategories`: Limit of subcategory drivers (default: 3)
|
|
121
|
+
- `min_subcategory_delta`: Minimum delta required for subcategory inclusion (default: 1)
|
|
120
122
|
|
|
121
123
|
**Returns:**
|
|
122
|
-
- Dictionary with
|
|
124
|
+
- Dictionary with:
|
|
125
|
+
- `transition`: includes risk-level change and `is_concerning` flag
|
|
126
|
+
- `magnitude`: cumulative deltas plus period-specific weekly averages and complaint counts
|
|
127
|
+
- `spike_drivers`: summary notes aligned with spike indicators (`*X`, `*Y`, `*XY`)
|
|
128
|
+
- `subcategory_drivers`: per-column driver lists obeying the provided knobs
|
|
129
|
+
- `priority`: priority tier, trigger reason, spike axis
|
|
130
|
+
- `meta`: diagnostic flags (e.g., whether subcategory columns were auto-detected)
|
|
123
131
|
|
|
124
132
|
### classify_priority
|
|
125
133
|
|
|
@@ -222,11 +230,10 @@ Prints formatted summaries of analysis results.
|
|
|
222
230
|
```python
|
|
223
231
|
from priorityx.tracking.drivers import display_transition_drivers
|
|
224
232
|
|
|
225
|
-
display_transition_drivers(analysis
|
|
233
|
+
display_transition_drivers(analysis)
|
|
226
234
|
```
|
|
227
235
|
|
|
228
236
|
Prints transition driver analysis in human-readable format.
|
|
229
237
|
|
|
230
238
|
**Parameters:**
|
|
231
239
|
- `analysis`: Output from extract_transition_drivers()
|
|
232
|
-
- `show_keywords`: Whether to show keyword analysis (default: False)
|
|
@@ -62,9 +62,14 @@ if not transitions.empty:
|
|
|
62
62
|
quarter_from=first_transition["from_quarter"],
|
|
63
63
|
quarter_to=first_transition["transition_quarter"],
|
|
64
64
|
entity_col="service",
|
|
65
|
-
timestamp_col="date"
|
|
65
|
+
timestamp_col="date",
|
|
66
|
+
top_n_subcategories=5,
|
|
67
|
+
min_subcategory_delta=2
|
|
66
68
|
)
|
|
67
69
|
display_transition_drivers(analysis)
|
|
70
|
+
|
|
71
|
+
# subcategory columns (e.g., severity/product/topic) are auto-detected
|
|
72
|
+
# when not provided; pass subcategory_cols=[...] to override.
|
|
68
73
|
```
|
|
69
74
|
|
|
70
75
|
## Data Requirements
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# it incident monitoring example
|
|
2
2
|
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from io import StringIO
|
|
5
|
+
|
|
3
6
|
import pandas as pd
|
|
7
|
+
import requests
|
|
8
|
+
|
|
9
|
+
RAW_DATA_URL = "https://raw.githubusercontent.com/okkymabruri/priorityx/main/examples/incidents/incidents.csv"
|
|
10
|
+
LOCAL_DATA_PATH = Path(__file__).parent / "incidents.csv"
|
|
4
11
|
|
|
5
12
|
from priorityx.core.glmm import fit_priority_matrix
|
|
6
13
|
from priorityx.tracking.movement import track_cumulative_movement
|
|
@@ -18,8 +25,15 @@ from priorityx.utils.helpers import (
|
|
|
18
25
|
save_dataframe_to_csv,
|
|
19
26
|
)
|
|
20
27
|
|
|
21
|
-
# load data
|
|
22
|
-
|
|
28
|
+
# load data (prefer hosted CSV so the example works out-of-the-box)
|
|
29
|
+
try:
|
|
30
|
+
response = requests.get(RAW_DATA_URL, timeout=10)
|
|
31
|
+
response.raise_for_status()
|
|
32
|
+
df = pd.read_csv(StringIO(response.text))
|
|
33
|
+
print("Loaded incidents from GitHub raw URL")
|
|
34
|
+
except Exception:
|
|
35
|
+
print("Falling back to local incidents.csv")
|
|
36
|
+
df = pd.read_csv(LOCAL_DATA_PATH)
|
|
23
37
|
df["date"] = pd.to_datetime(df["date"])
|
|
24
38
|
|
|
25
39
|
print(f"Loaded {len(df)} incidents for {df['service'].nunique()} services")
|
|
@@ -139,6 +153,8 @@ if len(critical_transitions) > 0:
|
|
|
139
153
|
quarter_to=trans["transition_quarter"],
|
|
140
154
|
entity_col="service",
|
|
141
155
|
timestamp_col="date",
|
|
156
|
+
top_n_subcategories=5,
|
|
157
|
+
min_subcategory_delta=2,
|
|
142
158
|
)
|
|
143
159
|
|
|
144
160
|
display_transition_drivers(driver_analysis)
|