batch-analytics 0.3.28__tar.gz → 0.3.30__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.
Files changed (33) hide show
  1. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/PKG-INFO +1 -1
  2. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/pyproject.toml +1 -1
  3. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/analytics/equipment_oee.py +20 -8
  4. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/config.py +4 -0
  5. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics.egg-info/PKG-INFO +1 -1
  6. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/README.md +0 -0
  7. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/setup.cfg +0 -0
  8. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/__init__.py +0 -0
  9. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/__main__.py +0 -0
  10. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/analytics/__init__.py +0 -0
  11. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/analytics/correlation.py +0 -0
  12. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/analytics/gluon_autogluon_infer.py +0 -0
  13. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/analytics/gluon_autogluon_train.py +0 -0
  14. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/analytics/linear_regression.py +0 -0
  15. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/analytics/pca_clustering.py +0 -0
  16. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/analytics/t_test.py +0 -0
  17. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/extract.py +0 -0
  18. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/job_runner.py +0 -0
  19. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/log.py +0 -0
  20. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/modules.py +0 -0
  21. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/output/__init__.py +0 -0
  22. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/output/base.py +0 -0
  23. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/output/clickhouse.py +0 -0
  24. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/output/local.py +0 -0
  25. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/output/s3.py +0 -0
  26. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/transform.py +0 -0
  27. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/utils/__init__.py +0 -0
  28. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics/utils/gluon_autogluon_common.py +0 -0
  29. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics.egg-info/SOURCES.txt +0 -0
  30. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics.egg-info/dependency_links.txt +0 -0
  31. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics.egg-info/entry_points.txt +0 -0
  32. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics.egg-info/requires.txt +0 -0
  33. {batch_analytics-0.3.28 → batch_analytics-0.3.30}/src/batch_analytics.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: batch-analytics
3
- Version: 0.3.28
3
+ Version: 0.3.30
4
4
  Summary: PySpark batch analytics: Extract, Transform, Stage, and analytical modules (linear regression, correlation, PCA, t-test).
5
5
  Author: Litewave Analytics Team
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "batch-analytics"
7
- version = "0.3.28"
7
+ version = "0.3.30"
8
8
  description = "PySpark batch analytics: Extract, Transform, Stage, and analytical modules (linear regression, correlation, PCA, t-test)."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -137,7 +137,13 @@ def run_equipment_oee(
137
137
  ideal = _load_ideal_cycle(spark, config)
138
138
  avail = _staging_availability(df)
139
139
  perf_ops = _staging_performance(df, ideal)
140
- perf_tot = _staging_performance_totals(df, ideal)
140
+ # Only ideal totals are joined here; avail already has actual_run_minutes.
141
+ # Keeping both would make F.col("actual_run_minutes") ambiguous after the join.
142
+ perf_tot = _staging_performance_totals(df, ideal).select(
143
+ "equipment_id",
144
+ "batch_id",
145
+ "ideal_cycle_time_minutes",
146
+ )
141
147
 
142
148
  joined = (
143
149
  avail.join(perf_tot, on=["equipment_id", "batch_id"], how="inner")
@@ -189,13 +195,19 @@ def run_equipment_oee(
189
195
  n = result_df.count()
190
196
  logger.info("equipment_oee: %d equipment×batch rows", n)
191
197
 
192
- return {
198
+ out: Dict[str, Any] = {
193
199
  "row_count": n,
194
- "staging_availability": _rows_to_dicts(avail.orderBy("equipment_id", "batch_id")),
195
- "staging_batch_quality": _rows_to_dicts(batch_q.orderBy("batch_id")),
196
- "staging_ideal_cycle": _rows_to_dicts(ideal.orderBy("equipment_id", "operation_id")),
197
- "staging_performance_by_operation": _rows_to_dicts(
198
- perf_ops.orderBy("equipment_id", "batch_id", "operation_id")
199
- ),
200
200
  "equipment_oee": _rows_to_dicts(result_df),
201
201
  }
202
+ if config.analytics.equipment_oee_include_staging:
203
+ out["staging_availability"] = _rows_to_dicts(
204
+ avail.orderBy("equipment_id", "batch_id")
205
+ )
206
+ out["staging_batch_quality"] = _rows_to_dicts(batch_q.orderBy("batch_id"))
207
+ out["staging_ideal_cycle"] = _rows_to_dicts(
208
+ ideal.orderBy("equipment_id", "operation_id")
209
+ )
210
+ out["staging_performance_by_operation"] = _rows_to_dicts(
211
+ perf_ops.orderBy("equipment_id", "batch_id", "operation_id")
212
+ )
213
+ return out
@@ -184,6 +184,10 @@ class AnalyticsConfig:
184
184
  equipment_oee_ideal_cycle_table: str = os.environ.get(
185
185
  "BATCH_OEE_IDEAL_CYCLE_TABLE", ""
186
186
  ).strip()
187
+ # If true, equipment_oee result includes intermediate staging_* arrays (large payloads).
188
+ equipment_oee_include_staging: bool = os.environ.get(
189
+ "BATCH_OEE_INCLUDE_STAGING", ""
190
+ ).lower() in ("true", "1", "yes", "on")
187
191
 
188
192
 
189
193
  @dataclass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: batch-analytics
3
- Version: 0.3.28
3
+ Version: 0.3.30
4
4
  Summary: PySpark batch analytics: Extract, Transform, Stage, and analytical modules (linear regression, correlation, PCA, t-test).
5
5
  Author: Litewave Analytics Team
6
6
  License: MIT