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.
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/PKG-INFO +1 -1
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/kpi.py +7 -6
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/PKG-INFO +1 -1
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/scm_version.json +2 -2
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/README.md +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/pyproject.toml +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/setup.cfg +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/__init__.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/grafana.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/pdunit.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/pdunitlch.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/performancedata.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/py.typed +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/SOURCES.txt +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/dependency_links.txt +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/entry_points.txt +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/requires.txt +0 -0
- {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
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact_api_pd_fastapi.egg-info/top_level.txt +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/__init__.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/conftest.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/helpers.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/locustfile.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_init.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_kpi.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_pdunit.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_pdunitlch.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tests/test_performance.py +0 -0
- {perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/tox.ini +0 -0
|
@@ -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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/__init__.py
RENAMED
|
File without changes
|
{perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/grafana.py
RENAMED
|
File without changes
|
{perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/pdunit.py
RENAMED
|
File without changes
|
{perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/pdunitlch.py
RENAMED
|
File without changes
|
|
File without changes
|
{perfact_api_pd_fastapi-1.8 → perfact_api_pd_fastapi-1.9}/src/perfact/api/pd_fastapi/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|