pswamp.gui.grid_view.dim_3d.layers
Submodules
- pswamp.gui.grid_view.dim_3d.layers.alarms
- pswamp.gui.grid_view.dim_3d.layers.buses
- pswamp.gui.grid_view.dim_3d.layers.countries
- pswamp.gui.grid_view.dim_3d.layers.frequency
- pswamp.gui.grid_view.dim_3d.layers.grid_events
- pswamp.gui.grid_view.dim_3d.layers.islanding
- pswamp.gui.grid_view.dim_3d.layers.layers
- pswamp.gui.grid_view.dim_3d.layers.line_outages
- pswamp.gui.grid_view.dim_3d.layers.lines
- pswamp.gui.grid_view.dim_3d.layers.lines_2
- pswamp.gui.grid_view.dim_3d.layers.lines_freq
- pswamp.gui.grid_view.dim_3d.layers.pmus
- pswamp.gui.grid_view.dim_3d.layers.voltage
- pswamp.gui.grid_view.dim_3d.layers.voltage_stability
Attributes
Classes
This class inserts phasors in a 3D plot window at specific coordinates. |
|
This class inserts phasors in a 3D plot window at specific coordinates. |
|
For showing a tree representing Stations and PMUs |
|
This class is intended for consuming PMU data from a specified Kafka topic and storing the last samples (n_samples) in a |
|
Wrapper for Kafka consumer. |
|
This class is intended for consuming PMU data from a specified Kafka topic and storing the last samples (n_samples) in a |
|
Wrapper for Kafka consumer. |
|
Wrapper for Kafka consumer. |
|
This class is intended for consuming PMU data from a specified Kafka topic and storing the last samples (n_samples) in a |
|
This class is intended for consuming PMU data from a specified Kafka topic and storing the last samples (n_samples) in a |
|
General application template. |
|
Functions
|
|
|
Set graphics options from config. |
|
|
|
Get coordinates for stations in PMU data frame |
|
Set graphics options from config. |
|
|
|
Get coordinates for stations in PMU data frame |
|
Get coordinates for a subset of stations |
|
Set graphics options from config. |
|
Get coordinates for a subset of stations |
|
|
|
Set graphics options from config. |
|
|
|
Get coordinates for stations in PMU data frame |
|
Get coordinates for a subset of stations |
|
Set graphics options from config. |
|
Get coordinates for stations in PMU data frame |
|
|
|
Set graphics options from config. |
|
|
|
Get coordinates for stations in PMU data frame |
|
Get coordinates for a subset of stations |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set graphics options from config. |
|
|
|
|
|
|
|
|
|
|
|
Set graphics options from config. |
|
Package Contents
- class pswamp.gui.grid_view.dim_3d.layers.PhasorPlot3D(plot_window, pos0=None, n_phasors=None, normalize_length=True, normalize_angle=False, update_freq=None, *args, **kwargs)
This class inserts phasors in a 3D plot window at specific coordinates.
- normalize_length = True
- normalize_angle = False
- update_freq = None
- angles_prev
- pos0 = None
- phasor_0
- colors
- phasor_plots = []
- update(phasors, normalize=False)
- update_plot()
- class pswamp.gui.grid_view.dim_3d.layers.PhasorPlot3DFast(plot_window, pos0=None, n_phasors=None, normalize_length=True, normalize_angle=False, update_freq=None, *args, **kwargs)
This class inserts phasors in a 3D plot window at specific coordinates.
- normalize_length = True
- normalize_angle = False
- update_freq = None
- angles_prev
- pos0 = None
- phasor_0
- colors
- phasor_plot
- update(phasors, normalize=False)
- update_plot()
- draw_phasors(phasors)
- pswamp.gui.grid_view.dim_3d.layers.read_geo_data(countries='All')
- class pswamp.gui.grid_view.dim_3d.layers.ChannelTree(station_names, channel_names, *args)
Bases:
QTreeWidgetFor showing a tree representing Stations and PMUs
- station_names
- channel_names
- station_idx
- onItemClicked(it, col)
- pswamp.gui.grid_view.dim_3d.layers.set_gl_options(config, pl)
Set graphics options from config.
- Parameters:
config (dict) – pswamp Configuration file (from config.toml)
pl (GLGraphicsItem) – Plot item for which to set options.
- class pswamp.gui.grid_view.dim_3d.layers.StationNamesLayer(parent, config, geo=True)
Bases:
pswamp.gui.grid_view.dim_2d.layers.StationNamesLayer- add_text(coord, text)
- class pswamp.gui.grid_view.dim_3d.layers.PhasorPlotLayer(parent, config, geo=True)
Bases:
pswamp.gui.grid_view.dim_2d.layers.PhasorPlotLayer- phasor_plot_class
- add_phasor_plot(bus_coords)
- class pswamp.gui.grid_view.dim_3d.layers.PhasorPlotFastLayer(parent, config, geo=True)
Bases:
PhasorPlotLayer- phasor_plot_class
- remove_layer()
- class pswamp.gui.grid_view.dim_3d.layers.StaticLineDataLayer(parent, config, geo=True, data_subkey='line_data_path')
Bases:
pswamp.gui.grid_view.dim_2d.layers.StaticLineDataLayer- add_line_plots(pos, line_width, color)
- remove_layer()
- update_line_plots(key, **style_kwargs)
- hide()
- show()
- class pswamp.gui.grid_view.dim_3d.layers.StaticLineDataLayer_v0(*args, **kwargs)
Bases:
StaticLineDataLayer
- class pswamp.gui.grid_view.dim_3d.layers.StaticLineDataLayerSettings(target_layer)
Bases:
pswamp.gui.grid_view.dim_2d.layers.StaticLineDataLayerSettings
- class pswamp.gui.grid_view.dim_3d.layers.PMUTimeWindow(n_samples=None, window_length=None, time_window_type=TimeWindowLabeled, substitute_zero_freq_with_nan=True, channel_selection=None, channel_selection_idx=None)
- time_window_type
- tw = None
- header = None
- n_samples = None
- window_length = None
- is_initialized = False
- n_channels = None
- dt
- fs
- pmu_decoder
- initialize_from_config_frame(config_frame)
- update_window(pmu_data_frame)
- class pswamp.gui.grid_view.dim_3d.layers.PhasorPlot(n_phasors=None, pos0=None, normalize_length=True, normalize_angle=False, update_freq=None, plot_widget=None, background_color=(30, 63, 64), *args, **kwargs)
Bases:
PySide6.QtWidgets.QWidget- request_plot_update
- pos0 = None
- approx_zero_value = 1e-06
- normalize_length = True
- normalize_angle = False
- update_freq = None
- angles_prev
- phasors
- phasor_0
- colors
- create_plot_items()
- update(phasors)
- update_plot()
- update_plot_items(draw_phasors)
- pswamp.gui.grid_view.dim_3d.layers.read_geo_data(countries='All')
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_current_stations(config, return_3d=False, geo=True)
Get coordinates for stations in PMU data frame
- pswamp.gui.grid_view.dim_3d.layers.set_gl_options(config, pl)
Set graphics options from config.
- Parameters:
config (dict) – pswamp Configuration file (from config.toml)
pl (GLGraphicsItem) – Plot item for which to set options.
- class pswamp.gui.grid_view.dim_3d.layers.BusesLayer(parent, config, geo=True)
Bases:
pswamp.gui.grid_view.dim_2d.layers.BusesLayer- add_scatter_plot(bus_coords_3d)
- class pswamp.gui.grid_view.dim_3d.layers.PMUTimeWindowOnline(kafka_kwargs={}, kafka_topic='pmudata', auto_adjust_offset=False, **kwargs)
Bases:
PMUTimeWindowThis class is intended for consuming PMU data from a specified Kafka topic and storing the last samples (n_samples) in a TimeWindow object.
- kafka_topic = 'pmudata'
- kafka_kwargs
- auto_adjust_offset = False
- pmu_stream
- _is_stopped = False
- initialize()
- run()
- stop()
- class pswamp.gui.grid_view.dim_3d.layers.PhasorPlot(n_phasors=None, pos0=None, normalize_length=True, normalize_angle=False, update_freq=None, plot_widget=None, background_color=(30, 63, 64), *args, **kwargs)
Bases:
PySide6.QtWidgets.QWidget- request_plot_update
- pos0 = None
- approx_zero_value = 1e-06
- normalize_length = True
- normalize_angle = False
- update_freq = None
- angles_prev
- phasors
- phasor_0
- colors
- create_plot_items()
- update(phasors)
- update_plot()
- update_plot_items(draw_phasors)
- pswamp.gui.grid_view.dim_3d.layers.read_geo_data(countries='All')
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_current_stations(config, return_3d=False, geo=True)
Get coordinates for stations in PMU data frame
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_stations(config, wanted_stations, return_3d=False, geo=True)
Get coordinates for a subset of stations
- pswamp.gui.grid_view.dim_3d.layers.set_gl_options(config, pl)
Set graphics options from config.
- Parameters:
config (dict) – pswamp Configuration file (from config.toml)
pl (GLGraphicsItem) – Plot item for which to set options.
- class pswamp.gui.grid_view.dim_3d.layers.Frequency3DLayer(parent, config, geo=True)
- config
- plotWidget
- k = 2
- uuid
- parent
- z_scale = 3
- pmu_tw
- col_idx
- x
- y
- z_0
- z
- colors
- show()
- hide()
- get_col_idx()
- add_scatter_plot(bus_coords_3d)
- update_coords()
- update_scatter()
- generate_bus_lines()
- remove_layer()
- class pswamp.gui.grid_view.dim_3d.layers.Frequency3DLayerSettings(target_layer)
Bases:
PySide6.QtWidgets.QWidget- target_layer
- slider_change(val)
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_stations(config, wanted_stations, return_3d=False, geo=True)
Get coordinates for a subset of stations
- class pswamp.gui.grid_view.dim_3d.layers.KafkaConsumer(*args, use_nqkafka=False, **kwargs)
Wrapper for Kafka consumer.
- Parameters:
use_nqkafka (bool, optional) – Determines whether self.instance is a NQKafkaConsumer (from the nqkafka package, can be thought of as a “mock”) or actual KafkaConsumer (from the kafka-python package), which connects to a Kafka server. Defaults to False.
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- instance
Determined from input parameters.
- Type:
nqkafka.NQKafkaConsumerorkafka.KafkaConsumer
- instance
- __getattr__(name)
Inherits the same attributes as the instance.
- Parameters:
name (_type_) – Name of the attribute.
- Returns:
The attribute of the instance.
- __iter__()
The iterator is the same as the iterator of the instance.
- Returns:
The instance.
- pswamp.gui.grid_view.dim_3d.layers.get_last_message_from_topic(kafka_kwargs, topic)
- pswamp.gui.grid_view.dim_3d.layers.set_gl_options(config, pl)
Set graphics options from config.
- Parameters:
config (dict) – pswamp Configuration file (from config.toml)
pl (GLGraphicsItem) – Plot item for which to set options.
- class pswamp.gui.grid_view.dim_3d.layers.VoltageStability(parent, config, geo=True)
- config
- input_stream
- is_stopped = False
- plotWidget
- k = 2
- uuid
- parent
- z_scale = 3
- x
- y
- z
- text_item
- run_consumer()
- stop()
- update_text()
- remove_layer()
- class pswamp.gui.grid_view.dim_3d.layers.PMUTimeWindowOnline(kafka_kwargs={}, kafka_topic='pmudata', auto_adjust_offset=False, **kwargs)
Bases:
PMUTimeWindowThis class is intended for consuming PMU data from a specified Kafka topic and storing the last samples (n_samples) in a TimeWindow object.
- kafka_topic = 'pmudata'
- kafka_kwargs
- auto_adjust_offset = False
- pmu_stream
- _is_stopped = False
- initialize()
- run()
- stop()
- class pswamp.gui.grid_view.dim_3d.layers.PhasorPlot(n_phasors=None, pos0=None, normalize_length=True, normalize_angle=False, update_freq=None, plot_widget=None, background_color=(30, 63, 64), *args, **kwargs)
Bases:
PySide6.QtWidgets.QWidget- request_plot_update
- pos0 = None
- approx_zero_value = 1e-06
- normalize_length = True
- normalize_angle = False
- update_freq = None
- angles_prev
- phasors
- phasor_0
- colors
- create_plot_items()
- update(phasors)
- update_plot()
- update_plot_items(draw_phasors)
- pswamp.gui.grid_view.dim_3d.layers.read_geo_data(countries='All')
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_current_stations(config, return_3d=False, geo=True)
Get coordinates for stations in PMU data frame
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_stations(config, wanted_stations, return_3d=False, geo=True)
Get coordinates for a subset of stations
- class pswamp.gui.grid_view.dim_3d.layers.KafkaConsumer(*args, use_nqkafka=False, **kwargs)
Wrapper for Kafka consumer.
- Parameters:
use_nqkafka (bool, optional) – Determines whether self.instance is a NQKafkaConsumer (from the nqkafka package, can be thought of as a “mock”) or actual KafkaConsumer (from the kafka-python package), which connects to a Kafka server. Defaults to False.
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- instance
Determined from input parameters.
- Type:
nqkafka.NQKafkaConsumerorkafka.KafkaConsumer
- instance
- __getattr__(name)
Inherits the same attributes as the instance.
- Parameters:
name (_type_) – Name of the attribute.
- Returns:
The attribute of the instance.
- __iter__()
The iterator is the same as the iterator of the instance.
- Returns:
The instance.
- pswamp.gui.grid_view.dim_3d.layers.set_gl_options(config, pl)
Set graphics options from config.
- Parameters:
config (dict) – pswamp Configuration file (from config.toml)
pl (GLGraphicsItem) – Plot item for which to set options.
- class pswamp.gui.grid_view.dim_3d.layers.Islanding(parent, bus_coords_3d, geo=True, color_scheme='islanding', n_max_islands=8)
- plotWidget
- k = 2
- uuid
- parent
- newest_message = None
- stopped = False
- x
- y
- z
- n_max_islands = 8
- bus_scatters
- add_scatter_plot(color)
- hide()
- show()
- update_scatter(islands=None, z=None)
- remove_layer()
- class pswamp.gui.grid_view.dim_3d.layers.IslandingOnline(parent, config, geo=True)
Bases:
Islanding- config
- consumer
- add_scatter_plot(color)
- class pswamp.gui.grid_view.dim_3d.layers.IslandingLayerSettings(target_layer)
Bases:
PySide6.QtWidgets.QWidget- target_layer
- pswamp.gui.grid_view.dim_3d.layers.config
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_current_stations(config, return_3d=False, geo=True)
Get coordinates for stations in PMU data frame
- class pswamp.gui.grid_view.dim_3d.layers.KafkaConsumer(*args, use_nqkafka=False, **kwargs)
Wrapper for Kafka consumer.
- Parameters:
use_nqkafka (bool, optional) – Determines whether self.instance is a NQKafkaConsumer (from the nqkafka package, can be thought of as a “mock”) or actual KafkaConsumer (from the kafka-python package), which connects to a Kafka server. Defaults to False.
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- instance
Determined from input parameters.
- Type:
nqkafka.NQKafkaConsumerorkafka.KafkaConsumer
- instance
- __getattr__(name)
Inherits the same attributes as the instance.
- Parameters:
name (_type_) – Name of the attribute.
- Returns:
The attribute of the instance.
- __iter__()
The iterator is the same as the iterator of the instance.
- Returns:
The instance.
- pswamp.gui.grid_view.dim_3d.layers.lookup_strings(a, b, return_mask=False)
- pswamp.gui.grid_view.dim_3d.layers.set_gl_options(config, pl)
Set graphics options from config.
- Parameters:
config (dict) – pswamp Configuration file (from config.toml)
pl (GLGraphicsItem) – Plot item for which to set options.
- class pswamp.gui.grid_view.dim_3d.layers.GridEvents(parent, config, geo=True)
- config
- plotWidget
- k = 2
- uuid
- parent
- stations
- affected_stations
- consumer
- stopped = False
- newest_message = None
- x
- y
- z
- scatter_plot
- get_messages()
- add_scatter_plot(color='b')
- update_scatter()
- remove_layer()
- class pswamp.gui.grid_view.dim_3d.layers.PMUTimeWindowOnline(kafka_kwargs={}, kafka_topic='pmudata', auto_adjust_offset=False, **kwargs)
Bases:
PMUTimeWindowThis class is intended for consuming PMU data from a specified Kafka topic and storing the last samples (n_samples) in a TimeWindow object.
- kafka_topic = 'pmudata'
- kafka_kwargs
- auto_adjust_offset = False
- pmu_stream
- _is_stopped = False
- initialize()
- run()
- stop()
- class pswamp.gui.grid_view.dim_3d.layers.PhasorPlot(n_phasors=None, pos0=None, normalize_length=True, normalize_angle=False, update_freq=None, plot_widget=None, background_color=(30, 63, 64), *args, **kwargs)
Bases:
PySide6.QtWidgets.QWidget- request_plot_update
- pos0 = None
- approx_zero_value = 1e-06
- normalize_length = True
- normalize_angle = False
- update_freq = None
- angles_prev
- phasors
- phasor_0
- colors
- create_plot_items()
- update(phasors)
- update_plot()
- update_plot_items(draw_phasors)
- pswamp.gui.grid_view.dim_3d.layers.read_geo_data(countries='All')
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_current_stations(config, return_3d=False, geo=True)
Get coordinates for stations in PMU data frame
- pswamp.gui.grid_view.dim_3d.layers.load_bus_coords_for_stations(config, wanted_stations, return_3d=False, geo=True)
Get coordinates for a subset of stations
- class pswamp.gui.grid_view.dim_3d.layers.Frequency3DLayer(parent, config, geo=True)
- config
- plotWidget
- k = 2
- uuid
- parent
- z_scale = 3
- pmu_tw
- col_idx
- x
- y
- z_0
- z
- colors
- show()
- hide()
- get_col_idx()
- add_scatter_plot(bus_coords_3d)
- update_coords()
- update_scatter()
- generate_bus_lines()
- remove_layer()
- class pswamp.gui.grid_view.dim_3d.layers.Frequency3DLayerSettings(target_layer)
Bases:
PySide6.QtWidgets.QWidget- target_layer
- slider_change(val)
- pswamp.gui.grid_view.dim_3d.layers.get_model_data(config)
- pswamp.gui.grid_view.dim_3d.layers.lookup_strings(a, b, return_mask=False)
- class pswamp.gui.grid_view.dim_3d.layers.Voltage3DLayer(parent, config, *args, **kwargs)
Bases:
pswamp.gui.grid_view.dim_3d.layers.frequency.Frequency3DLayer- station_V_n
- update_coords()
- get_col_idx()
- class pswamp.gui.grid_view.dim_3d.layers.Voltage3DLayerSettings(target_layer)
Bases:
pswamp.gui.grid_view.dim_3d.layers.frequency.Frequency3DLayerSettings
- pswamp.gui.grid_view.dim_3d.layers.read_geo_data(countries='All')
- pswamp.gui.grid_view.dim_3d.layers.load_dxf(path)
- pswamp.gui.grid_view.dim_3d.layers.get_buses(doc, bus_names_model=None)
- pswamp.gui.grid_view.dim_3d.layers.flatten_list_insert_nan(listlist)
- class pswamp.gui.grid_view.dim_3d.layers.LineLayer2D(parent, config, geo=True)
- config
- k = 2
- parent
- lines_plot
- trafos_plot
- read_sld_data(config, geo)
- add_line_plots(pos, line_width=1, color='white')
- remove_layer()
- get_branches_from_buses(bus_idx)
- __del__()
- pswamp.gui.grid_view.dim_3d.layers.lookup_strings(a, b, return_mask=False)
- pswamp.gui.grid_view.dim_3d.layers.set_gl_options(config, pl)
Set graphics options from config.
- Parameters:
config (dict) – pswamp Configuration file (from config.toml)
pl (GLGraphicsItem) – Plot item for which to set options.
- class pswamp.gui.grid_view.dim_3d.layers.LineLayer(*args, **kwargs)
Bases:
pswamp.gui.grid_view.dim_2d.layers.lines.LineLayer- lines_z_map
- trafos_z_map
- line_colors
- trafo_colors
- build_z_map(data, paths)
- update_line_z_coords(node_z)
- update_trafo_z_coords(node_z)
- set_node_z(z)
- add_line_plots(pos, line_width=2, color='gray')
- reset_line_colors()
- reset_trafo_colors()
- set_line_colors(colors, idx=slice(None))
- update_line_colors()
- set_trafo_colors(colors, idx=slice(None))
- update_trafo_colors()
- pswamp.gui.grid_view.dim_3d.layers.sample_dataset_path
- class pswamp.gui.grid_view.dim_3d.layers.LineLayer(*args, **kwargs)
Bases:
pswamp.gui.grid_view.dim_2d.layers.lines.LineLayer- lines_z_map
- trafos_z_map
- line_colors
- trafo_colors
- build_z_map(data, paths)
- update_line_z_coords(node_z)
- update_trafo_z_coords(node_z)
- set_node_z(z)
- add_line_plots(pos, line_width=2, color='gray')
- reset_line_colors()
- reset_trafo_colors()
- set_line_colors(colors, idx=slice(None))
- update_line_colors()
- set_trafo_colors(colors, idx=slice(None))
- update_trafo_colors()
- pswamp.gui.grid_view.dim_3d.layers.read_geo_data(countries='All')
- pswamp.gui.grid_view.dim_3d.layers.load_dxf(path)
- pswamp.gui.grid_view.dim_3d.layers.get_buses(doc, bus_names_model=None)
- pswamp.gui.grid_view.dim_3d.layers.flatten_list_insert_nan(listlist)
- class pswamp.gui.grid_view.dim_3d.layers.LineLayer2D(parent, config, geo=True)
- config
- k = 2
- parent
- lines_plot
- trafos_plot
- read_sld_data(config, geo)
- add_line_plots(pos, line_width=1, color='white')
- remove_layer()
- get_branches_from_buses(bus_idx)
- __del__()
- pswamp.gui.grid_view.dim_3d.layers.lookup_strings(a, b, return_mask=False)
- class pswamp.gui.grid_view.dim_3d.layers.PMUTimeWindowOnline(kafka_kwargs={}, kafka_topic='pmudata', auto_adjust_offset=False, **kwargs)
Bases:
PMUTimeWindowThis class is intended for consuming PMU data from a specified Kafka topic and storing the last samples (n_samples) in a TimeWindow object.
- kafka_topic = 'pmudata'
- kafka_kwargs
- auto_adjust_offset = False
- pmu_stream
- _is_stopped = False
- initialize()
- run()
- stop()
- class pswamp.gui.grid_view.dim_3d.layers.Frequency3DLayerSettings(target_layer)
Bases:
PySide6.QtWidgets.QWidget- target_layer
- slider_change(val)
- class pswamp.gui.grid_view.dim_3d.layers.LinesFreq(parent, config, *args, **kwargs)
Bases:
pswamp.gui.grid_view.dim_3d.layers.lines.LineLayer- config
- uuid
- pmu_tw
- col_idx
- z_0 = 1
- z_scale = 3
- get_col_idx()
- update_z()
- class pswamp.gui.grid_view.dim_3d.layers.LinesFreqSettings(target_layer)
Bases:
pswamp.gui.grid_view.dim_3d.layers.frequency.Frequency3DLayerSettings
- pswamp.gui.grid_view.dim_3d.layers.sample_dataset_path
- class pswamp.gui.grid_view.dim_3d.layers.LineLayer(*args, **kwargs)
Bases:
pswamp.gui.grid_view.dim_2d.layers.lines.LineLayer- lines_z_map
- trafos_z_map
- line_colors
- trafo_colors
- build_z_map(data, paths)
- update_line_z_coords(node_z)
- update_trafo_z_coords(node_z)
- set_node_z(z)
- add_line_plots(pos, line_width=2, color='gray')
- reset_line_colors()
- reset_trafo_colors()
- set_line_colors(colors, idx=slice(None))
- update_line_colors()
- set_trafo_colors(colors, idx=slice(None))
- update_trafo_colors()
- class pswamp.gui.grid_view.dim_3d.layers.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()
- class pswamp.gui.grid_view.dim_3d.layers.Line(config, meas_data, units=None)
- from_bus_idx
- to_bus_idx
- freq_from_extractor
- freq_to_extractor
- current_phasor_extractor_from
- current_phasor_extractor_to
- v_from_phasor_extractor
- v_to_phasor_extractor
- line_out_threshold = 0.001
- S_n
- V_n
- I_n
- V_from(meas)
- V_to(meas)
- freq_from(meas)
- freq_to(meas)
- I_from(meas)
- I_to(meas)
- S_from(meas)
- S_to(meas)
- P_from(meas)
- P_to(meas)
- Q_from(meas)
- Q_to(meas)
- disconnected(meas)
- connectable(meas)
- class pswamp.gui.grid_view.dim_3d.layers.LineOutages(parent, config, *args, **kwargs)
Bases:
pswamp.gui.grid_view.dim_3d.layers.lines.LineLayer- config
- uuid
- snapshot_app
- line_model
- update_colors()
- add_line_plots(pos, line_width=7, color='gray')
- pswamp.gui.grid_view.dim_3d.layers.config
- pswamp.gui.grid_view.dim_3d.layers.set_gl_options(config, pl)
Set graphics options from config.
- Parameters:
config (dict) – pswamp Configuration file (from config.toml)
pl (GLGraphicsItem) – Plot item for which to set options.
- pswamp.gui.grid_view.dim_3d.layers.read_geo_data(countries='All')
- class pswamp.gui.grid_view.dim_3d.layers.CountriesLayer(*args, **kwargs)
Bases:
pswamp.gui.grid_view.dim_2d.layers.CountriesLayer- add_geo_lines(geo_data)
- update_countries(countries=['Norway'])
- class pswamp.gui.grid_view.dim_3d.layers.CountriesLayerSettings(target_layer, *args, **kwargs)
Bases:
pswamp.gui.grid_view.dim_2d.layers.CountriesLayerSettings
- pswamp.gui.grid_view.dim_3d.layers.config