perfact-api-pd-fastapi 1.8__tar.gz → 1.9__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 (29) hide show
  1. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/PKG-INFO +1 -1
  2. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/kpi.py +7 -6
  3. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/PKG-INFO +1 -1
  4. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/scm_version.json +2 -2
  5. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/README.md +0 -0
  6. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/pyproject.toml +0 -0
  7. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/setup.cfg +0 -0
  8. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/__init__.py +0 -0
  9. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/grafana.py +0 -0
  10. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/pdunit.py +0 -0
  11. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/pdunitlch.py +0 -0
  12. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/performancedata.py +0 -0
  13. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/py.typed +0 -0
  14. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/SOURCES.txt +0 -0
  15. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/dependency_links.txt +0 -0
  16. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/entry_points.txt +0 -0
  17. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/requires.txt +0 -0
  18. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/scm_file_list.json +0 -0
  19. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/top_level.txt +0 -0
  20. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/__init__.py +0 -0
  21. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/conftest.py +0 -0
  22. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/helpers.py +0 -0
  23. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/locustfile.py +0 -0
  24. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_init.py +0 -0
  25. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_kpi.py +0 -0
  26. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_pdunit.py +0 -0
  27. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_pdunitlch.py +0 -0
  28. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_performance.py +0 -0
  29. {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: perfact-api-pd-fastapi
3
- Version: 1.8
3
+ Version: 1.9
4
4
  Summary: PerFact API - SQLAlchemy+FastAPI pd apis package
5
5
  Author-email: Viktor Dick <viktor.dick@perfact.de>
6
6
  License-Expression: GPL-2.0-or-later
@@ -51,11 +51,12 @@ def oee_availability(
51
51
  session: DBSession,
52
52
  starttime: datetime,
53
53
  stoptime: datetime,
54
- ) -> float:
54
+ ) -> float | None:
55
55
  """
56
56
  Route for OEE availability
57
57
  Uses the availability_computation function
58
- Returns single floating point value
58
+ Returns a single floating point value, or null when neither execution nor
59
+ shift-overlapping downtime happened in the window.
59
60
  """
60
61
 
61
62
  spans = get_state_spans(session, unit.id, starttime, stoptime)
@@ -109,7 +110,7 @@ class OEECalculationResponse(BaseModel):
109
110
  See ADR 0003.
110
111
  """
111
112
 
112
- availability: float
113
+ availability: float | None
113
114
  performance: float | None
114
115
  quality: float | None
115
116
  oee: float | None
@@ -129,7 +130,7 @@ def oee_calculation(
129
130
  starttime: datetime,
130
131
  stoptime: datetime,
131
132
  ) -> OEECalculationResponse:
132
- """OEE with time breakdown and quantity aggregates for one work centre."""
133
+ """OEE with time breakdown and quantity aggregates for one work center."""
133
134
  spans = get_state_spans(session, unit.id, starttime, stoptime)
134
135
  shifts = list(session.scalars(unit.shifts_in_range_stmt(starttime, stoptime)).all())
135
136
  availability = compute_availability(spans, shifts, starttime, stoptime)
@@ -141,7 +142,7 @@ def oee_calculation(
141
142
  quality = compute_quality(prod_records, starttime, stoptime)
142
143
  oee = (
143
144
  availability * performance * quality
144
- if performance is not None and quality is not None
145
+ if availability is not None and performance is not None and quality is not None
145
146
  else None
146
147
  )
147
148
  summary = oee_workcenter_time_computation(session, unit.id, starttime, stoptime)
@@ -161,7 +162,7 @@ class OEEBreakdownResponse(BaseModel):
161
162
  unplanned_downtime_seconds: float
162
163
  setup_time_deviation_seconds: float
163
164
  productive_time_seconds: float
164
- availability: float
165
+ availability: float | None
165
166
  performance: float | None
166
167
  quality: float | None
167
168
  oee: float | None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: perfact-api-pd-fastapi
3
- Version: 1.8
3
+ Version: 1.9
4
4
  Summary: PerFact API - SQLAlchemy+FastAPI pd apis package
5
5
  Author-email: Viktor Dick <viktor.dick@perfact.de>
6
6
  License-Expression: GPL-2.0-or-later
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "1.8",
2
+ "tag": "1.9",
3
3
  "distance": 0,
4
- "node": "gabbf5b824885446fb287a1a5d88e4faed71b933e",
4
+ "node": "gfc11733401eef28f83b9882cf1dc4406e8965a8d",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-07-31"