prog_client#
The PaaS Sandbox Client (prog_client) is a python package for interacting with the PaaS Sandbox API. The class Session is used to create a connection to the API. The class methods are used to interact with the api, as described below:
- class prog_client.Session(model, host='127.0.0.1', port=8555, **kwargs)#
Create a new Session in prog_server
- Parameters
model (str) – The model to use for this session (e.g., batt)
host (str, optional) – Host address for PaaS Service. Defaults to ‘127.0.0.1’
port (int, optional) – Port for PaaS Service. Defaults to 5000.
model_cfg (dict, optional) – Configuration for ProgModel.
x0 (dict, optional) – Initial state for ProgModel.
load_est (str, optional) – Load estimator to use.
load_est_cfg (dict, optional) – Configuration for load estimator.
state_est (str, optional) – State Estimator to use (e.g., ParticleFilter). Class name for state estimator in progpy.state_estimators
state_est_cfg (dict, optional) – Configuration for state estimator.
pred (str, optional) – Prediction algorithm to use (e.g., MonteCarlo). Class name for prediction algorithm in progpy.predictors
pred_cfg (dict, optional) – Configuration for prediction algorithm.
- Use:
session = prog_client.Session(**config)
- get_event_state()#
Get the current event state
- Returns
- float: Time of state estimateUncertainData: Event state
- Return type
- get_model()#
Get the configured PrognosticsModel used by the session
- Returns
configured PrognosticsModel used by the session
- Return type
Example
m = session.get_model()
- get_output()#
Get the model output
- Returns
- float: Time of state estimateUncertainData: Model state
- Return type
- get_performance_metrics()#
Get current performance metrics
- Returns
- float: Time of state estimateUncertainData: Performance Metrics
- Return type
- get_predicted_event_state()#
Get the predicted event state
- Returns
- float: Time of predictionPrediction: predicted Event state
- Return type
- get_predicted_output()#
Get the predicted output
- Returns
- float: Time of predictionPrediction: predicted Event state
- Return type
- get_predicted_performance_metrics()#
Get predicted performance metrics
- Returns
- float: Time of predictionPrediction: Predicted performance Metrics
- Return type
- get_predicted_state()#
Get the predicted model state
- Returns
- float: Time of predictionPrediction: Predicted model state at save points
- Return type
- get_predicted_toe()#
Get the predicted Time of Event (ToE)
- Returns
- float: Time of predictionUncertainData: Prediction
- Return type
See also: get_prediction_status
- get_prediction_status()#
Get the status of the prediction
- Returns
Status of prediction
- Return type
- get_state()#
Get the model state
- Returns
- float: Time of state estimateUncertainData: Model state
- Return type
- is_init()#
Check if session has been initialized
- Returns
If the session has been initialized
- Return type
- send_data(time, **kwargs)#
Send data to service
- Parameters
time (float) – Time for data point
keywords (... Other arguments as) –
Example
session.send_data(10.2, t=32.0, v=3.914, i=2)
- set_state(x)#
Set the model state.
- Parameters
x (UncertainData, Dict, model.StateContainer) – Model state