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 estimate
UncertainData: Event state

Return type

tuple

get_model()#

Get the configured PrognosticsModel used by the session

Returns

configured PrognosticsModel used by the session

Return type

PrognosticsModel

Example

m = session.get_model()

get_output()#

Get the model output

Returns

float: Time of state estimate
UncertainData: Model state

Return type

tuple

get_performance_metrics()#

Get current performance metrics

Returns

float: Time of state estimate
UncertainData: Performance Metrics

Return type

tuple

get_predicted_event_state()#

Get the predicted event state

Returns

float: Time of prediction
Prediction: predicted Event state

Return type

tuple

get_predicted_output()#

Get the predicted output

Returns

float: Time of prediction
Prediction: predicted Event state

Return type

tuple

get_predicted_performance_metrics()#

Get predicted performance metrics

Returns

float: Time of prediction
Prediction: Predicted performance Metrics

Return type

tuple

get_predicted_state()#

Get the predicted model state

Returns

float: Time of prediction
Prediction: Predicted model state at save points

Return type

tuple

get_predicted_toe()#

Get the predicted Time of Event (ToE)

Returns

float: Time of prediction
UncertainData: Prediction

Return type

tuple

See also: get_prediction_status

get_prediction_status()#

Get the status of the prediction

Returns

Status of prediction

Return type

dict

get_state()#

Get the model state

Returns

float: Time of state estimate
UncertainData: Model state

Return type

tuple

is_init()#

Check if session has been initialized

Returns

If the session has been initialized

Return type

bool

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)

send_loading(type: str, cfg: dict)#

Set the future loading profile profile.

Parameters
  • type (str) – Type of loading profile

  • cfg (dict) – Configuration of loading profile

set_state(x)#

Set the model state.

Parameters

x (UncertainData, Dict, model.StateContainer) – Model state