SIENTIAPDE-1478

SIENTIAPDE-1478 Update tests.ipynb execution counts, modify timestamps, and enhance API class for PI Web API integration

- Adjusted execution counts in tests.ipynb for consistency.
- Updated timestamps in test outputs to reflect new data.
- Refactored API class to streamline data writing to PI Web API by removing redundant endpoint handling.
This commit is contained in:
vitor-aignosi
2026-01-21 15:34:58 -03:00
parent 9d7268aa0e
commit 276fe6f623
3 changed files with 213 additions and 157 deletions

View File

@@ -192,17 +192,12 @@ class API(SientiaMonitoring):
self.info(f'Writing data to PI Web API... config: {pi_web_api_output_config}', metadata)
endpoint = pi_web_api_output_config['endpoint']
raw_prediction_tags = pi_web_api_output_config['prediction_tags']
raw_confidence_tags = pi_web_api_output_config['confidence_tags']
prediction_tags = list[str](raw_prediction_tags.values())
confidence_tags = list[str](raw_confidence_tags.values())
core_labels = {
**self.get_core_labels(metadata),
'url_path': f'{self.pi_web_api_client.base_url}{endpoint}',
}
core_labels = self.get_core_labels(metadata)
prediction_value = data.head(1)['prediction'].values[0]
confidence_value = data.head(1)['prediction_confidence'].values[0]
@@ -214,7 +209,6 @@ class API(SientiaMonitoring):
'Timestamp': data.head(1)['timestamp'].values[0],
'Value': prediction_value,
},
endpoint=endpoint,
metadata=metadata,
)
@@ -251,7 +245,6 @@ class API(SientiaMonitoring):
'Timestamp': data.head(1)['timestamp'].values[0],
'Value': confidence_value,
},
endpoint=endpoint,
metadata=metadata,
)

File diff suppressed because one or more lines are too long

View File

@@ -232,6 +232,16 @@ env:
- name: MINIO_DEFAULT_BUCKET
value: "sientia"
- name: PI_WEB_API_BASE_URL
value: "https://pivision.votorantimcimentos.com/piwebapi"
- name: PI_WEB_API_AUTH_TYPE
value: "basic"
- name: PI_WEB_API_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: pi-web-api-auth-token
key: token
- name: PYPI_SERVER
value: "http://library-distribution-server.library.svc.cluster.local:5000"