mistk.transform.abstract_transform_plugin module

class mistk.transform.abstract_transform_plugin.AbstractTransformPlugin

Bases: object

classdocs

abstract do_terminate()

Stops all processing and releases any resources that are in use in preparation for being shut down.

abstract do_transform(inputDirs, outputDir, properties)

Executes the transform activity

property endpoint_service

Returns the endpoint service for this Model

fail(reason)

Triggers the model to enter the failed state. This method should not be implemented or overwritten by subclasses. It will be created by the state machine.

Parameters

reason – The reason why the state machine is transitioned into the failure state

new_state_entered(*args, **kwargs)

Notifies the endpoint service that the current state of the state machine has been update

Parameters
  • args – Optional non-keyworded variable length arguments to pass in

  • kwargs – Optional keyworded variable length arguments to pass in

ready()

Triggers the model to enter the ready state. It is expected that this method will only be called by the implementing model subclass.

This method should not be implemented or overwritten by subclasses. It will be created by the state machine.

report_failure(reason)

Reports the failure of a model during its operations

Parameters

reason – The error message explaining why the model failed.

terminated()

Shutdowns the transform plugin

transform(inputDirs, outputDir, properties)

Triggers the model to enter the training state. A subsequent call to do_train with the given parameters will be made as a result.

This method should not be implemented or overwritten by subclasses. It will be created by the state machine.

update_status(payload)

Provides additional details to the current state of the model. If the model is training, then this might contain the number of records that have been trained.

Parameters

payload – Extra information regarding the status update