pswamp.app_templates.snapshot_app

Attributes

app

Classes

SnapshotApp

General application template.

Module Contents

class pswamp.app_templates.snapshot_app.SnapshotApp(io=None, eval_freq=None, t_end=None, t_start=None, app_name=None, input_decoder=None, decoder_kwargs={}, report_status=False, **io_kwargs)

General application template.

New applications could be defined by inheriting from this template, and defining the “run_analysis” method.

Parameters:
  • io – Input/output object (normally connects to Kafka)

  • eval_freq – How often the evaluation of the application should be run (e.g., the part in “run_analysis”)

  • t_end – The application will stop running when this time is reached (but can be restarted)

  • t_start – The application will ask the io object (first argument) to search for t_start when initializing.

  • app_name – Name for the application.

  • input_decoder – This determines how the input is read/decoded (if no decoder is specified, a decoder for PMU data frames will be used.)

  • decoder_kwargs – Kwargs for initalizing the “input_decoder”.

  • report_status – If enabled, status messages will be emitted.

  • io_kwargs – Any other kwargs will be forwarded to the io object.

app_name
uuid
status = 'Undefined'
eval_freq = None
_stopped = False
most_recent_data_frame = None
most_recent_time_stamp = None
last_result = None
t_next_eval = None
update_callbacks = []
decoder
time_stamp_at_init
input_dt
pmu_dt
results = []
t_eval_target
get_sample_data_frame()
get_input_data_rate()
get_time_stamp_from_frame(data_frame)
stop()
get_config_frame()
get_next_data_frame()
handle_result(result)
run_analysis(time_stamp, measurements)
run_in_thread()
run()
update()
update_storage(next_data_frame)
get_result(next_data_frame)
start()
console_popup()
pswamp.app_templates.snapshot_app.app