lss4py 0.1.0__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.
- lss4py-0.1.0/PKG-INFO +303 -0
- lss4py-0.1.0/README.md +270 -0
- lss4py-0.1.0/pyproject.toml +112 -0
- lss4py-0.1.0/pyproject.toml.orig +103 -0
- lss4py-0.1.0/src/lss4py/__init__.py +53 -0
- lss4py-0.1.0/src/lss4py/adapters/__init__.py +4 -0
- lss4py-0.1.0/src/lss4py/adapters/event_log.py +8 -0
- lss4py-0.1.0/src/lss4py/adapters/tabular.py +7 -0
- lss4py-0.1.0/src/lss4py/analytics/__init__.py +3 -0
- lss4py-0.1.0/src/lss4py/analytics/capability.py +6 -0
- lss4py-0.1.0/src/lss4py/analytics/descriptive.py +8 -0
- lss4py-0.1.0/src/lss4py/analytics/spc.py +6 -0
- lss4py-0.1.0/src/lss4py/cli.py +16 -0
- lss4py-0.1.0/src/lss4py/domain/__init__.py +37 -0
- lss4py-0.1.0/src/lss4py/domain/models.py +126 -0
- lss4py-0.1.0/src/lss4py/domain/validation.py +30 -0
- lss4py-0.1.0/src/lss4py/errors.py +14 -0
- lss4py-0.1.0/src/lss4py/observability/__init__.py +4 -0
- lss4py-0.1.0/src/lss4py/observability/logging.py +35 -0
- lss4py-0.1.0/src/lss4py/observability/telemetry.py +19 -0
- lss4py-0.1.0/src/lss4py/reporting/__init__.py +3 -0
- lss4py-0.1.0/src/lss4py/reporting/bundles.py +14 -0
- lss4py-0.1.0/src/lss4py/workflows/__init__.py +3 -0
- lss4py-0.1.0/src/lss4py/workflows/bottleneck.py +6 -0
- lss4py-0.1.0/src/lss4py/workflows/comparison.py +6 -0
- lss4py-0.1.0/src/lss4py/workflows/process_map.py +49 -0
- lss4py-0.1.0/src/lss4py/workflows/simulation.py +6 -0
- lss4py-0.1.0/src/lss4py/yellow_belt.py +686 -0
lss4py-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lss4py
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python-first Lean Six Sigma analytics for telemetry-rich process improvement
|
|
5
|
+
Author: shanewilkins
|
|
6
|
+
Author-email: shanewilkins <shane@wilkinsadvisors.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Requires-Dist: click>=8.1.0
|
|
9
|
+
Requires-Dist: numpy>=2.2.0
|
|
10
|
+
Requires-Dist: opentelemetry-api>=1.31.0
|
|
11
|
+
Requires-Dist: opentelemetry-exporter-otlp>=1.31.0
|
|
12
|
+
Requires-Dist: opentelemetry-sdk>=1.31.0
|
|
13
|
+
Requires-Dist: pandas>=2.2.0
|
|
14
|
+
Requires-Dist: rich>=13.9.0
|
|
15
|
+
Requires-Dist: scipy>=1.15.0
|
|
16
|
+
Requires-Dist: statsmodels>=0.14.0
|
|
17
|
+
Requires-Dist: structlog>=24.4.0
|
|
18
|
+
Requires-Dist: pulp>=2.9.0 ; extra == 'optimization'
|
|
19
|
+
Requires-Dist: pyomo>=6.8.0 ; extra == 'optimization'
|
|
20
|
+
Requires-Dist: pm4py>=2.7.0 ; extra == 'process-mining'
|
|
21
|
+
Requires-Dist: simpy>=4.1.0 ; extra == 'simulation'
|
|
22
|
+
Requires-Dist: duckdb>=1.2.0 ; extra == 'storage'
|
|
23
|
+
Requires-Dist: pyarrow>=19.0.0 ; extra == 'storage'
|
|
24
|
+
Requires-Dist: matplotlib>=3.10.0 ; extra == 'visualization'
|
|
25
|
+
Requires-Dist: seaborn>=0.13.0 ; extra == 'visualization'
|
|
26
|
+
Requires-Python: >=3.14, <3.15
|
|
27
|
+
Provides-Extra: optimization
|
|
28
|
+
Provides-Extra: process-mining
|
|
29
|
+
Provides-Extra: simulation
|
|
30
|
+
Provides-Extra: storage
|
|
31
|
+
Provides-Extra: visualization
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# LSS4PY
|
|
35
|
+
|
|
36
|
+
LSS4PY is a Python 3.14 Lean Six Sigma utility library for the current Yellow Belt slice.
|
|
37
|
+
|
|
38
|
+
It is focused on repeatable process metrics and yield calculations.
|
|
39
|
+
|
|
40
|
+
It is not yet a full SPC, capability, simulation, or deliverables platform.
|
|
41
|
+
|
|
42
|
+
## Stable Today
|
|
43
|
+
|
|
44
|
+
The current stable surface is intentionally small.
|
|
45
|
+
|
|
46
|
+
It includes these public functions:
|
|
47
|
+
|
|
48
|
+
- `lead_time`
|
|
49
|
+
- `wait_time`
|
|
50
|
+
- `process_cycle_efficiency`
|
|
51
|
+
- `takt_time`
|
|
52
|
+
- `created_to_booked_yield`
|
|
53
|
+
- `booked_to_completed_yield`
|
|
54
|
+
- `rolled_yield`
|
|
55
|
+
|
|
56
|
+
It also includes a process-model IR for integrating FLO-derived process structure with observed tabular data:
|
|
57
|
+
|
|
58
|
+
- `ProcessModelIR`
|
|
59
|
+
- `ProcessStepIR`
|
|
60
|
+
- `ProcessEdgeIR`
|
|
61
|
+
- `MetricBindingsIR`
|
|
62
|
+
- `LeadTimeBindingIR`
|
|
63
|
+
- `StageBindingsIR`
|
|
64
|
+
- `MetricSemanticsIR`
|
|
65
|
+
- `EventLogBindingsIR`
|
|
66
|
+
|
|
67
|
+
It also includes stable event-log contracts and helpers:
|
|
68
|
+
|
|
69
|
+
- `EventLog`
|
|
70
|
+
- `validate_event_log`
|
|
71
|
+
- `map_process`
|
|
72
|
+
|
|
73
|
+
Topology-aware event-log calculations are also part of the current stable surface for:
|
|
74
|
+
|
|
75
|
+
- `lead_time`
|
|
76
|
+
- `wait_time`
|
|
77
|
+
- `process_cycle_efficiency`
|
|
78
|
+
|
|
79
|
+
## Contract
|
|
80
|
+
|
|
81
|
+
LSS4PY works from two inputs.
|
|
82
|
+
|
|
83
|
+
The FLO side supplies a normalized process model IR.
|
|
84
|
+
|
|
85
|
+
The pandas side supplies observed process data.
|
|
86
|
+
|
|
87
|
+
That is the current implementation contract. Proposed
|
|
88
|
+
[ADR-0004](docs/adr/0004-support-dataframe-neutral-inputs-and-results.md) replaces
|
|
89
|
+
the concrete pandas dependency with a tested dataframe-neutral boundary before the
|
|
90
|
+
analytical surface expands.
|
|
91
|
+
|
|
92
|
+
LSS4PY calculates metrics from both.
|
|
93
|
+
|
|
94
|
+
The IR defines process structure and semantic bindings.
|
|
95
|
+
|
|
96
|
+
The DataFrame provides timestamps, stage outcomes, and measured times.
|
|
97
|
+
|
|
98
|
+
Explicit per-call metric arguments override IR bindings.
|
|
99
|
+
|
|
100
|
+
Parallel paths and rework loops are represented in the IR with explicit graph edges.
|
|
101
|
+
|
|
102
|
+
Event-log rows are the canonical observed data shape for process-model-aware metrics.
|
|
103
|
+
|
|
104
|
+
The default elapsed-time interpretation for parallel paths is `critical_path` semantics.
|
|
105
|
+
|
|
106
|
+
An alternate `sum_all_branches` interpretation is also supported for event-log-aware calculations.
|
|
107
|
+
|
|
108
|
+
## Quick Start
|
|
109
|
+
|
|
110
|
+
### Requirements
|
|
111
|
+
|
|
112
|
+
- Python 3.14
|
|
113
|
+
- `uv`
|
|
114
|
+
|
|
115
|
+
### Install
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
uv sync
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Verify
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
uv run python -c "import lss4py; print('lss4py ready')"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Example
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
import pandas as pd
|
|
131
|
+
|
|
132
|
+
from lss4py import (
|
|
133
|
+
LeadTimeBindingIR,
|
|
134
|
+
MetricBindingsIR,
|
|
135
|
+
MetricSemanticsIR,
|
|
136
|
+
ProcessEdgeIR,
|
|
137
|
+
ProcessModelIR,
|
|
138
|
+
ProcessStepIR,
|
|
139
|
+
StageBindingsIR,
|
|
140
|
+
created_to_booked_yield,
|
|
141
|
+
lead_time,
|
|
142
|
+
process_cycle_efficiency,
|
|
143
|
+
rolled_yield,
|
|
144
|
+
wait_time,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
process_model = ProcessModelIR(
|
|
148
|
+
name="Client intake",
|
|
149
|
+
steps=[
|
|
150
|
+
ProcessStepIR(
|
|
151
|
+
id="review",
|
|
152
|
+
name="Review",
|
|
153
|
+
cycle_time_column="review_hours",
|
|
154
|
+
value_classification="non_value_add",
|
|
155
|
+
),
|
|
156
|
+
ProcessStepIR(
|
|
157
|
+
id="approve",
|
|
158
|
+
name="Approve",
|
|
159
|
+
cycle_time_column="approval_hours",
|
|
160
|
+
value_classification="value_add",
|
|
161
|
+
),
|
|
162
|
+
],
|
|
163
|
+
edges=[
|
|
164
|
+
ProcessEdgeIR(source_step_id="review", target_step_id="approve", kind="sequence"),
|
|
165
|
+
ProcessEdgeIR(source_step_id="approve", target_step_id="review", kind="rework"),
|
|
166
|
+
],
|
|
167
|
+
bindings=MetricBindingsIR(
|
|
168
|
+
lead_time=LeadTimeBindingIR(
|
|
169
|
+
start_column="created_at",
|
|
170
|
+
end_column="completed_at",
|
|
171
|
+
),
|
|
172
|
+
stages=StageBindingsIR(
|
|
173
|
+
created="created",
|
|
174
|
+
booked="booked",
|
|
175
|
+
completed="completed",
|
|
176
|
+
),
|
|
177
|
+
),
|
|
178
|
+
metric_semantics=MetricSemanticsIR(parallel_timing="critical_path"),
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
data = pd.DataFrame(
|
|
182
|
+
{
|
|
183
|
+
"created_at": ["2026-01-01T08:00:00", "2026-01-02T09:00:00"],
|
|
184
|
+
"completed_at": ["2026-01-01T18:00:00", "2026-01-02T15:00:00"],
|
|
185
|
+
"review_hours": [2.0, 1.0],
|
|
186
|
+
"approval_hours": [1.0, 2.0],
|
|
187
|
+
"created": [1, 1],
|
|
188
|
+
"booked": [1, 1],
|
|
189
|
+
"completed": [1, 0],
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
lead = lead_time(data, process_model=process_model)
|
|
194
|
+
wait = wait_time(data, process_model=process_model)
|
|
195
|
+
pce = process_cycle_efficiency(data, process_model=process_model)
|
|
196
|
+
created_booked = created_to_booked_yield(data, process_model=process_model)
|
|
197
|
+
rolled = rolled_yield(data, process_model=process_model)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## API Summary
|
|
201
|
+
|
|
202
|
+
### Basic Process Metrics
|
|
203
|
+
|
|
204
|
+
- `lead_time(data, ..., process_model=None)` returns per-row elapsed time from start to end timestamps.
|
|
205
|
+
- `wait_time(data, ..., process_model=None)` returns per-row lead time minus active cycle time.
|
|
206
|
+
- `process_cycle_efficiency(data, ..., process_model=None)` returns per-row value-add time divided by lead time.
|
|
207
|
+
- `takt_time(available_time=..., customer_demand=...)` returns a scalar pace target.
|
|
208
|
+
|
|
209
|
+
### Yield Helpers
|
|
210
|
+
|
|
211
|
+
- `created_to_booked_yield(data, ..., process_model=None)` returns first-stage conversion yield.
|
|
212
|
+
- `booked_to_completed_yield(data, ..., process_model=None)` returns second-stage conversion yield.
|
|
213
|
+
- `rolled_yield(data, ..., process_model=None)` returns end-to-end rolled yield.
|
|
214
|
+
|
|
215
|
+
### Process Model IR
|
|
216
|
+
|
|
217
|
+
- `ProcessModelIR` is the top-level FLO-compatible process model contract.
|
|
218
|
+
- `ProcessStepIR` defines step ids, names, cycle-time columns, and value classification.
|
|
219
|
+
- `ProcessEdgeIR` defines sequence, parallel split, parallel join, and rework edges.
|
|
220
|
+
- `MetricBindingsIR` groups lead-time and stage-column bindings.
|
|
221
|
+
- `MetricSemanticsIR` defines process-metric interpretation defaults such as parallel timing.
|
|
222
|
+
- `EventLogBindingsIR` defines the case, step, start, and end columns for event-log-aware metrics.
|
|
223
|
+
|
|
224
|
+
### Event-Log Contracts And Helpers
|
|
225
|
+
|
|
226
|
+
- `EventLog` represents the observed event-log contract used by stable event-log helpers.
|
|
227
|
+
- `validate_event_log(event_log)` returns machine-readable warnings for empty logs or missing required event fields.
|
|
228
|
+
- `map_process(event_log)` returns discovered activity nodes and transition counts from observed event order.
|
|
229
|
+
|
|
230
|
+
### Topology-Aware Event-Log Metrics
|
|
231
|
+
|
|
232
|
+
- event-log-aware `lead_time` uses per-case event boundaries from observed rows.
|
|
233
|
+
- event-log-aware `wait_time` supports branch-aware elapsed work from explicit parallel edges.
|
|
234
|
+
- event-log-aware `process_cycle_efficiency` supports value-add calculations across parallel and rework-aware event logs.
|
|
235
|
+
- repeated step occurrences require explicit rework edges in the process model.
|
|
236
|
+
- overlapping step intervals require explicit parallel edges in the process model.
|
|
237
|
+
|
|
238
|
+
## What Is Not Stable Yet
|
|
239
|
+
|
|
240
|
+
These areas are not part of the stable book-facing API today:
|
|
241
|
+
|
|
242
|
+
- capability analysis
|
|
243
|
+
- SPC reporting
|
|
244
|
+
- simulation workflows
|
|
245
|
+
- bottleneck workflows
|
|
246
|
+
- before/after comparison workflows
|
|
247
|
+
- reporting bundles
|
|
248
|
+
- automatic `.flo` parsing inside `lss4py`
|
|
249
|
+
|
|
250
|
+
The IR and metric engine now support stable topology-aware event-log calculations for the current Yellow Belt slice.
|
|
251
|
+
|
|
252
|
+
Broader graph-driven semantics outside that slice are still future work.
|
|
253
|
+
|
|
254
|
+
## Development Status
|
|
255
|
+
|
|
256
|
+
This repository is in active pre-1.0 development.
|
|
257
|
+
|
|
258
|
+
The Yellow Belt metric surface above is the current stable target.
|
|
259
|
+
|
|
260
|
+
Other modules and ideas in the repository should be treated as experimental, internal, or future work unless they are explicitly listed in the stable surface.
|
|
261
|
+
|
|
262
|
+
## Validation
|
|
263
|
+
|
|
264
|
+
The repository is currently validated with:
|
|
265
|
+
|
|
266
|
+
- `uv lock --check`
|
|
267
|
+
- `uv run --locked lint-imports`
|
|
268
|
+
- `uv sync`
|
|
269
|
+
- `uv run --locked ruff check .`
|
|
270
|
+
- `uv run --locked pyright`
|
|
271
|
+
- `uv run --locked xenon --max-absolute B --max-modules A --max-average A src/lss4py tests`
|
|
272
|
+
- `uv run --locked pytest`
|
|
273
|
+
- `uv run --locked vulture src tests --min-confidence 80`
|
|
274
|
+
|
|
275
|
+
Install both local hook stages with:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
uv run pre-commit install --install-hooks --hook-type pre-commit --hook-type pre-push
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
The `pre-commit` stage runs Ruff on changed files and the locked test suite without coverage.
|
|
282
|
+
|
|
283
|
+
The `pre-push` stage and CI run the full locked repository-wide gates.
|
|
284
|
+
|
|
285
|
+
CI additionally enforces 95% coverage on the current supported slice and runs a
|
|
286
|
+
built-wheel smoke test outside the source tree.
|
|
287
|
+
|
|
288
|
+
## Roadmap
|
|
289
|
+
|
|
290
|
+
The governed [roadmap](docs/roadmap.md) targets a complete Yellow Belt MVP at
|
|
291
|
+
v0.3, Green Belt capability at v0.5, Black Belt capability at v0.7, and a
|
|
292
|
+
feature-frozen polish phase at v0.9 before the stable 1.0 contract.
|
|
293
|
+
|
|
294
|
+
See the [documentation index](docs/README.md) for user requirements, technical
|
|
295
|
+
requirements, ADRs, and governance conventions. R `SixSigma` coverage is tracked
|
|
296
|
+
separately in the [compatibility matrix](docs/sixsigma-compatibility.md).
|
|
297
|
+
|
|
298
|
+
## License
|
|
299
|
+
|
|
300
|
+
LSS4PY is available under the [MIT License](LICENSE.md).
|
|
301
|
+
|
|
302
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) to contribute and
|
|
303
|
+
[SECURITY.md](SECURITY.md) to report a vulnerability privately.
|
lss4py-0.1.0/README.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# LSS4PY
|
|
2
|
+
|
|
3
|
+
LSS4PY is a Python 3.14 Lean Six Sigma utility library for the current Yellow Belt slice.
|
|
4
|
+
|
|
5
|
+
It is focused on repeatable process metrics and yield calculations.
|
|
6
|
+
|
|
7
|
+
It is not yet a full SPC, capability, simulation, or deliverables platform.
|
|
8
|
+
|
|
9
|
+
## Stable Today
|
|
10
|
+
|
|
11
|
+
The current stable surface is intentionally small.
|
|
12
|
+
|
|
13
|
+
It includes these public functions:
|
|
14
|
+
|
|
15
|
+
- `lead_time`
|
|
16
|
+
- `wait_time`
|
|
17
|
+
- `process_cycle_efficiency`
|
|
18
|
+
- `takt_time`
|
|
19
|
+
- `created_to_booked_yield`
|
|
20
|
+
- `booked_to_completed_yield`
|
|
21
|
+
- `rolled_yield`
|
|
22
|
+
|
|
23
|
+
It also includes a process-model IR for integrating FLO-derived process structure with observed tabular data:
|
|
24
|
+
|
|
25
|
+
- `ProcessModelIR`
|
|
26
|
+
- `ProcessStepIR`
|
|
27
|
+
- `ProcessEdgeIR`
|
|
28
|
+
- `MetricBindingsIR`
|
|
29
|
+
- `LeadTimeBindingIR`
|
|
30
|
+
- `StageBindingsIR`
|
|
31
|
+
- `MetricSemanticsIR`
|
|
32
|
+
- `EventLogBindingsIR`
|
|
33
|
+
|
|
34
|
+
It also includes stable event-log contracts and helpers:
|
|
35
|
+
|
|
36
|
+
- `EventLog`
|
|
37
|
+
- `validate_event_log`
|
|
38
|
+
- `map_process`
|
|
39
|
+
|
|
40
|
+
Topology-aware event-log calculations are also part of the current stable surface for:
|
|
41
|
+
|
|
42
|
+
- `lead_time`
|
|
43
|
+
- `wait_time`
|
|
44
|
+
- `process_cycle_efficiency`
|
|
45
|
+
|
|
46
|
+
## Contract
|
|
47
|
+
|
|
48
|
+
LSS4PY works from two inputs.
|
|
49
|
+
|
|
50
|
+
The FLO side supplies a normalized process model IR.
|
|
51
|
+
|
|
52
|
+
The pandas side supplies observed process data.
|
|
53
|
+
|
|
54
|
+
That is the current implementation contract. Proposed
|
|
55
|
+
[ADR-0004](docs/adr/0004-support-dataframe-neutral-inputs-and-results.md) replaces
|
|
56
|
+
the concrete pandas dependency with a tested dataframe-neutral boundary before the
|
|
57
|
+
analytical surface expands.
|
|
58
|
+
|
|
59
|
+
LSS4PY calculates metrics from both.
|
|
60
|
+
|
|
61
|
+
The IR defines process structure and semantic bindings.
|
|
62
|
+
|
|
63
|
+
The DataFrame provides timestamps, stage outcomes, and measured times.
|
|
64
|
+
|
|
65
|
+
Explicit per-call metric arguments override IR bindings.
|
|
66
|
+
|
|
67
|
+
Parallel paths and rework loops are represented in the IR with explicit graph edges.
|
|
68
|
+
|
|
69
|
+
Event-log rows are the canonical observed data shape for process-model-aware metrics.
|
|
70
|
+
|
|
71
|
+
The default elapsed-time interpretation for parallel paths is `critical_path` semantics.
|
|
72
|
+
|
|
73
|
+
An alternate `sum_all_branches` interpretation is also supported for event-log-aware calculations.
|
|
74
|
+
|
|
75
|
+
## Quick Start
|
|
76
|
+
|
|
77
|
+
### Requirements
|
|
78
|
+
|
|
79
|
+
- Python 3.14
|
|
80
|
+
- `uv`
|
|
81
|
+
|
|
82
|
+
### Install
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
uv sync
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Verify
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uv run python -c "import lss4py; print('lss4py ready')"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Example
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
import pandas as pd
|
|
98
|
+
|
|
99
|
+
from lss4py import (
|
|
100
|
+
LeadTimeBindingIR,
|
|
101
|
+
MetricBindingsIR,
|
|
102
|
+
MetricSemanticsIR,
|
|
103
|
+
ProcessEdgeIR,
|
|
104
|
+
ProcessModelIR,
|
|
105
|
+
ProcessStepIR,
|
|
106
|
+
StageBindingsIR,
|
|
107
|
+
created_to_booked_yield,
|
|
108
|
+
lead_time,
|
|
109
|
+
process_cycle_efficiency,
|
|
110
|
+
rolled_yield,
|
|
111
|
+
wait_time,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
process_model = ProcessModelIR(
|
|
115
|
+
name="Client intake",
|
|
116
|
+
steps=[
|
|
117
|
+
ProcessStepIR(
|
|
118
|
+
id="review",
|
|
119
|
+
name="Review",
|
|
120
|
+
cycle_time_column="review_hours",
|
|
121
|
+
value_classification="non_value_add",
|
|
122
|
+
),
|
|
123
|
+
ProcessStepIR(
|
|
124
|
+
id="approve",
|
|
125
|
+
name="Approve",
|
|
126
|
+
cycle_time_column="approval_hours",
|
|
127
|
+
value_classification="value_add",
|
|
128
|
+
),
|
|
129
|
+
],
|
|
130
|
+
edges=[
|
|
131
|
+
ProcessEdgeIR(source_step_id="review", target_step_id="approve", kind="sequence"),
|
|
132
|
+
ProcessEdgeIR(source_step_id="approve", target_step_id="review", kind="rework"),
|
|
133
|
+
],
|
|
134
|
+
bindings=MetricBindingsIR(
|
|
135
|
+
lead_time=LeadTimeBindingIR(
|
|
136
|
+
start_column="created_at",
|
|
137
|
+
end_column="completed_at",
|
|
138
|
+
),
|
|
139
|
+
stages=StageBindingsIR(
|
|
140
|
+
created="created",
|
|
141
|
+
booked="booked",
|
|
142
|
+
completed="completed",
|
|
143
|
+
),
|
|
144
|
+
),
|
|
145
|
+
metric_semantics=MetricSemanticsIR(parallel_timing="critical_path"),
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
data = pd.DataFrame(
|
|
149
|
+
{
|
|
150
|
+
"created_at": ["2026-01-01T08:00:00", "2026-01-02T09:00:00"],
|
|
151
|
+
"completed_at": ["2026-01-01T18:00:00", "2026-01-02T15:00:00"],
|
|
152
|
+
"review_hours": [2.0, 1.0],
|
|
153
|
+
"approval_hours": [1.0, 2.0],
|
|
154
|
+
"created": [1, 1],
|
|
155
|
+
"booked": [1, 1],
|
|
156
|
+
"completed": [1, 0],
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
lead = lead_time(data, process_model=process_model)
|
|
161
|
+
wait = wait_time(data, process_model=process_model)
|
|
162
|
+
pce = process_cycle_efficiency(data, process_model=process_model)
|
|
163
|
+
created_booked = created_to_booked_yield(data, process_model=process_model)
|
|
164
|
+
rolled = rolled_yield(data, process_model=process_model)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## API Summary
|
|
168
|
+
|
|
169
|
+
### Basic Process Metrics
|
|
170
|
+
|
|
171
|
+
- `lead_time(data, ..., process_model=None)` returns per-row elapsed time from start to end timestamps.
|
|
172
|
+
- `wait_time(data, ..., process_model=None)` returns per-row lead time minus active cycle time.
|
|
173
|
+
- `process_cycle_efficiency(data, ..., process_model=None)` returns per-row value-add time divided by lead time.
|
|
174
|
+
- `takt_time(available_time=..., customer_demand=...)` returns a scalar pace target.
|
|
175
|
+
|
|
176
|
+
### Yield Helpers
|
|
177
|
+
|
|
178
|
+
- `created_to_booked_yield(data, ..., process_model=None)` returns first-stage conversion yield.
|
|
179
|
+
- `booked_to_completed_yield(data, ..., process_model=None)` returns second-stage conversion yield.
|
|
180
|
+
- `rolled_yield(data, ..., process_model=None)` returns end-to-end rolled yield.
|
|
181
|
+
|
|
182
|
+
### Process Model IR
|
|
183
|
+
|
|
184
|
+
- `ProcessModelIR` is the top-level FLO-compatible process model contract.
|
|
185
|
+
- `ProcessStepIR` defines step ids, names, cycle-time columns, and value classification.
|
|
186
|
+
- `ProcessEdgeIR` defines sequence, parallel split, parallel join, and rework edges.
|
|
187
|
+
- `MetricBindingsIR` groups lead-time and stage-column bindings.
|
|
188
|
+
- `MetricSemanticsIR` defines process-metric interpretation defaults such as parallel timing.
|
|
189
|
+
- `EventLogBindingsIR` defines the case, step, start, and end columns for event-log-aware metrics.
|
|
190
|
+
|
|
191
|
+
### Event-Log Contracts And Helpers
|
|
192
|
+
|
|
193
|
+
- `EventLog` represents the observed event-log contract used by stable event-log helpers.
|
|
194
|
+
- `validate_event_log(event_log)` returns machine-readable warnings for empty logs or missing required event fields.
|
|
195
|
+
- `map_process(event_log)` returns discovered activity nodes and transition counts from observed event order.
|
|
196
|
+
|
|
197
|
+
### Topology-Aware Event-Log Metrics
|
|
198
|
+
|
|
199
|
+
- event-log-aware `lead_time` uses per-case event boundaries from observed rows.
|
|
200
|
+
- event-log-aware `wait_time` supports branch-aware elapsed work from explicit parallel edges.
|
|
201
|
+
- event-log-aware `process_cycle_efficiency` supports value-add calculations across parallel and rework-aware event logs.
|
|
202
|
+
- repeated step occurrences require explicit rework edges in the process model.
|
|
203
|
+
- overlapping step intervals require explicit parallel edges in the process model.
|
|
204
|
+
|
|
205
|
+
## What Is Not Stable Yet
|
|
206
|
+
|
|
207
|
+
These areas are not part of the stable book-facing API today:
|
|
208
|
+
|
|
209
|
+
- capability analysis
|
|
210
|
+
- SPC reporting
|
|
211
|
+
- simulation workflows
|
|
212
|
+
- bottleneck workflows
|
|
213
|
+
- before/after comparison workflows
|
|
214
|
+
- reporting bundles
|
|
215
|
+
- automatic `.flo` parsing inside `lss4py`
|
|
216
|
+
|
|
217
|
+
The IR and metric engine now support stable topology-aware event-log calculations for the current Yellow Belt slice.
|
|
218
|
+
|
|
219
|
+
Broader graph-driven semantics outside that slice are still future work.
|
|
220
|
+
|
|
221
|
+
## Development Status
|
|
222
|
+
|
|
223
|
+
This repository is in active pre-1.0 development.
|
|
224
|
+
|
|
225
|
+
The Yellow Belt metric surface above is the current stable target.
|
|
226
|
+
|
|
227
|
+
Other modules and ideas in the repository should be treated as experimental, internal, or future work unless they are explicitly listed in the stable surface.
|
|
228
|
+
|
|
229
|
+
## Validation
|
|
230
|
+
|
|
231
|
+
The repository is currently validated with:
|
|
232
|
+
|
|
233
|
+
- `uv lock --check`
|
|
234
|
+
- `uv run --locked lint-imports`
|
|
235
|
+
- `uv sync`
|
|
236
|
+
- `uv run --locked ruff check .`
|
|
237
|
+
- `uv run --locked pyright`
|
|
238
|
+
- `uv run --locked xenon --max-absolute B --max-modules A --max-average A src/lss4py tests`
|
|
239
|
+
- `uv run --locked pytest`
|
|
240
|
+
- `uv run --locked vulture src tests --min-confidence 80`
|
|
241
|
+
|
|
242
|
+
Install both local hook stages with:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
uv run pre-commit install --install-hooks --hook-type pre-commit --hook-type pre-push
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The `pre-commit` stage runs Ruff on changed files and the locked test suite without coverage.
|
|
249
|
+
|
|
250
|
+
The `pre-push` stage and CI run the full locked repository-wide gates.
|
|
251
|
+
|
|
252
|
+
CI additionally enforces 95% coverage on the current supported slice and runs a
|
|
253
|
+
built-wheel smoke test outside the source tree.
|
|
254
|
+
|
|
255
|
+
## Roadmap
|
|
256
|
+
|
|
257
|
+
The governed [roadmap](docs/roadmap.md) targets a complete Yellow Belt MVP at
|
|
258
|
+
v0.3, Green Belt capability at v0.5, Black Belt capability at v0.7, and a
|
|
259
|
+
feature-frozen polish phase at v0.9 before the stable 1.0 contract.
|
|
260
|
+
|
|
261
|
+
See the [documentation index](docs/README.md) for user requirements, technical
|
|
262
|
+
requirements, ADRs, and governance conventions. R `SixSigma` coverage is tracked
|
|
263
|
+
separately in the [compatibility matrix](docs/sixsigma-compatibility.md).
|
|
264
|
+
|
|
265
|
+
## License
|
|
266
|
+
|
|
267
|
+
LSS4PY is available under the [MIT License](LICENSE.md).
|
|
268
|
+
|
|
269
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) to contribute and
|
|
270
|
+
[SECURITY.md](SECURITY.md) to report a vulnerability privately.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "lss4py"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Python-first Lean Six Sigma analytics for telemetry-rich process improvement"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
requires-python = ">=3.14,<3.15"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"click>=8.1.0",
|
|
10
|
+
"numpy>=2.2.0",
|
|
11
|
+
"opentelemetry-api>=1.31.0",
|
|
12
|
+
"opentelemetry-exporter-otlp>=1.31.0",
|
|
13
|
+
"opentelemetry-sdk>=1.31.0",
|
|
14
|
+
"pandas>=2.2.0",
|
|
15
|
+
"rich>=13.9.0",
|
|
16
|
+
"scipy>=1.15.0",
|
|
17
|
+
"statsmodels>=0.14.0",
|
|
18
|
+
"structlog>=24.4.0",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[[project.authors]]
|
|
22
|
+
name = "shanewilkins"
|
|
23
|
+
email = "shane@wilkinsadvisors.com"
|
|
24
|
+
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
process-mining = ["pm4py>=2.7.0"]
|
|
27
|
+
simulation = ["simpy>=4.1.0"]
|
|
28
|
+
optimization = [
|
|
29
|
+
"pulp>=2.9.0",
|
|
30
|
+
"pyomo>=6.8.0",
|
|
31
|
+
]
|
|
32
|
+
visualization = [
|
|
33
|
+
"matplotlib>=3.10.0",
|
|
34
|
+
"seaborn>=0.13.0",
|
|
35
|
+
]
|
|
36
|
+
storage = [
|
|
37
|
+
"duckdb>=1.2.0",
|
|
38
|
+
"pyarrow>=19.0.0",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
lss4py = "lss4py.cli:main"
|
|
43
|
+
|
|
44
|
+
[build-system]
|
|
45
|
+
requires = ["uv_build>=0.10.0,<0.13.0"]
|
|
46
|
+
build-backend = "uv_build"
|
|
47
|
+
|
|
48
|
+
[dependency-groups]
|
|
49
|
+
dev = [
|
|
50
|
+
"import-linter>=2.1",
|
|
51
|
+
"pre-commit>=4.1.0",
|
|
52
|
+
"pyright>=1.1.390",
|
|
53
|
+
"pytest>=8.3.0",
|
|
54
|
+
"pytest-cov>=6.0.0",
|
|
55
|
+
"ruff>=0.9.0",
|
|
56
|
+
"vulture>=2.13",
|
|
57
|
+
"xenon>=0.9.3",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.ruff]
|
|
61
|
+
line-length = 100
|
|
62
|
+
target-version = "py314"
|
|
63
|
+
|
|
64
|
+
[tool.ruff.lint]
|
|
65
|
+
select = [
|
|
66
|
+
"E",
|
|
67
|
+
"F",
|
|
68
|
+
"I",
|
|
69
|
+
"UP",
|
|
70
|
+
"B",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[tool.pytest.ini_options]
|
|
74
|
+
testpaths = ["tests"]
|
|
75
|
+
addopts = "-q"
|
|
76
|
+
|
|
77
|
+
[tool.coverage.run]
|
|
78
|
+
source = ["src/lss4py"]
|
|
79
|
+
omit = [
|
|
80
|
+
"src/lss4py/adapters/*",
|
|
81
|
+
"src/lss4py/analytics/*",
|
|
82
|
+
"src/lss4py/cli.py",
|
|
83
|
+
"src/lss4py/observability/*",
|
|
84
|
+
"src/lss4py/reporting/*",
|
|
85
|
+
"src/lss4py/workflows/bottleneck.py",
|
|
86
|
+
"src/lss4py/workflows/comparison.py",
|
|
87
|
+
"src/lss4py/workflows/simulation.py",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[tool.coverage.report]
|
|
91
|
+
fail_under = 95
|
|
92
|
+
show_missing = true
|
|
93
|
+
skip_covered = true
|
|
94
|
+
|
|
95
|
+
[tool.pyright]
|
|
96
|
+
pythonVersion = "3.14"
|
|
97
|
+
typeCheckingMode = "standard"
|
|
98
|
+
include = [
|
|
99
|
+
"src",
|
|
100
|
+
"tests",
|
|
101
|
+
]
|
|
102
|
+
venvPath = "."
|
|
103
|
+
venv = ".venv"
|
|
104
|
+
reportMissingTypeStubs = false
|
|
105
|
+
|
|
106
|
+
[tool.vulture]
|
|
107
|
+
paths = [
|
|
108
|
+
"src",
|
|
109
|
+
"tests",
|
|
110
|
+
]
|
|
111
|
+
min_confidence = 80
|
|
112
|
+
exclude = ["*/__init__.py"]
|