repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
DLR-RM/RAFCON | source/rafcon/core/execution/execution_history.py | ExecutionHistory.push_concurrency_history_item | def push_concurrency_history_item(self, state, number_concurrent_threads):
"""Adds a new concurrency-history-item to the history item list
A concurrent history item stores information about the point in time where a certain number of states is
launched concurrently
(e.g. in a barrier co... | python | def push_concurrency_history_item(self, state, number_concurrent_threads):
"""Adds a new concurrency-history-item to the history item list
A concurrent history item stores information about the point in time where a certain number of states is
launched concurrently
(e.g. in a barrier co... | [
"def",
"push_concurrency_history_item",
"(",
"self",
",",
"state",
",",
"number_concurrent_threads",
")",
":",
"last_history_item",
"=",
"self",
".",
"get_last_history_item",
"(",
")",
"return_item",
"=",
"ConcurrencyItem",
"(",
"state",
",",
"self",
".",
"get_last_... | Adds a new concurrency-history-item to the history item list
A concurrent history item stores information about the point in time where a certain number of states is
launched concurrently
(e.g. in a barrier concurrency state).
:param state: the state that launches the state group
... | [
"Adds",
"a",
"new",
"concurrency",
"-",
"history",
"-",
"item",
"to",
"the",
"history",
"item",
"list"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/execution/execution_history.py#L211-L225 |
DLR-RM/RAFCON | source/rafcon/utils/hashable.py | Hashable.update_hash_from_dict | def update_hash_from_dict(obj_hash, object_):
"""Updates an existing hash object with another Hashable, list, set, tuple, dict or stringifyable object
:param obj_hash: The hash object (see Python hashlib documentation)
:param object_: The value that should be added to the hash (can be another H... | python | def update_hash_from_dict(obj_hash, object_):
"""Updates an existing hash object with another Hashable, list, set, tuple, dict or stringifyable object
:param obj_hash: The hash object (see Python hashlib documentation)
:param object_: The value that should be added to the hash (can be another H... | [
"def",
"update_hash_from_dict",
"(",
"obj_hash",
",",
"object_",
")",
":",
"if",
"isinstance",
"(",
"object_",
",",
"Hashable",
")",
":",
"object_",
".",
"update_hash",
"(",
"obj_hash",
")",
"elif",
"isinstance",
"(",
"object_",
",",
"(",
"list",
",",
"set... | Updates an existing hash object with another Hashable, list, set, tuple, dict or stringifyable object
:param obj_hash: The hash object (see Python hashlib documentation)
:param object_: The value that should be added to the hash (can be another Hashable or a dictionary) | [
"Updates",
"an",
"existing",
"hash",
"object",
"with",
"another",
"Hashable",
"list",
"set",
"tuple",
"dict",
"or",
"stringifyable",
"object"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/hashable.py#L21-L39 |
DLR-RM/RAFCON | source/rafcon/utils/hashable.py | Hashable.mutable_hash | def mutable_hash(self, obj_hash=None):
"""Creates a hash with the (im)mutable data fields of the object
Example:
>>> my_obj = type("MyDerivedClass", (Hashable,), { "update_hash": lambda self, h: h.update("RAFCON") })()
>>> my_obj_hash = my_obj.mutable_hash()
>>> prin... | python | def mutable_hash(self, obj_hash=None):
"""Creates a hash with the (im)mutable data fields of the object
Example:
>>> my_obj = type("MyDerivedClass", (Hashable,), { "update_hash": lambda self, h: h.update("RAFCON") })()
>>> my_obj_hash = my_obj.mutable_hash()
>>> prin... | [
"def",
"mutable_hash",
"(",
"self",
",",
"obj_hash",
"=",
"None",
")",
":",
"if",
"obj_hash",
"is",
"None",
":",
"obj_hash",
"=",
"hashlib",
".",
"sha256",
"(",
")",
"self",
".",
"update_hash",
"(",
"obj_hash",
")",
"return",
"obj_hash"
] | Creates a hash with the (im)mutable data fields of the object
Example:
>>> my_obj = type("MyDerivedClass", (Hashable,), { "update_hash": lambda self, h: h.update("RAFCON") })()
>>> my_obj_hash = my_obj.mutable_hash()
>>> print('Hash: ' + my_obj_hash.hexdigest())
... | [
"Creates",
"a",
"hash",
"with",
"the",
"(",
"im",
")",
"mutable",
"data",
"fields",
"of",
"the",
"object"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/hashable.py#L48-L63 |
DLR-RM/RAFCON | source/rafcon/utils/log_helpers.py | LoggingViewHandler.emit | def emit(self, record):
"""Logs a new record
If a logging view is given, it is used to log the new record to. The code is partially copied from the
StreamHandler class.
:param record:
:return:
"""
try:
# Shorten the source name of the record ... | python | def emit(self, record):
"""Logs a new record
If a logging view is given, it is used to log the new record to. The code is partially copied from the
StreamHandler class.
:param record:
:return:
"""
try:
# Shorten the source name of the record ... | [
"def",
"emit",
"(",
"self",
",",
"record",
")",
":",
"try",
":",
"# Shorten the source name of the record (remove rafcon.)",
"if",
"sys",
".",
"version_info",
">=",
"(",
"2",
",",
"7",
")",
":",
"record",
".",
"__setattr__",
"(",
"\"name\"",
",",
"record",
"... | Logs a new record
If a logging view is given, it is used to log the new record to. The code is partially copied from the
StreamHandler class.
:param record:
:return: | [
"Logs",
"a",
"new",
"record"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/log_helpers.py#L60-L89 |
DLR-RM/RAFCON | source/rafcon/gui/models/meta.py | MetaModel.get_meta_data_editor | def get_meta_data_editor(self, for_gaphas=True):
"""Returns the editor for the specified editor
This method should be used instead of accessing the meta data of an editor directly. It return the meta data
of the editor available (with priority to the one specified by `for_gaphas`) and converts ... | python | def get_meta_data_editor(self, for_gaphas=True):
"""Returns the editor for the specified editor
This method should be used instead of accessing the meta data of an editor directly. It return the meta data
of the editor available (with priority to the one specified by `for_gaphas`) and converts ... | [
"def",
"get_meta_data_editor",
"(",
"self",
",",
"for_gaphas",
"=",
"True",
")",
":",
"meta_gaphas",
"=",
"self",
".",
"meta",
"[",
"'gui'",
"]",
"[",
"'editor_gaphas'",
"]",
"meta_opengl",
"=",
"self",
".",
"meta",
"[",
"'gui'",
"]",
"[",
"'editor_opengl'... | Returns the editor for the specified editor
This method should be used instead of accessing the meta data of an editor directly. It return the meta data
of the editor available (with priority to the one specified by `for_gaphas`) and converts it if needed.
:param bool for_gaphas: True (default... | [
"Returns",
"the",
"editor",
"for",
"the",
"specified",
"editor"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/meta.py#L59-L86 |
DLR-RM/RAFCON | source/rafcon/gui/models/meta.py | MetaModel.set_meta_data_editor | def set_meta_data_editor(self, key, meta_data, from_gaphas=True):
"""Sets the meta data for a specific key of the desired editor
:param str key: The meta data key, separated by dots if it is nested
:param meta_data: The value to be set
:param bool from_gaphas: If the data comes from a g... | python | def set_meta_data_editor(self, key, meta_data, from_gaphas=True):
"""Sets the meta data for a specific key of the desired editor
:param str key: The meta data key, separated by dots if it is nested
:param meta_data: The value to be set
:param bool from_gaphas: If the data comes from a g... | [
"def",
"set_meta_data_editor",
"(",
"self",
",",
"key",
",",
"meta_data",
",",
"from_gaphas",
"=",
"True",
")",
":",
"self",
".",
"do_convert_meta_data_if_no_data",
"(",
"from_gaphas",
")",
"meta_gui",
"=",
"self",
".",
"meta",
"[",
"'gui'",
"]",
"meta_gui",
... | Sets the meta data for a specific key of the desired editor
:param str key: The meta data key, separated by dots if it is nested
:param meta_data: The value to be set
:param bool from_gaphas: If the data comes from a gaphas editor | [
"Sets",
"the",
"meta",
"data",
"for",
"a",
"specific",
"key",
"of",
"the",
"desired",
"editor"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/meta.py#L94-L115 |
DLR-RM/RAFCON | source/rafcon/gui/models/meta.py | MetaModel.meta_data_hash | def meta_data_hash(self, obj_hash=None):
"""Creates a hash with the meta data of the model
:param obj_hash: The hash object (see Python hashlib)
:return: The updated hash object
"""
if obj_hash is None:
obj_hash = hashlib.sha256()
self.update_meta_data_hash(o... | python | def meta_data_hash(self, obj_hash=None):
"""Creates a hash with the meta data of the model
:param obj_hash: The hash object (see Python hashlib)
:return: The updated hash object
"""
if obj_hash is None:
obj_hash = hashlib.sha256()
self.update_meta_data_hash(o... | [
"def",
"meta_data_hash",
"(",
"self",
",",
"obj_hash",
"=",
"None",
")",
":",
"if",
"obj_hash",
"is",
"None",
":",
"obj_hash",
"=",
"hashlib",
".",
"sha256",
"(",
")",
"self",
".",
"update_meta_data_hash",
"(",
"obj_hash",
")",
"return",
"obj_hash"
] | Creates a hash with the meta data of the model
:param obj_hash: The hash object (see Python hashlib)
:return: The updated hash object | [
"Creates",
"a",
"hash",
"with",
"the",
"meta",
"data",
"of",
"the",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/meta.py#L117-L126 |
DLR-RM/RAFCON | source/rafcon/gui/models/meta.py | MetaModel.prepare_destruction | def prepare_destruction(self):
"""Prepares the model for destruction
"""
self._Observer__PROP_TO_METHS.clear()
self._Observer__METH_TO_PROPS.clear()
self._Observer__PAT_TO_METHS.clear()
self._Observer__METH_TO_PAT.clear()
self._Observer__PAT_METH_TO_KWARGS.clear(... | python | def prepare_destruction(self):
"""Prepares the model for destruction
"""
self._Observer__PROP_TO_METHS.clear()
self._Observer__METH_TO_PROPS.clear()
self._Observer__PAT_TO_METHS.clear()
self._Observer__METH_TO_PAT.clear()
self._Observer__PAT_METH_TO_KWARGS.clear(... | [
"def",
"prepare_destruction",
"(",
"self",
")",
":",
"self",
".",
"_Observer__PROP_TO_METHS",
".",
"clear",
"(",
")",
"self",
".",
"_Observer__METH_TO_PROPS",
".",
"clear",
"(",
")",
"self",
".",
"_Observer__PAT_TO_METHS",
".",
"clear",
"(",
")",
"self",
".",
... | Prepares the model for destruction | [
"Prepares",
"the",
"model",
"for",
"destruction"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/meta.py#L135-L143 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/utils/gap_draw_helper.py | limit_value_string_length | def limit_value_string_length(value):
"""This method limits the string representation of the value to MAX_VALUE_LABEL_TEXT_LENGTH + 3 characters.
:param value: Value to limit string representation
:return: String holding the value with a maximum length of MAX_VALUE_LABEL_TEXT_LENGTH + 3
"""
if isin... | python | def limit_value_string_length(value):
"""This method limits the string representation of the value to MAX_VALUE_LABEL_TEXT_LENGTH + 3 characters.
:param value: Value to limit string representation
:return: String holding the value with a maximum length of MAX_VALUE_LABEL_TEXT_LENGTH + 3
"""
if isin... | [
"def",
"limit_value_string_length",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"string_types",
")",
"and",
"len",
"(",
"value",
")",
">",
"constants",
".",
"MAX_VALUE_LABEL_TEXT_LENGTH",
":",
"value",
"=",
"value",
"[",
":",
"constants",
... | This method limits the string representation of the value to MAX_VALUE_LABEL_TEXT_LENGTH + 3 characters.
:param value: Value to limit string representation
:return: String holding the value with a maximum length of MAX_VALUE_LABEL_TEXT_LENGTH + 3 | [
"This",
"method",
"limits",
"the",
"string",
"representation",
"of",
"the",
"value",
"to",
"MAX_VALUE_LABEL_TEXT_LENGTH",
"+",
"3",
"characters",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_draw_helper.py#L33-L48 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/utils/gap_draw_helper.py | get_col_rgba | def get_col_rgba(color, transparency=None, opacity=None):
"""This class converts a Gdk.Color into its r, g, b parts and adds an alpha according to needs
If both transparency and opacity is None, alpha is set to 1 => opaque
:param Gdk.Color color: Color to extract r, g and b from
:param float | None t... | python | def get_col_rgba(color, transparency=None, opacity=None):
"""This class converts a Gdk.Color into its r, g, b parts and adds an alpha according to needs
If both transparency and opacity is None, alpha is set to 1 => opaque
:param Gdk.Color color: Color to extract r, g and b from
:param float | None t... | [
"def",
"get_col_rgba",
"(",
"color",
",",
"transparency",
"=",
"None",
",",
"opacity",
"=",
"None",
")",
":",
"r",
",",
"g",
",",
"b",
"=",
"color",
".",
"red",
",",
"color",
".",
"green",
",",
"color",
".",
"blue",
"# Convert from 0-6535 to 0-1",
"r",... | This class converts a Gdk.Color into its r, g, b parts and adds an alpha according to needs
If both transparency and opacity is None, alpha is set to 1 => opaque
:param Gdk.Color color: Color to extract r, g and b from
:param float | None transparency: Value between 0 (opaque) and 1 (transparent) or None... | [
"This",
"class",
"converts",
"a",
"Gdk",
".",
"Color",
"into",
"its",
"r",
"g",
"b",
"parts",
"and",
"adds",
"an",
"alpha",
"according",
"to",
"needs"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_draw_helper.py#L51-L77 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/utils/gap_draw_helper.py | get_side_length_of_resize_handle | def get_side_length_of_resize_handle(view, item):
"""Calculate the side length of a resize handle
:param rafcon.gui.mygaphas.view.ExtendedGtkView view: View
:param rafcon.gui.mygaphas.items.state.StateView item: StateView
:return: side length
:rtype: float
"""
from rafcon.gui.mygaphas.items... | python | def get_side_length_of_resize_handle(view, item):
"""Calculate the side length of a resize handle
:param rafcon.gui.mygaphas.view.ExtendedGtkView view: View
:param rafcon.gui.mygaphas.items.state.StateView item: StateView
:return: side length
:rtype: float
"""
from rafcon.gui.mygaphas.items... | [
"def",
"get_side_length_of_resize_handle",
"(",
"view",
",",
"item",
")",
":",
"from",
"rafcon",
".",
"gui",
".",
"mygaphas",
".",
"items",
".",
"state",
"import",
"StateView",
",",
"NameView",
"if",
"isinstance",
"(",
"item",
",",
"StateView",
")",
":",
"... | Calculate the side length of a resize handle
:param rafcon.gui.mygaphas.view.ExtendedGtkView view: View
:param rafcon.gui.mygaphas.items.state.StateView item: StateView
:return: side length
:rtype: float | [
"Calculate",
"the",
"side",
"length",
"of",
"a",
"resize",
"handle"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_draw_helper.py#L80-L93 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/utils/gap_draw_helper.py | draw_data_value_rect | def draw_data_value_rect(cairo_context, color, value_size, name_size, pos, port_side):
"""This method draws the containing rect for the data port value, depending on the side and size of the label.
:param cairo_context: Draw Context
:param color: Background color of value part
:param value_size: Size (... | python | def draw_data_value_rect(cairo_context, color, value_size, name_size, pos, port_side):
"""This method draws the containing rect for the data port value, depending on the side and size of the label.
:param cairo_context: Draw Context
:param color: Background color of value part
:param value_size: Size (... | [
"def",
"draw_data_value_rect",
"(",
"cairo_context",
",",
"color",
",",
"value_size",
",",
"name_size",
",",
"pos",
",",
"port_side",
")",
":",
"c",
"=",
"cairo_context",
"rot_angle",
"=",
".0",
"move_x",
"=",
"0.",
"move_y",
"=",
"0.",
"if",
"port_side",
... | This method draws the containing rect for the data port value, depending on the side and size of the label.
:param cairo_context: Draw Context
:param color: Background color of value part
:param value_size: Size (width, height) of label holding the value
:param name_size: Size (width, height) of label ... | [
"This",
"method",
"draws",
"the",
"containing",
"rect",
"for",
"the",
"data",
"port",
"value",
"depending",
"on",
"the",
"side",
"and",
"size",
"of",
"the",
"label",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_draw_helper.py#L96-L142 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/utils/gap_draw_helper.py | draw_connected_scoped_label | def draw_connected_scoped_label(context, color, name_size, handle_pos, port_side, port_side_size,
draw_connection_to_port=False):
"""Draw label of scoped variable
This method draws the label of a scoped variable connected to a data port. This is represented by drawing a bigger
... | python | def draw_connected_scoped_label(context, color, name_size, handle_pos, port_side, port_side_size,
draw_connection_to_port=False):
"""Draw label of scoped variable
This method draws the label of a scoped variable connected to a data port. This is represented by drawing a bigger
... | [
"def",
"draw_connected_scoped_label",
"(",
"context",
",",
"color",
",",
"name_size",
",",
"handle_pos",
",",
"port_side",
",",
"port_side_size",
",",
"draw_connection_to_port",
"=",
"False",
")",
":",
"c",
"=",
"context",
".",
"cairo",
"c",
".",
"set_line_width... | Draw label of scoped variable
This method draws the label of a scoped variable connected to a data port. This is represented by drawing a bigger
label where the top part is filled and the bottom part isn't.
:param context: Draw Context
:param Gdk.Color color: Color to draw the label in (border and bac... | [
"Draw",
"label",
"of",
"scoped",
"variable"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_draw_helper.py#L145-L247 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/utils/gap_draw_helper.py | draw_port_label | def draw_port_label(context, port, transparency, fill, label_position, show_additional_value=False,
additional_value=None, only_extent_calculations=False):
"""Draws a normal label indicating the port name.
:param context: Draw Context
:param port: The PortView
:param transparency: T... | python | def draw_port_label(context, port, transparency, fill, label_position, show_additional_value=False,
additional_value=None, only_extent_calculations=False):
"""Draws a normal label indicating the port name.
:param context: Draw Context
:param port: The PortView
:param transparency: T... | [
"def",
"draw_port_label",
"(",
"context",
",",
"port",
",",
"transparency",
",",
"fill",
",",
"label_position",
",",
"show_additional_value",
"=",
"False",
",",
"additional_value",
"=",
"None",
",",
"only_extent_calculations",
"=",
"False",
")",
":",
"c",
"=",
... | Draws a normal label indicating the port name.
:param context: Draw Context
:param port: The PortView
:param transparency: Transparency of the text
:param fill: Whether the label should be filled or not
:param label_position: Side on which the label should be drawn
:param show_additional_value:... | [
"Draws",
"a",
"normal",
"label",
"indicating",
"the",
"port",
"name",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_draw_helper.py#L250-L413 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/utils/gap_draw_helper.py | draw_label_path | def draw_label_path(context, width, height, arrow_height, distance_to_port, port_offset):
"""Draws the path for an upright label
:param context: The Cairo context
:param float width: Width of the label
:param float height: Height of the label
:param float distance_to_port: Distance to the port rela... | python | def draw_label_path(context, width, height, arrow_height, distance_to_port, port_offset):
"""Draws the path for an upright label
:param context: The Cairo context
:param float width: Width of the label
:param float height: Height of the label
:param float distance_to_port: Distance to the port rela... | [
"def",
"draw_label_path",
"(",
"context",
",",
"width",
",",
"height",
",",
"arrow_height",
",",
"distance_to_port",
",",
"port_offset",
")",
":",
"c",
"=",
"context",
"# The current point is the port position",
"# Mover to outer border of state",
"c",
".",
"rel_move_to... | Draws the path for an upright label
:param context: The Cairo context
:param float width: Width of the label
:param float height: Height of the label
:param float distance_to_port: Distance to the port related to the label
:param float port_offset: Distance from the port center to its border
:p... | [
"Draws",
"the",
"path",
"for",
"an",
"upright",
"label"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/gap_draw_helper.py#L416-L445 |
DLR-RM/RAFCON | source/rafcon/gui/models/library_state.py | LibraryStateModel.prepare_destruction | def prepare_destruction(self, recursive=True):
"""Prepares the model for destruction
Recursively un-registers all observers and removes references to child models
"""
self.destruction_signal.emit()
try:
self.unregister_observer(self)
except KeyError: # Might... | python | def prepare_destruction(self, recursive=True):
"""Prepares the model for destruction
Recursively un-registers all observers and removes references to child models
"""
self.destruction_signal.emit()
try:
self.unregister_observer(self)
except KeyError: # Might... | [
"def",
"prepare_destruction",
"(",
"self",
",",
"recursive",
"=",
"True",
")",
":",
"self",
".",
"destruction_signal",
".",
"emit",
"(",
")",
"try",
":",
"self",
".",
"unregister_observer",
"(",
"self",
")",
"except",
"KeyError",
":",
"# Might happen if the ob... | Prepares the model for destruction
Recursively un-registers all observers and removes references to child models | [
"Prepares",
"the",
"model",
"for",
"destruction"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/library_state.py#L90-L118 |
DLR-RM/RAFCON | source/rafcon/gui/models/library_state.py | LibraryStateModel._load_input_data_port_models | def _load_input_data_port_models(self):
"""Reloads the input data port models directly from the the state"""
if not self.state_copy_initialized:
return
self.input_data_ports = []
for input_data_port_m in self.state_copy.input_data_ports:
new_ip_m = deepcopy(input_... | python | def _load_input_data_port_models(self):
"""Reloads the input data port models directly from the the state"""
if not self.state_copy_initialized:
return
self.input_data_ports = []
for input_data_port_m in self.state_copy.input_data_ports:
new_ip_m = deepcopy(input_... | [
"def",
"_load_input_data_port_models",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"state_copy_initialized",
":",
"return",
"self",
".",
"input_data_ports",
"=",
"[",
"]",
"for",
"input_data_port_m",
"in",
"self",
".",
"state_copy",
".",
"input_data_ports",
... | Reloads the input data port models directly from the the state | [
"Reloads",
"the",
"input",
"data",
"port",
"models",
"directly",
"from",
"the",
"the",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/library_state.py#L142-L151 |
DLR-RM/RAFCON | source/rafcon/gui/models/library_state.py | LibraryStateModel._load_output_data_port_models | def _load_output_data_port_models(self):
"""Reloads the output data port models directly from the the state"""
if not self.state_copy_initialized:
return
self.output_data_ports = []
for output_data_port_m in self.state_copy.output_data_ports:
new_op_m = deepcopy(o... | python | def _load_output_data_port_models(self):
"""Reloads the output data port models directly from the the state"""
if not self.state_copy_initialized:
return
self.output_data_ports = []
for output_data_port_m in self.state_copy.output_data_ports:
new_op_m = deepcopy(o... | [
"def",
"_load_output_data_port_models",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"state_copy_initialized",
":",
"return",
"self",
".",
"output_data_ports",
"=",
"[",
"]",
"for",
"output_data_port_m",
"in",
"self",
".",
"state_copy",
".",
"output_data_ports... | Reloads the output data port models directly from the the state | [
"Reloads",
"the",
"output",
"data",
"port",
"models",
"directly",
"from",
"the",
"the",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/library_state.py#L153-L162 |
DLR-RM/RAFCON | source/rafcon/gui/models/library_state.py | LibraryStateModel._load_income_model | def _load_income_model(self):
"""Reloads the income model directly from the state"""
if not self.state_copy_initialized:
return
self.income = None
income_m = deepcopy(self.state_copy.income)
income_m.parent = self
income_m.income = income_m.income
self... | python | def _load_income_model(self):
"""Reloads the income model directly from the state"""
if not self.state_copy_initialized:
return
self.income = None
income_m = deepcopy(self.state_copy.income)
income_m.parent = self
income_m.income = income_m.income
self... | [
"def",
"_load_income_model",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"state_copy_initialized",
":",
"return",
"self",
".",
"income",
"=",
"None",
"income_m",
"=",
"deepcopy",
"(",
"self",
".",
"state_copy",
".",
"income",
")",
"income_m",
".",
"pa... | Reloads the income model directly from the state | [
"Reloads",
"the",
"income",
"model",
"directly",
"from",
"the",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/library_state.py#L164-L172 |
DLR-RM/RAFCON | source/rafcon/gui/models/library_state.py | LibraryStateModel._load_outcome_models | def _load_outcome_models(self):
"""Reloads the outcome models directly from the state"""
if not self.state_copy_initialized:
return
self.outcomes = []
for outcome_m in self.state_copy.outcomes:
new_oc_m = deepcopy(outcome_m)
new_oc_m.parent = self
... | python | def _load_outcome_models(self):
"""Reloads the outcome models directly from the state"""
if not self.state_copy_initialized:
return
self.outcomes = []
for outcome_m in self.state_copy.outcomes:
new_oc_m = deepcopy(outcome_m)
new_oc_m.parent = self
... | [
"def",
"_load_outcome_models",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"state_copy_initialized",
":",
"return",
"self",
".",
"outcomes",
"=",
"[",
"]",
"for",
"outcome_m",
"in",
"self",
".",
"state_copy",
".",
"outcomes",
":",
"new_oc_m",
"=",
"de... | Reloads the outcome models directly from the state | [
"Reloads",
"the",
"outcome",
"models",
"directly",
"from",
"the",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/library_state.py#L174-L183 |
DLR-RM/RAFCON | source/rafcon/gui/models/library_state.py | LibraryStateModel.show_content | def show_content(self):
"""Check if content of library is to be shown
Content is shown, if the uppermost state's meta flag "show_content" is True and the library hierarchy depth
(up to MAX_VISIBLE_LIBRARY_HIERARCHY level) is not to high.
:return: Whether the content is ... | python | def show_content(self):
"""Check if content of library is to be shown
Content is shown, if the uppermost state's meta flag "show_content" is True and the library hierarchy depth
(up to MAX_VISIBLE_LIBRARY_HIERARCHY level) is not to high.
:return: Whether the content is ... | [
"def",
"show_content",
"(",
"self",
")",
":",
"current_hierarchy_depth",
"=",
"self",
".",
"state",
".",
"library_hierarchy_depth",
"max_hierarchy_depth",
"=",
"global_gui_config",
".",
"get_config_value",
"(",
"\"MAX_VISIBLE_LIBRARY_HIERARCHY\"",
",",
"2",
")",
"if",
... | Check if content of library is to be shown
Content is shown, if the uppermost state's meta flag "show_content" is True and the library hierarchy depth
(up to MAX_VISIBLE_LIBRARY_HIERARCHY level) is not to high.
:return: Whether the content is to be shown
:rtype: bool | [
"Check",
"if",
"content",
"of",
"library",
"is",
"to",
"be",
"shown",
"Content",
"is",
"shown",
"if",
"the",
"uppermost",
"state",
"s",
"meta",
"flag",
"show_content",
"is",
"True",
"and",
"the",
"library",
"hierarchy",
"depth",
"(",
"up",
"to",
"MAX_VISIB... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/library_state.py#L185-L204 |
DLR-RM/RAFCON | source/rafcon/gui/models/state_element.py | StateElementModel.prepare_destruction | def prepare_destruction(self):
"""Prepares the model for destruction
Unregisters the model from observing itself.
"""
if self.core_element is None:
logger.verbose("Multiple calls of prepare destruction for {0}".format(self))
self.destruction_signal.emit()
try... | python | def prepare_destruction(self):
"""Prepares the model for destruction
Unregisters the model from observing itself.
"""
if self.core_element is None:
logger.verbose("Multiple calls of prepare destruction for {0}".format(self))
self.destruction_signal.emit()
try... | [
"def",
"prepare_destruction",
"(",
"self",
")",
":",
"if",
"self",
".",
"core_element",
"is",
"None",
":",
"logger",
".",
"verbose",
"(",
"\"Multiple calls of prepare destruction for {0}\"",
".",
"format",
"(",
"self",
")",
")",
"self",
".",
"destruction_signal",
... | Prepares the model for destruction
Unregisters the model from observing itself. | [
"Prepares",
"the",
"model",
"for",
"destruction"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state_element.py#L114-L126 |
DLR-RM/RAFCON | source/rafcon/gui/models/state_element.py | StateElementModel.model_changed | def model_changed(self, model, prop_name, info):
"""This method notifies the parent state about changes made to the state element
"""
if self.parent is not None:
self.parent.model_changed(model, prop_name, info) | python | def model_changed(self, model, prop_name, info):
"""This method notifies the parent state about changes made to the state element
"""
if self.parent is not None:
self.parent.model_changed(model, prop_name, info) | [
"def",
"model_changed",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"self",
".",
"parent",
"is",
"not",
"None",
":",
"self",
".",
"parent",
".",
"model_changed",
"(",
"model",
",",
"prop_name",
",",
"info",
")"
] | This method notifies the parent state about changes made to the state element | [
"This",
"method",
"notifies",
"the",
"parent",
"state",
"about",
"changes",
"made",
"to",
"the",
"state",
"element"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state_element.py#L128-L132 |
DLR-RM/RAFCON | source/rafcon/gui/models/state_element.py | StateElementModel.meta_changed | def meta_changed(self, model, prop_name, info):
"""This method notifies the parent state about changes made to the meta data
"""
if self.parent is not None:
msg = info.arg
# Add information about notification to the signal message
notification = Notification(m... | python | def meta_changed(self, model, prop_name, info):
"""This method notifies the parent state about changes made to the meta data
"""
if self.parent is not None:
msg = info.arg
# Add information about notification to the signal message
notification = Notification(m... | [
"def",
"meta_changed",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"self",
".",
"parent",
"is",
"not",
"None",
":",
"msg",
"=",
"info",
".",
"arg",
"# Add information about notification to the signal message",
"notification",
"=",
... | This method notifies the parent state about changes made to the meta data | [
"This",
"method",
"notifies",
"the",
"parent",
"state",
"about",
"changes",
"made",
"to",
"the",
"meta",
"data"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/state_element.py#L135-L144 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/execution_ticker.py | ExecutionTickerController.on_config_value_changed | def on_config_value_changed(self, config_m, prop_name, info):
"""Callback when a config value has been changed
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should always be 'config'
:param dict info: Information e.g. about the changed config ... | python | def on_config_value_changed(self, config_m, prop_name, info):
"""Callback when a config value has been changed
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should always be 'config'
:param dict info: Information e.g. about the changed config ... | [
"def",
"on_config_value_changed",
"(",
"self",
",",
"config_m",
",",
"prop_name",
",",
"info",
")",
":",
"config_key",
"=",
"info",
"[",
"'args'",
"]",
"[",
"1",
"]",
"if",
"config_key",
"in",
"[",
"\"EXECUTION_TICKER_ENABLED\"",
"]",
":",
"self",
".",
"ch... | Callback when a config value has been changed
:param ConfigModel config_m: The config model that has been changed
:param str prop_name: Should always be 'config'
:param dict info: Information e.g. about the changed config key | [
"Callback",
"when",
"a",
"config",
"value",
"has",
"been",
"changed"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/execution_ticker.py#L72-L82 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/execution_ticker.py | ExecutionTickerController.disable | def disable(self):
""" Relieve all state machines that have no active execution and hide the widget """
self.ticker_text_label.hide()
if self.current_observed_sm_m:
self.stop_sm_m_observation(self.current_observed_sm_m) | python | def disable(self):
""" Relieve all state machines that have no active execution and hide the widget """
self.ticker_text_label.hide()
if self.current_observed_sm_m:
self.stop_sm_m_observation(self.current_observed_sm_m) | [
"def",
"disable",
"(",
"self",
")",
":",
"self",
".",
"ticker_text_label",
".",
"hide",
"(",
")",
"if",
"self",
".",
"current_observed_sm_m",
":",
"self",
".",
"stop_sm_m_observation",
"(",
"self",
".",
"current_observed_sm_m",
")"
] | Relieve all state machines that have no active execution and hide the widget | [
"Relieve",
"all",
"state",
"machines",
"that",
"have",
"no",
"active",
"execution",
"and",
"hide",
"the",
"widget"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/execution_ticker.py#L90-L95 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/execution_ticker.py | ExecutionTickerController.on_state_execution_status_changed_after | def on_state_execution_status_changed_after(self, model, prop_name, info):
""" Show current execution status in the widget
This function specifies what happens if the state machine execution status of a state changes
:param model: the model of the state that has changed (most likely it... | python | def on_state_execution_status_changed_after(self, model, prop_name, info):
""" Show current execution status in the widget
This function specifies what happens if the state machine execution status of a state changes
:param model: the model of the state that has changed (most likely it... | [
"def",
"on_state_execution_status_changed_after",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"from",
"rafcon",
".",
"gui",
".",
"utils",
".",
"notification_overview",
"import",
"NotificationOverview",
"from",
"rafcon",
".",
"core",
".",
... | Show current execution status in the widget
This function specifies what happens if the state machine execution status of a state changes
:param model: the model of the state that has changed (most likely its execution status)
:param prop_name: property name that has been changed
... | [
"Show",
"current",
"execution",
"status",
"in",
"the",
"widget"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/execution_ticker.py#L105-L149 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/execution_ticker.py | ExecutionTickerController.execution_engine_model_changed | def execution_engine_model_changed(self, model, prop_name, info):
"""Active observation of state machine and show and hide widget. """
if not self._view_initialized:
return
active_sm_id = rafcon.gui.singleton.state_machine_manager_model.state_machine_manager.active_state_machine_id
... | python | def execution_engine_model_changed(self, model, prop_name, info):
"""Active observation of state machine and show and hide widget. """
if not self._view_initialized:
return
active_sm_id = rafcon.gui.singleton.state_machine_manager_model.state_machine_manager.active_state_machine_id
... | [
"def",
"execution_engine_model_changed",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"if",
"not",
"self",
".",
"_view_initialized",
":",
"return",
"active_sm_id",
"=",
"rafcon",
".",
"gui",
".",
"singleton",
".",
"state_machine_manager_mo... | Active observation of state machine and show and hide widget. | [
"Active",
"observation",
"of",
"state",
"machine",
"and",
"show",
"and",
"hide",
"widget",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/execution_ticker.py#L163-L174 |
DLR-RM/RAFCON | share/examples/plugins/templates/core_template_observer.py | ExecutionEngineObserver.register_observer | def register_observer(self):
""" Register all observable which are of interest
"""
self.execution_engine.add_observer(self, "start", notify_before_function=self.on_start)
self.execution_engine.add_observer(self, "pause", notify_before_function=self.on_pause)
self.execution_engine... | python | def register_observer(self):
""" Register all observable which are of interest
"""
self.execution_engine.add_observer(self, "start", notify_before_function=self.on_start)
self.execution_engine.add_observer(self, "pause", notify_before_function=self.on_pause)
self.execution_engine... | [
"def",
"register_observer",
"(",
"self",
")",
":",
"self",
".",
"execution_engine",
".",
"add_observer",
"(",
"self",
",",
"\"start\"",
",",
"notify_before_function",
"=",
"self",
".",
"on_start",
")",
"self",
".",
"execution_engine",
".",
"add_observer",
"(",
... | Register all observable which are of interest | [
"Register",
"all",
"observable",
"which",
"are",
"of",
"interest"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/core_template_observer.py#L17-L22 |
DLR-RM/RAFCON | share/examples/plugins/templates/core_template_observer.py | ExecutionStatusObserver.register_states_of_state_machine | def register_states_of_state_machine(self, state_machine):
""" This functions registers all states of state machine.
:param state_machine: the state machine to register all states of
:return:
"""
root = state_machine.root_state
root.add_observer(self, "state_execution_sta... | python | def register_states_of_state_machine(self, state_machine):
""" This functions registers all states of state machine.
:param state_machine: the state machine to register all states of
:return:
"""
root = state_machine.root_state
root.add_observer(self, "state_execution_sta... | [
"def",
"register_states_of_state_machine",
"(",
"self",
",",
"state_machine",
")",
":",
"root",
"=",
"state_machine",
".",
"root_state",
"root",
".",
"add_observer",
"(",
"self",
",",
"\"state_execution_status\"",
",",
"notify_after_function",
"=",
"self",
".",
"on_... | This functions registers all states of state machine.
:param state_machine: the state machine to register all states of
:return: | [
"This",
"functions",
"registers",
"all",
"states",
"of",
"state",
"machine",
".",
":",
"param",
"state_machine",
":",
"the",
"state",
"machine",
"to",
"register",
"all",
"states",
"of",
":",
"return",
":"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/core_template_observer.py#L47-L55 |
DLR-RM/RAFCON | share/examples/plugins/templates/core_template_observer.py | ExecutionStatusObserver.recursively_register_child_states | def recursively_register_child_states(self, state):
""" A function tha registers recursively all child states of a state
:param state:
:return:
"""
self.logger.info("Execution status observer add new state {}".format(state))
if isinstance(state, ContainerState):
... | python | def recursively_register_child_states(self, state):
""" A function tha registers recursively all child states of a state
:param state:
:return:
"""
self.logger.info("Execution status observer add new state {}".format(state))
if isinstance(state, ContainerState):
... | [
"def",
"recursively_register_child_states",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Execution status observer add new state {}\"",
".",
"format",
"(",
"state",
")",
")",
"if",
"isinstance",
"(",
"state",
",",
"ContainerStat... | A function tha registers recursively all child states of a state
:param state:
:return: | [
"A",
"function",
"tha",
"registers",
"recursively",
"all",
"child",
"states",
"of",
"a",
"state",
":",
"param",
"state",
":",
":",
"return",
":"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/core_template_observer.py#L57-L74 |
DLR-RM/RAFCON | share/examples/plugins/templates/core_template_observer.py | ExecutionStatusObserver.on_add_state_machine_after | def on_add_state_machine_after(self, observable, return_value, args):
""" This method specifies what happens when a state machine is added to the state machine manager
:param observable: the state machine manager
:param return_value: the new state machine
:param args:
:return:
... | python | def on_add_state_machine_after(self, observable, return_value, args):
""" This method specifies what happens when a state machine is added to the state machine manager
:param observable: the state machine manager
:param return_value: the new state machine
:param args:
:return:
... | [
"def",
"on_add_state_machine_after",
"(",
"self",
",",
"observable",
",",
"return_value",
",",
"args",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Execution status observer register new state machine sm_id: {}\"",
".",
"format",
"(",
"args",
"[",
"1",
"]",... | This method specifies what happens when a state machine is added to the state machine manager
:param observable: the state machine manager
:param return_value: the new state machine
:param args:
:return: | [
"This",
"method",
"specifies",
"what",
"happens",
"when",
"a",
"state",
"machine",
"is",
"added",
"to",
"the",
"state",
"machine",
"manager",
":",
"param",
"observable",
":",
"the",
"state",
"machine",
"manager",
":",
"param",
"return_value",
":",
"the",
"ne... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/core_template_observer.py#L76-L84 |
DLR-RM/RAFCON | share/examples/plugins/templates/core_template_observer.py | ExecutionStatusObserver.on_state_execution_status_changed_after | def on_state_execution_status_changed_after(self, observable, return_value, args):
""" This function specifies what happens if the state machine execution status of a state changes
:param observable: the state whose execution status changed
:param return_value: the new execution status
:... | python | def on_state_execution_status_changed_after(self, observable, return_value, args):
""" This function specifies what happens if the state machine execution status of a state changes
:param observable: the state whose execution status changed
:param return_value: the new execution status
:... | [
"def",
"on_state_execution_status_changed_after",
"(",
"self",
",",
"observable",
",",
"return_value",
",",
"args",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Execution status has changed for state '{0}' to status: {1}\"",
"\"\"",
".",
"format",
"(",
"observa... | This function specifies what happens if the state machine execution status of a state changes
:param observable: the state whose execution status changed
:param return_value: the new execution status
:param args: a list of all arguments of the observed function
:return: | [
"This",
"function",
"specifies",
"what",
"happens",
"if",
"the",
"state",
"machine",
"execution",
"status",
"of",
"a",
"state",
"changes",
":",
"param",
"observable",
":",
"the",
"state",
"whose",
"execution",
"status",
"changed",
":",
"param",
"return_value",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/core_template_observer.py#L96-L104 |
DLR-RM/RAFCON | source/rafcon/core/states/hierarchy_state.py | HierarchyState._initialize_hierarchy | def _initialize_hierarchy(self):
""" This function covers the whole initialization routine before executing a hierarchy state.
:return:
"""
logger.debug("Starting execution of {0}{1}".format(self, " (backwards)" if self.backward_execution else ""))
# reset variables
self... | python | def _initialize_hierarchy(self):
""" This function covers the whole initialization routine before executing a hierarchy state.
:return:
"""
logger.debug("Starting execution of {0}{1}".format(self, " (backwards)" if self.backward_execution else ""))
# reset variables
self... | [
"def",
"_initialize_hierarchy",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Starting execution of {0}{1}\"",
".",
"format",
"(",
"self",
",",
"\" (backwards)\"",
"if",
"self",
".",
"backward_execution",
"else",
"\"\"",
")",
")",
"# reset variables",
"se... | This function covers the whole initialization routine before executing a hierarchy state.
:return: | [
"This",
"function",
"covers",
"the",
"whole",
"initialization",
"routine",
"before",
"executing",
"a",
"hierarchy",
"state",
".",
":",
"return",
":"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/hierarchy_state.py#L58-L85 |
DLR-RM/RAFCON | source/rafcon/core/states/hierarchy_state.py | HierarchyState.run | def run(self):
""" This defines the sequence of actions that are taken when the hierarchy is executed. A hierarchy state
executes all its child states recursively. Principally this code collects all input data for the next
child state, executes it, stores its output data and determines the next ... | python | def run(self):
""" This defines the sequence of actions that are taken when the hierarchy is executed. A hierarchy state
executes all its child states recursively. Principally this code collects all input data for the next
child state, executes it, stores its output data and determines the next ... | [
"def",
"run",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_initialize_hierarchy",
"(",
")",
"while",
"self",
".",
"child_state",
"is",
"not",
"self",
":",
"# print(\"hs1\", self.name)",
"self",
".",
"handling_execution_mode",
"=",
"True",
"execution_mode",
... | This defines the sequence of actions that are taken when the hierarchy is executed. A hierarchy state
executes all its child states recursively. Principally this code collects all input data for the next
child state, executes it, stores its output data and determines the next state
based on the ... | [
"This",
"defines",
"the",
"sequence",
"of",
"actions",
"that",
"are",
"taken",
"when",
"the",
"hierarchy",
"is",
"executed",
".",
"A",
"hierarchy",
"state",
"executes",
"all",
"its",
"child",
"states",
"recursively",
".",
"Principally",
"this",
"code",
"collec... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/hierarchy_state.py#L87-L153 |
DLR-RM/RAFCON | source/rafcon/core/states/hierarchy_state.py | HierarchyState._handle_backward_execution_before_child_execution | def _handle_backward_execution_before_child_execution(self):
""" Sets up all data after receiving a backward execution step from the execution engine
:return: a flag to indicate if normal child state execution should abort
"""
self.backward_execution = True
last_history_item = se... | python | def _handle_backward_execution_before_child_execution(self):
""" Sets up all data after receiving a backward execution step from the execution engine
:return: a flag to indicate if normal child state execution should abort
"""
self.backward_execution = True
last_history_item = se... | [
"def",
"_handle_backward_execution_before_child_execution",
"(",
"self",
")",
":",
"self",
".",
"backward_execution",
"=",
"True",
"last_history_item",
"=",
"self",
".",
"execution_history",
".",
"pop_last_item",
"(",
")",
"if",
"last_history_item",
".",
"state_referenc... | Sets up all data after receiving a backward execution step from the execution engine
:return: a flag to indicate if normal child state execution should abort | [
"Sets",
"up",
"all",
"data",
"after",
"receiving",
"a",
"backward",
"execution",
"step",
"from",
"the",
"execution",
"engine",
":",
"return",
":",
"a",
"flag",
"to",
"indicate",
"if",
"normal",
"child",
"state",
"execution",
"should",
"abort"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/hierarchy_state.py#L169-L184 |
DLR-RM/RAFCON | source/rafcon/core/states/hierarchy_state.py | HierarchyState._execute_current_child | def _execute_current_child(self):
""" Collect all data for a child state and execute it.
:return:
"""
self.child_state.input_data = self.get_inputs_for_state(self.child_state)
self.child_state.output_data = self.create_output_dictionary_for_state(self.child_state)
# pro... | python | def _execute_current_child(self):
""" Collect all data for a child state and execute it.
:return:
"""
self.child_state.input_data = self.get_inputs_for_state(self.child_state)
self.child_state.output_data = self.create_output_dictionary_for_state(self.child_state)
# pro... | [
"def",
"_execute_current_child",
"(",
"self",
")",
":",
"self",
".",
"child_state",
".",
"input_data",
"=",
"self",
".",
"get_inputs_for_state",
"(",
"self",
".",
"child_state",
")",
"self",
".",
"child_state",
".",
"output_data",
"=",
"self",
".",
"create_out... | Collect all data for a child state and execute it.
:return: | [
"Collect",
"all",
"data",
"for",
"a",
"child",
"state",
"and",
"execute",
"it",
".",
":",
"return",
":"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/hierarchy_state.py#L186-L234 |
DLR-RM/RAFCON | source/rafcon/core/states/hierarchy_state.py | HierarchyState._handle_backward_execution_after_child_execution | def _handle_backward_execution_after_child_execution(self):
"""Cleanup the former child state execution and prepare for the next state execution in the backward
execution case.
:return: a flag to indicate if normal child state execution should abort
"""
self.child_state.state_exe... | python | def _handle_backward_execution_after_child_execution(self):
"""Cleanup the former child state execution and prepare for the next state execution in the backward
execution case.
:return: a flag to indicate if normal child state execution should abort
"""
self.child_state.state_exe... | [
"def",
"_handle_backward_execution_after_child_execution",
"(",
"self",
")",
":",
"self",
".",
"child_state",
".",
"state_execution_status",
"=",
"StateExecutionStatus",
".",
"WAIT_FOR_NEXT_STATE",
"# the item popped now from the history will be a CallItem and will contain the scoped d... | Cleanup the former child state execution and prepare for the next state execution in the backward
execution case.
:return: a flag to indicate if normal child state execution should abort | [
"Cleanup",
"the",
"former",
"child",
"state",
"execution",
"and",
"prepare",
"for",
"the",
"next",
"state",
"execution",
"in",
"the",
"backward",
"execution",
"case",
".",
":",
"return",
":",
"a",
"flag",
"to",
"indicate",
"if",
"normal",
"child",
"state",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/hierarchy_state.py#L236-L259 |
DLR-RM/RAFCON | source/rafcon/core/states/hierarchy_state.py | HierarchyState._handle_forward_execution_after_child_execution | def _handle_forward_execution_after_child_execution(self):
""" Cleanup the former child state execution and prepare for the next state execution in the forward
execution case.
:return: a flag to indicate if normal child state execution should abort
"""
self.add_state_execution_ou... | python | def _handle_forward_execution_after_child_execution(self):
""" Cleanup the former child state execution and prepare for the next state execution in the forward
execution case.
:return: a flag to indicate if normal child state execution should abort
"""
self.add_state_execution_ou... | [
"def",
"_handle_forward_execution_after_child_execution",
"(",
"self",
")",
":",
"self",
".",
"add_state_execution_output_to_scoped_data",
"(",
"self",
".",
"child_state",
".",
"output_data",
",",
"self",
".",
"child_state",
")",
"self",
".",
"update_scoped_variables_with... | Cleanup the former child state execution and prepare for the next state execution in the forward
execution case.
:return: a flag to indicate if normal child state execution should abort | [
"Cleanup",
"the",
"former",
"child",
"state",
"execution",
"and",
"prepare",
"for",
"the",
"next",
"state",
"execution",
"in",
"the",
"forward",
"execution",
"case",
".",
":",
"return",
":",
"a",
"flag",
"to",
"indicate",
"if",
"normal",
"child",
"state",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/hierarchy_state.py#L261-L287 |
DLR-RM/RAFCON | source/rafcon/core/states/hierarchy_state.py | HierarchyState._finalize_hierarchy | def _finalize_hierarchy(self):
""" This function finalizes the execution of a hierarchy state. It sets the correct status and manages
the output data handling.
:return:
"""
if self.last_child:
self.last_child.state_execution_status = StateExecutionStatus.INACTIVE
... | python | def _finalize_hierarchy(self):
""" This function finalizes the execution of a hierarchy state. It sets the correct status and manages
the output data handling.
:return:
"""
if self.last_child:
self.last_child.state_execution_status = StateExecutionStatus.INACTIVE
... | [
"def",
"_finalize_hierarchy",
"(",
"self",
")",
":",
"if",
"self",
".",
"last_child",
":",
"self",
".",
"last_child",
".",
"state_execution_status",
"=",
"StateExecutionStatus",
".",
"INACTIVE",
"if",
"not",
"self",
".",
"backward_execution",
":",
"if",
"self",
... | This function finalizes the execution of a hierarchy state. It sets the correct status and manages
the output data handling.
:return: | [
"This",
"function",
"finalizes",
"the",
"execution",
"of",
"a",
"hierarchy",
"state",
".",
"It",
"sets",
"the",
"correct",
"status",
"and",
"manages",
"the",
"output",
"data",
"handling",
".",
":",
"return",
":"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/hierarchy_state.py#L289-L313 |
DLR-RM/RAFCON | source/rafcon/gui/views/main_window.py | MainWindowView.rotate_and_detach_tab_labels | def rotate_and_detach_tab_labels(self):
"""Rotates tab labels of a given notebook by 90 degrees and makes them detachable.
:param notebook: GTK Notebook container, whose tab labels are to be rotated and made detachable
"""
icons = {'Libraries': constants.SIGN_LIB, 'States Tree': constan... | python | def rotate_and_detach_tab_labels(self):
"""Rotates tab labels of a given notebook by 90 degrees and makes them detachable.
:param notebook: GTK Notebook container, whose tab labels are to be rotated and made detachable
"""
icons = {'Libraries': constants.SIGN_LIB, 'States Tree': constan... | [
"def",
"rotate_and_detach_tab_labels",
"(",
"self",
")",
":",
"icons",
"=",
"{",
"'Libraries'",
":",
"constants",
".",
"SIGN_LIB",
",",
"'States Tree'",
":",
"constants",
".",
"ICON_TREE",
",",
"'Global Variables'",
":",
"constants",
".",
"ICON_GLOB",
",",
"'Mod... | Rotates tab labels of a given notebook by 90 degrees and makes them detachable.
:param notebook: GTK Notebook container, whose tab labels are to be rotated and made detachable | [
"Rotates",
"tab",
"labels",
"of",
"a",
"given",
"notebook",
"by",
"90",
"degrees",
"and",
"makes",
"them",
"detachable",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/main_window.py#L225-L240 |
DLR-RM/RAFCON | source/rafcon/gui/views/main_window.py | MainWindowView.bring_tab_to_the_top | def bring_tab_to_the_top(self, tab_label):
"""Find tab with label tab_label in list of notebooks and set it to the current page.
:param tab_label: String containing the label of the tab to be focused
"""
found = False
for notebook in self.left_bar_notebooks:
for i in... | python | def bring_tab_to_the_top(self, tab_label):
"""Find tab with label tab_label in list of notebooks and set it to the current page.
:param tab_label: String containing the label of the tab to be focused
"""
found = False
for notebook in self.left_bar_notebooks:
for i in... | [
"def",
"bring_tab_to_the_top",
"(",
"self",
",",
"tab_label",
")",
":",
"found",
"=",
"False",
"for",
"notebook",
"in",
"self",
".",
"left_bar_notebooks",
":",
"for",
"i",
"in",
"range",
"(",
"notebook",
".",
"get_n_pages",
"(",
")",
")",
":",
"if",
"gui... | Find tab with label tab_label in list of notebooks and set it to the current page.
:param tab_label: String containing the label of the tab to be focused | [
"Find",
"tab",
"with",
"label",
"tab_label",
"in",
"list",
"of",
"notebooks",
"and",
"set",
"it",
"to",
"the",
"current",
"page",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/main_window.py#L242-L255 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/utility.py | add_transitions_from_selected_state_to_parent | def add_transitions_from_selected_state_to_parent():
""" Generates the default success transition of a state to its parent success port
:return:
"""
task_string = "create transition"
sub_task_string = "to parent state"
selected_state_m, msg = get_selected_single_state_model_and_check_for_its_p... | python | def add_transitions_from_selected_state_to_parent():
""" Generates the default success transition of a state to its parent success port
:return:
"""
task_string = "create transition"
sub_task_string = "to parent state"
selected_state_m, msg = get_selected_single_state_model_and_check_for_its_p... | [
"def",
"add_transitions_from_selected_state_to_parent",
"(",
")",
":",
"task_string",
"=",
"\"create transition\"",
"sub_task_string",
"=",
"\"to parent state\"",
"selected_state_m",
",",
"msg",
"=",
"get_selected_single_state_model_and_check_for_its_parent",
"(",
")",
"if",
"s... | Generates the default success transition of a state to its parent success port
:return: | [
"Generates",
"the",
"default",
"success",
"transition",
"of",
"a",
"state",
"to",
"its",
"parent",
"success",
"port"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/utility.py#L61-L105 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/utility.py | add_transitions_to_closest_sibling_state_from_selected_state | def add_transitions_to_closest_sibling_state_from_selected_state():
""" Generates the outcome transitions from outcomes with positive outcome_id to the closest next state
:return:
"""
task_string = "create transition"
sub_task_string = "to closest sibling state"
selected_state_m, msg = get_sele... | python | def add_transitions_to_closest_sibling_state_from_selected_state():
""" Generates the outcome transitions from outcomes with positive outcome_id to the closest next state
:return:
"""
task_string = "create transition"
sub_task_string = "to closest sibling state"
selected_state_m, msg = get_sele... | [
"def",
"add_transitions_to_closest_sibling_state_from_selected_state",
"(",
")",
":",
"task_string",
"=",
"\"create transition\"",
"sub_task_string",
"=",
"\"to closest sibling state\"",
"selected_state_m",
",",
"msg",
"=",
"get_selected_single_state_model_and_check_for_its_parent",
... | Generates the outcome transitions from outcomes with positive outcome_id to the closest next state
:return: | [
"Generates",
"the",
"outcome",
"transitions",
"from",
"outcomes",
"with",
"positive",
"outcome_id",
"to",
"the",
"closest",
"next",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/utility.py#L108-L156 |
openego/eTraGo | etrago/tools/plot.py | add_coordinates | def add_coordinates(network):
"""
Add coordinates to nodes based on provided geom
Parameters
----------
network : PyPSA network container
Returns
-------
Altered PyPSA network container ready for plotting
"""
for idx, row in network.buses.iterrows():
wkt_geom = to_shape... | python | def add_coordinates(network):
"""
Add coordinates to nodes based on provided geom
Parameters
----------
network : PyPSA network container
Returns
-------
Altered PyPSA network container ready for plotting
"""
for idx, row in network.buses.iterrows():
wkt_geom = to_shape... | [
"def",
"add_coordinates",
"(",
"network",
")",
":",
"for",
"idx",
",",
"row",
"in",
"network",
".",
"buses",
".",
"iterrows",
"(",
")",
":",
"wkt_geom",
"=",
"to_shape",
"(",
"row",
"[",
"'geom'",
"]",
")",
"network",
".",
"buses",
".",
"loc",
"[",
... | Add coordinates to nodes based on provided geom
Parameters
----------
network : PyPSA network container
Returns
-------
Altered PyPSA network container ready for plotting | [
"Add",
"coordinates",
"to",
"nodes",
"based",
"on",
"provided",
"geom"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L52-L69 |
openego/eTraGo | etrago/tools/plot.py | plot_line_loading | def plot_line_loading(
network,
timesteps=range(1,2),
filename=None,
boundaries=[],
arrows=False):
"""
Plots line loading as a colored heatmap.
Line loading is displayed as relative to nominal capacity in %.
Parameters
----------
network : PyPSA netw... | python | def plot_line_loading(
network,
timesteps=range(1,2),
filename=None,
boundaries=[],
arrows=False):
"""
Plots line loading as a colored heatmap.
Line loading is displayed as relative to nominal capacity in %.
Parameters
----------
network : PyPSA netw... | [
"def",
"plot_line_loading",
"(",
"network",
",",
"timesteps",
"=",
"range",
"(",
"1",
",",
"2",
")",
",",
"filename",
"=",
"None",
",",
"boundaries",
"=",
"[",
"]",
",",
"arrows",
"=",
"False",
")",
":",
"# TODO: replace p0 by max(p0,p1) and analogously for q0... | Plots line loading as a colored heatmap.
Line loading is displayed as relative to nominal capacity in %.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
timesteps : range
Defines which timesteps are consi... | [
"Plots",
"line",
"loading",
"as",
"a",
"colored",
"heatmap",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L98-L241 |
openego/eTraGo | etrago/tools/plot.py | plot_line_loading_diff | def plot_line_loading_diff(networkA, networkB, timestep=0):
"""
Plot difference in line loading between two networks
(with and without switches) as color on lines
Positive values mean that line loading with switches is bigger than without
Plot switches as small dots
Parameters
--------... | python | def plot_line_loading_diff(networkA, networkB, timestep=0):
"""
Plot difference in line loading between two networks
(with and without switches) as color on lines
Positive values mean that line loading with switches is bigger than without
Plot switches as small dots
Parameters
--------... | [
"def",
"plot_line_loading_diff",
"(",
"networkA",
",",
"networkB",
",",
"timestep",
"=",
"0",
")",
":",
"# new colormap to make sure 0% difference has the same color in every plot",
"def",
"shiftedColorMap",
"(",
"cmap",
",",
"start",
"=",
"0",
",",
"midpoint",
"=",
"... | Plot difference in line loading between two networks
(with and without switches) as color on lines
Positive values mean that line loading with switches is bigger than without
Plot switches as small dots
Parameters
----------
networkA : PyPSA network container
Holds topology of grid... | [
"Plot",
"difference",
"in",
"line",
"loading",
"between",
"two",
"networks",
"(",
"with",
"and",
"without",
"switches",
")",
"as",
"color",
"on",
"lines"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L245-L357 |
openego/eTraGo | etrago/tools/plot.py | network_expansion | def network_expansion(network, method = 'rel', ext_min=0.1,
ext_width=False, filename=None, boundaries=[]):
"""Plot relative or absolute network extension of AC- and DC-lines.
Parameters
----------
network: PyPSA network container
Holds topology of grid including resul... | python | def network_expansion(network, method = 'rel', ext_min=0.1,
ext_width=False, filename=None, boundaries=[]):
"""Plot relative or absolute network extension of AC- and DC-lines.
Parameters
----------
network: PyPSA network container
Holds topology of grid including resul... | [
"def",
"network_expansion",
"(",
"network",
",",
"method",
"=",
"'rel'",
",",
"ext_min",
"=",
"0.1",
",",
"ext_width",
"=",
"False",
",",
"filename",
"=",
"None",
",",
"boundaries",
"=",
"[",
"]",
")",
":",
"cmap",
"=",
"plt",
".",
"cm",
".",
"jet",
... | Plot relative or absolute network extension of AC- and DC-lines.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
method: str
Choose 'rel' for extension relative to s_nom and 'abs' for
absolute extension... | [
"Plot",
"relative",
"or",
"absolute",
"network",
"extension",
"of",
"AC",
"-",
"and",
"DC",
"-",
"lines",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"powe... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L361-L492 |
openego/eTraGo | etrago/tools/plot.py | network_expansion_diff | def network_expansion_diff (networkA, networkB, filename=None, boundaries=[]):
"""Plot relative network expansion derivation of AC- and DC-lines.
Parameters
----------
networkA: PyPSA network container
Holds topology of grid including results from powerflow analysis
networkB: PyPSA netw... | python | def network_expansion_diff (networkA, networkB, filename=None, boundaries=[]):
"""Plot relative network expansion derivation of AC- and DC-lines.
Parameters
----------
networkA: PyPSA network container
Holds topology of grid including results from powerflow analysis
networkB: PyPSA netw... | [
"def",
"network_expansion_diff",
"(",
"networkA",
",",
"networkB",
",",
"filename",
"=",
"None",
",",
"boundaries",
"=",
"[",
"]",
")",
":",
"cmap",
"=",
"plt",
".",
"cm",
".",
"jet",
"array_line",
"=",
"[",
"[",
"'Line'",
"]",
"*",
"len",
"(",
"netw... | Plot relative network expansion derivation of AC- and DC-lines.
Parameters
----------
networkA: PyPSA network container
Holds topology of grid including results from powerflow analysis
networkB: PyPSA network container
Holds topology of grid including results from powerflow analysis... | [
"Plot",
"relative",
"network",
"expansion",
"derivation",
"of",
"AC",
"-",
"and",
"DC",
"-",
"lines",
".",
"Parameters",
"----------",
"networkA",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"powerflow... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L494-L561 |
openego/eTraGo | etrago/tools/plot.py | full_load_hours | def full_load_hours(network, boundaries=[], filename=None, two_cb=False):
"""Plot loading of lines in equivalten full load hours.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
filename: str or None
Save fi... | python | def full_load_hours(network, boundaries=[], filename=None, two_cb=False):
"""Plot loading of lines in equivalten full load hours.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
filename: str or None
Save fi... | [
"def",
"full_load_hours",
"(",
"network",
",",
"boundaries",
"=",
"[",
"]",
",",
"filename",
"=",
"None",
",",
"two_cb",
"=",
"False",
")",
":",
"cmap",
"=",
"plt",
".",
"cm",
".",
"jet",
"array_line",
"=",
"[",
"[",
"'Line'",
"]",
"*",
"len",
"(",... | Plot loading of lines in equivalten full load hours.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
filename: str or None
Save figure in this direction
boundaries: array
Set boundaries of heatmap axi... | [
"Plot",
"loading",
"of",
"lines",
"in",
"equivalten",
"full",
"load",
"hours",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"powerflow",
"analysis",
"filename",... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L564-L623 |
openego/eTraGo | etrago/tools/plot.py | plot_q_flows | def plot_q_flows(network):
"""Plot maximal reactive line load.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
"""
cmap_line = plt.cm.jet
q_flows_max = abs(network.lines_t.q0.abs().max()/(network.line... | python | def plot_q_flows(network):
"""Plot maximal reactive line load.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
"""
cmap_line = plt.cm.jet
q_flows_max = abs(network.lines_t.q0.abs().max()/(network.line... | [
"def",
"plot_q_flows",
"(",
"network",
")",
":",
"cmap_line",
"=",
"plt",
".",
"cm",
".",
"jet",
"q_flows_max",
"=",
"abs",
"(",
"network",
".",
"lines_t",
".",
"q0",
".",
"abs",
"(",
")",
".",
"max",
"(",
")",
"/",
"(",
"network",
".",
"lines",
... | Plot maximal reactive line load.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis | [
"Plot",
"maximal",
"reactive",
"line",
"load",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"powerflow",
"analysis"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L625-L645 |
openego/eTraGo | etrago/tools/plot.py | max_load | def max_load(network, boundaries=[], filename=None, two_cb=False):
"""Plot maximum loading of each line.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
filename: str or None
Save figure in this direct... | python | def max_load(network, boundaries=[], filename=None, two_cb=False):
"""Plot maximum loading of each line.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
filename: str or None
Save figure in this direct... | [
"def",
"max_load",
"(",
"network",
",",
"boundaries",
"=",
"[",
"]",
",",
"filename",
"=",
"None",
",",
"two_cb",
"=",
"False",
")",
":",
"cmap_line",
"=",
"plt",
".",
"cm",
".",
"jet",
"cmap_link",
"=",
"plt",
".",
"cm",
".",
"jet",
"array_line",
... | Plot maximum loading of each line.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
filename: str or None
Save figure in this direction
boundaries: array
Set boundaries of heatmap axis
two_cb: boo... | [
"Plot",
"maximum",
"loading",
"of",
"each",
"line",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"powerflow",
"analysis",
"filename",
":",
"str",
"or",
"None"... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L648-L716 |
openego/eTraGo | etrago/tools/plot.py | load_hours | def load_hours(network, min_load=0.9, max_load=1, boundaries=[0, 8760]):
"""Plot number of hours with line loading in selected range.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
min_load: float
Cho... | python | def load_hours(network, min_load=0.9, max_load=1, boundaries=[0, 8760]):
"""Plot number of hours with line loading in selected range.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
min_load: float
Cho... | [
"def",
"load_hours",
"(",
"network",
",",
"min_load",
"=",
"0.9",
",",
"max_load",
"=",
"1",
",",
"boundaries",
"=",
"[",
"0",
",",
"8760",
"]",
")",
":",
"cmap_line",
"=",
"plt",
".",
"cm",
".",
"jet",
"cmap_link",
"=",
"plt",
".",
"cm",
".",
"j... | Plot number of hours with line loading in selected range.
Parameters
----------
network: PyPSA network container
Holds topology of grid including results from powerflow analysis
min_load: float
Choose lower bound of relative load
max_load: float
Choose upper bound of r... | [
"Plot",
"number",
"of",
"hours",
"with",
"line",
"loading",
"in",
"selected",
"range",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"powerflow",
"analysis",
"... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L719-L789 |
openego/eTraGo | etrago/tools/plot.py | plot_residual_load | def plot_residual_load(network):
""" Plots residual load summed of all exisiting buses.
Parameters
----------
network : PyPSA network containter
"""
renewables = network.generators[
network.generators.carrier.isin(['wind_onshore', 'wind_offshore',
... | python | def plot_residual_load(network):
""" Plots residual load summed of all exisiting buses.
Parameters
----------
network : PyPSA network containter
"""
renewables = network.generators[
network.generators.carrier.isin(['wind_onshore', 'wind_offshore',
... | [
"def",
"plot_residual_load",
"(",
"network",
")",
":",
"renewables",
"=",
"network",
".",
"generators",
"[",
"network",
".",
"generators",
".",
"carrier",
".",
"isin",
"(",
"[",
"'wind_onshore'",
",",
"'wind_offshore'",
",",
"'solar'",
",",
"'run_of_river'",
"... | Plots residual load summed of all exisiting buses.
Parameters
----------
network : PyPSA network containter | [
"Plots",
"residual",
"load",
"summed",
"of",
"all",
"exisiting",
"buses",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L792-L827 |
openego/eTraGo | etrago/tools/plot.py | plot_stacked_gen | def plot_stacked_gen(network, bus=None, resolution='GW', filename=None):
"""
Plot stacked sum of generation grouped by carrier type
Parameters
----------
network : PyPSA network container
bus: string
Plot all generators at one specific bus. If none,
sum is calulated for all bus... | python | def plot_stacked_gen(network, bus=None, resolution='GW', filename=None):
"""
Plot stacked sum of generation grouped by carrier type
Parameters
----------
network : PyPSA network container
bus: string
Plot all generators at one specific bus. If none,
sum is calulated for all bus... | [
"def",
"plot_stacked_gen",
"(",
"network",
",",
"bus",
"=",
"None",
",",
"resolution",
"=",
"'GW'",
",",
"filename",
"=",
"None",
")",
":",
"if",
"resolution",
"==",
"'GW'",
":",
"reso_int",
"=",
"1e3",
"elif",
"resolution",
"==",
"'MW'",
":",
"reso_int"... | Plot stacked sum of generation grouped by carrier type
Parameters
----------
network : PyPSA network container
bus: string
Plot all generators at one specific bus. If none,
sum is calulated for all buses
resolution: string
Unit for y-axis. Can be either GW/MW/KW
Return... | [
"Plot",
"stacked",
"sum",
"of",
"generation",
"grouped",
"by",
"carrier",
"type"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L831-L908 |
openego/eTraGo | etrago/tools/plot.py | plot_gen_diff | def plot_gen_diff(
networkA,
networkB,
leave_out_carriers=[
'geothermal',
'oil',
'other_non_renewable',
'reservoir',
'waste']):
"""
Plot difference in generation between two networks grouped by carrier type
Parameters
----------
networkA : PyPSA ... | python | def plot_gen_diff(
networkA,
networkB,
leave_out_carriers=[
'geothermal',
'oil',
'other_non_renewable',
'reservoir',
'waste']):
"""
Plot difference in generation between two networks grouped by carrier type
Parameters
----------
networkA : PyPSA ... | [
"def",
"plot_gen_diff",
"(",
"networkA",
",",
"networkB",
",",
"leave_out_carriers",
"=",
"[",
"'geothermal'",
",",
"'oil'",
",",
"'other_non_renewable'",
",",
"'reservoir'",
",",
"'waste'",
"]",
")",
":",
"def",
"gen_by_c",
"(",
"network",
")",
":",
"gen",
... | Plot difference in generation between two networks grouped by carrier type
Parameters
----------
networkA : PyPSA network container with switches
networkB : PyPSA network container without switches
leave_out_carriers : list of carriers to leave out (default to all small
carriers)
Returns
... | [
"Plot",
"difference",
"in",
"generation",
"between",
"two",
"networks",
"grouped",
"by",
"carrier",
"type"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L911-L964 |
openego/eTraGo | etrago/tools/plot.py | plot_voltage | def plot_voltage(network, boundaries=[]):
"""
Plot voltage at buses as hexbin
Parameters
----------
network : PyPSA network container
boundaries: list of 2 values, setting the lower and upper bound of colorbar
Returns
-------
Plot
"""
x = np.array(network.buses['x'])
... | python | def plot_voltage(network, boundaries=[]):
"""
Plot voltage at buses as hexbin
Parameters
----------
network : PyPSA network container
boundaries: list of 2 values, setting the lower and upper bound of colorbar
Returns
-------
Plot
"""
x = np.array(network.buses['x'])
... | [
"def",
"plot_voltage",
"(",
"network",
",",
"boundaries",
"=",
"[",
"]",
")",
":",
"x",
"=",
"np",
".",
"array",
"(",
"network",
".",
"buses",
"[",
"'x'",
"]",
")",
"y",
"=",
"np",
".",
"array",
"(",
"network",
".",
"buses",
"[",
"'y'",
"]",
")... | Plot voltage at buses as hexbin
Parameters
----------
network : PyPSA network container
boundaries: list of 2 values, setting the lower and upper bound of colorbar
Returns
-------
Plot | [
"Plot",
"voltage",
"at",
"buses",
"as",
"hexbin"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L967-L1003 |
openego/eTraGo | etrago/tools/plot.py | curtailment | def curtailment(network, carrier='solar', filename=None):
"""
Plot curtailment of selected carrier
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
carrier: str
Plot curtailemt of this carrier
filename:... | python | def curtailment(network, carrier='solar', filename=None):
"""
Plot curtailment of selected carrier
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
carrier: str
Plot curtailemt of this carrier
filename:... | [
"def",
"curtailment",
"(",
"network",
",",
"carrier",
"=",
"'solar'",
",",
"filename",
"=",
"None",
")",
":",
"p_by_carrier",
"=",
"network",
".",
"generators_t",
".",
"p",
".",
"groupby",
"(",
"network",
".",
"generators",
".",
"carrier",
",",
"axis",
"... | Plot curtailment of selected carrier
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
carrier: str
Plot curtailemt of this carrier
filename: str or None
Save figure in this direction
Returns
... | [
"Plot",
"curtailment",
"of",
"selected",
"carrier"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1006-L1058 |
openego/eTraGo | etrago/tools/plot.py | storage_distribution | def storage_distribution(network, scaling=1, filename=None):
"""
Plot storage distribution as circles on grid nodes
Displays storage size and distribution in network.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow ana... | python | def storage_distribution(network, scaling=1, filename=None):
"""
Plot storage distribution as circles on grid nodes
Displays storage size and distribution in network.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow ana... | [
"def",
"storage_distribution",
"(",
"network",
",",
"scaling",
"=",
"1",
",",
"filename",
"=",
"None",
")",
":",
"stores",
"=",
"network",
".",
"storage_units",
"storage_distribution",
"=",
"network",
".",
"storage_units",
".",
"p_nom_opt",
"[",
"stores",
".",... | Plot storage distribution as circles on grid nodes
Displays storage size and distribution in network.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
filename : str
Specify filename
If not given, f... | [
"Plot",
"storage",
"distribution",
"as",
"circles",
"on",
"grid",
"nodes"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1061-L1125 |
openego/eTraGo | etrago/tools/plot.py | storage_expansion | def storage_expansion(network, basemap=True, scaling=1, filename=None):
"""
Plot storage distribution as circles on grid nodes
Displays storage size and distribution in network.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from pow... | python | def storage_expansion(network, basemap=True, scaling=1, filename=None):
"""
Plot storage distribution as circles on grid nodes
Displays storage size and distribution in network.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from pow... | [
"def",
"storage_expansion",
"(",
"network",
",",
"basemap",
"=",
"True",
",",
"scaling",
"=",
"1",
",",
"filename",
"=",
"None",
")",
":",
"stores",
"=",
"network",
".",
"storage_units",
"[",
"network",
".",
"storage_units",
".",
"carrier",
"==",
"'extenda... | Plot storage distribution as circles on grid nodes
Displays storage size and distribution in network.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
filename : str
Specify filename
If not given, fi... | [
"Plot",
"storage",
"distribution",
"as",
"circles",
"on",
"grid",
"nodes",
"Displays",
"storage",
"size",
"and",
"distribution",
"in",
"network",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1129-L1240 |
openego/eTraGo | etrago/tools/plot.py | gen_dist_diff | def gen_dist_diff(
networkA,
networkB,
techs=None,
snapshot=0,
n_cols=3,
gen_size=0.2,
filename=None,
buscmap=plt.cm.jet):
"""
Difference in generation distribution
Green/Yellow/Red colors mean that the generation at a location
is bigger wi... | python | def gen_dist_diff(
networkA,
networkB,
techs=None,
snapshot=0,
n_cols=3,
gen_size=0.2,
filename=None,
buscmap=plt.cm.jet):
"""
Difference in generation distribution
Green/Yellow/Red colors mean that the generation at a location
is bigger wi... | [
"def",
"gen_dist_diff",
"(",
"networkA",
",",
"networkB",
",",
"techs",
"=",
"None",
",",
"snapshot",
"=",
"0",
",",
"n_cols",
"=",
"3",
",",
"gen_size",
"=",
"0.2",
",",
"filename",
"=",
"None",
",",
"buscmap",
"=",
"plt",
".",
"cm",
".",
"jet",
"... | Difference in generation distribution
Green/Yellow/Red colors mean that the generation at a location
is bigger with switches than without
Blue colors mean that the generation at a location is smaller with switches
than without
Parameters
----------
networkA : PyPSA network container
... | [
"Difference",
"in",
"generation",
"distribution",
"Green",
"/",
"Yellow",
"/",
"Red",
"colors",
"mean",
"that",
"the",
"generation",
"at",
"a",
"location",
"is",
"bigger",
"with",
"switches",
"than",
"without",
"Blue",
"colors",
"mean",
"that",
"the",
"generat... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1315-L1402 |
openego/eTraGo | etrago/tools/plot.py | gen_dist | def gen_dist(
network,
techs=None,
snapshot=1,
n_cols=3,
gen_size=0.2,
filename=None):
"""
Generation distribution
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
tec... | python | def gen_dist(
network,
techs=None,
snapshot=1,
n_cols=3,
gen_size=0.2,
filename=None):
"""
Generation distribution
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
tec... | [
"def",
"gen_dist",
"(",
"network",
",",
"techs",
"=",
"None",
",",
"snapshot",
"=",
"1",
",",
"n_cols",
"=",
"3",
",",
"gen_size",
"=",
"0.2",
",",
"filename",
"=",
"None",
")",
":",
"if",
"techs",
"is",
"None",
":",
"techs",
"=",
"network",
".",
... | Generation distribution
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
techs : dict
type of technologies which shall be plotted
snapshot : int
snapshot
n_cols : int
number of columns of the... | [
"Generation",
"distribution"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1405-L1473 |
openego/eTraGo | etrago/tools/plot.py | nodal_gen_dispatch | def nodal_gen_dispatch(
network,
networkB=None,
techs=['wind_onshore', 'solar'],
item='energy',
direction=None,
scaling=1,
filename=None):
"""
Plot nodal dispatch or capacity. If networkB is given, difference in
dispatch is plotted.
Parameters... | python | def nodal_gen_dispatch(
network,
networkB=None,
techs=['wind_onshore', 'solar'],
item='energy',
direction=None,
scaling=1,
filename=None):
"""
Plot nodal dispatch or capacity. If networkB is given, difference in
dispatch is plotted.
Parameters... | [
"def",
"nodal_gen_dispatch",
"(",
"network",
",",
"networkB",
"=",
"None",
",",
"techs",
"=",
"[",
"'wind_onshore'",
",",
"'solar'",
"]",
",",
"item",
"=",
"'energy'",
",",
"direction",
"=",
"None",
",",
"scaling",
"=",
"1",
",",
"filename",
"=",
"None",... | Plot nodal dispatch or capacity. If networkB is given, difference in
dispatch is plotted.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
networkB : PyPSA network container
If given and item is 'energy', di... | [
"Plot",
"nodal",
"dispatch",
"or",
"capacity",
".",
"If",
"networkB",
"is",
"given",
"difference",
"in",
"dispatch",
"is",
"plotted",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including"... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1476-L1594 |
openego/eTraGo | etrago/tools/plot.py | nodal_production_balance | def nodal_production_balance(
network,
snapshot='all',
scaling=0.00001,
filename=None):
"""
Plots the nodal difference between generation and consumption.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results ... | python | def nodal_production_balance(
network,
snapshot='all',
scaling=0.00001,
filename=None):
"""
Plots the nodal difference between generation and consumption.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results ... | [
"def",
"nodal_production_balance",
"(",
"network",
",",
"snapshot",
"=",
"'all'",
",",
"scaling",
"=",
"0.00001",
",",
"filename",
"=",
"None",
")",
":",
"fig",
",",
"ax",
"=",
"plt",
".",
"subplots",
"(",
"1",
",",
"1",
")",
"gen",
"=",
"network",
"... | Plots the nodal difference between generation and consumption.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
snapshot : int or 'all'
Snapshot to plot.
default 'all'
scaling : int
Scaling t... | [
"Plots",
"the",
"nodal",
"difference",
"between",
"generation",
"and",
"consumption",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"powerflow",
"analysis",
"snaps... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1596-L1649 |
openego/eTraGo | etrago/tools/plot.py | storage_p_soc | def storage_p_soc(network, mean='1H', filename = None):
"""
Plots the dispatch and state of charge (SOC) of extendable storages.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
mean : str
Defines over h... | python | def storage_p_soc(network, mean='1H', filename = None):
"""
Plots the dispatch and state of charge (SOC) of extendable storages.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
mean : str
Defines over h... | [
"def",
"storage_p_soc",
"(",
"network",
",",
"mean",
"=",
"'1H'",
",",
"filename",
"=",
"None",
")",
":",
"sbatt",
"=",
"network",
".",
"storage_units",
".",
"index",
"[",
"(",
"network",
".",
"storage_units",
".",
"p_nom_opt",
">",
"1",
")",
"&",
"(",... | Plots the dispatch and state of charge (SOC) of extendable storages.
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
mean : str
Defines over how many snapshots the p and soc values will averaged.
filename :... | [
"Plots",
"the",
"dispatch",
"and",
"state",
"of",
"charge",
"(",
"SOC",
")",
"of",
"extendable",
"storages",
".",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"p... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1651-L1738 |
openego/eTraGo | etrago/tools/plot.py | storage_soc_sorted | def storage_soc_sorted(network, filename = None):
"""
Plots the soc (state-pf-charge) of extendable storages
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
filename : path to folder
"""
sbatt = n... | python | def storage_soc_sorted(network, filename = None):
"""
Plots the soc (state-pf-charge) of extendable storages
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
filename : path to folder
"""
sbatt = n... | [
"def",
"storage_soc_sorted",
"(",
"network",
",",
"filename",
"=",
"None",
")",
":",
"sbatt",
"=",
"network",
".",
"storage_units",
".",
"index",
"[",
"(",
"network",
".",
"storage_units",
".",
"p_nom_opt",
">",
"1",
")",
"&",
"(",
"network",
".",
"stora... | Plots the soc (state-pf-charge) of extendable storages
Parameters
----------
network : PyPSA network container
Holds topology of grid including results from powerflow analysis
filename : path to folder | [
"Plots",
"the",
"soc",
"(",
"state",
"-",
"pf",
"-",
"charge",
")",
"of",
"extendable",
"storages",
"Parameters",
"----------",
"network",
":",
"PyPSA",
"network",
"container",
"Holds",
"topology",
"of",
"grid",
"including",
"results",
"from",
"powerflow",
"an... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/plot.py#L1741-L1804 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/modification_history.py | ModificationHistoryTreeController.register | def register(self):
"""
Change the state machine that is observed for new selected states to the selected state machine.
:return:
"""
# logger.debug("StateMachineEditionChangeHistory register state_machine old/new sm_id %s/%s" %
# (self.__my_selected_sm_id, s... | python | def register(self):
"""
Change the state machine that is observed for new selected states to the selected state machine.
:return:
"""
# logger.debug("StateMachineEditionChangeHistory register state_machine old/new sm_id %s/%s" %
# (self.__my_selected_sm_id, s... | [
"def",
"register",
"(",
"self",
")",
":",
"# logger.debug(\"StateMachineEditionChangeHistory register state_machine old/new sm_id %s/%s\" %",
"# (self.__my_selected_sm_id, self.model.selected_state_machine_id))",
"# relieve old models",
"if",
"self",
".",
"__my_selected_sm_id",
... | Change the state machine that is observed for new selected states to the selected state machine.
:return: | [
"Change",
"the",
"state",
"machine",
"that",
"is",
"observed",
"for",
"new",
"selected",
"states",
"to",
"the",
"selected",
"state",
"machine",
".",
":",
"return",
":"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/modification_history.py#L78-L110 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/modification_history.py | ModificationHistoryTreeController.register_actions | def register_actions(self, shortcut_manager):
"""Register callback methods for triggered actions
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager:
"""
shortcut_manager.add_callback_for_action("undo", self.undo)
shortcut_manager.add_callback_for_action("redo", ... | python | def register_actions(self, shortcut_manager):
"""Register callback methods for triggered actions
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager:
"""
shortcut_manager.add_callback_for_action("undo", self.undo)
shortcut_manager.add_callback_for_action("redo", ... | [
"def",
"register_actions",
"(",
"self",
",",
"shortcut_manager",
")",
":",
"shortcut_manager",
".",
"add_callback_for_action",
"(",
"\"undo\"",
",",
"self",
".",
"undo",
")",
"shortcut_manager",
".",
"add_callback_for_action",
"(",
"\"redo\"",
",",
"self",
".",
"r... | Register callback methods for triggered actions
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: | [
"Register",
"callback",
"methods",
"for",
"triggered",
"actions"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/modification_history.py#L126-L132 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/modification_history.py | ModificationHistoryTreeController.undo | def undo(self, key_value, modifier_mask):
"""Undo for selected state-machine if no state-source-editor is open and focused in states-editor-controller.
:return: True if a undo was performed, False if focus on source-editor.
:rtype: bool
"""
# TODO re-organize as request to contr... | python | def undo(self, key_value, modifier_mask):
"""Undo for selected state-machine if no state-source-editor is open and focused in states-editor-controller.
:return: True if a undo was performed, False if focus on source-editor.
:rtype: bool
"""
# TODO re-organize as request to contr... | [
"def",
"undo",
"(",
"self",
",",
"key_value",
",",
"modifier_mask",
")",
":",
"# TODO re-organize as request to controller which holds source-editor-view or any parent to it",
"for",
"key",
",",
"tab",
"in",
"gui_singletons",
".",
"main_window_controller",
".",
"get_controlle... | Undo for selected state-machine if no state-source-editor is open and focused in states-editor-controller.
:return: True if a undo was performed, False if focus on source-editor.
:rtype: bool | [
"Undo",
"for",
"selected",
"state",
"-",
"machine",
"if",
"no",
"state",
"-",
"source",
"-",
"editor",
"is",
"open",
"and",
"focused",
"in",
"states",
"-",
"editor",
"-",
"controller",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/modification_history.py#L179-L198 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/modification_history.py | ModificationHistoryTreeController.update | def update(self, model, prop_name, info):
""" The method updates the history (a Gtk.TreeStore) which is the model of respective TreeView.
It functionality is strongly depends on a consistent history-tree hold by a ChangeHistory-Class.
"""
# logger.debug("History changed %s\n%s\n%s" % (mo... | python | def update(self, model, prop_name, info):
""" The method updates the history (a Gtk.TreeStore) which is the model of respective TreeView.
It functionality is strongly depends on a consistent history-tree hold by a ChangeHistory-Class.
"""
# logger.debug("History changed %s\n%s\n%s" % (mo... | [
"def",
"update",
"(",
"self",
",",
"model",
",",
"prop_name",
",",
"info",
")",
":",
"# logger.debug(\"History changed %s\\n%s\\n%s\" % (model, prop_name, info))",
"if",
"self",
".",
"parent",
"is",
"not",
"None",
"and",
"hasattr",
"(",
"self",
".",
"parent",
",",... | The method updates the history (a Gtk.TreeStore) which is the model of respective TreeView.
It functionality is strongly depends on a consistent history-tree hold by a ChangeHistory-Class. | [
"The",
"method",
"updates",
"the",
"history",
"(",
"a",
"Gtk",
".",
"TreeStore",
")",
"which",
"is",
"the",
"model",
"of",
"respective",
"TreeView",
".",
"It",
"functionality",
"is",
"strongly",
"depends",
"on",
"a",
"consistent",
"history",
"-",
"tree",
"... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/modification_history.py#L222-L367 |
Cog-Creators/Red-Lavalink | lavalink/rest_api.py | LoadResult.exception_message | def exception_message(self) -> Union[str, None]:
"""
On Lavalink V3, if there was an exception during a load or get tracks call
this property will be populated with the error message.
If there was no error this property will be ``None``.
"""
if self.has_error:
... | python | def exception_message(self) -> Union[str, None]:
"""
On Lavalink V3, if there was an exception during a load or get tracks call
this property will be populated with the error message.
If there was no error this property will be ``None``.
"""
if self.has_error:
... | [
"def",
"exception_message",
"(",
"self",
")",
"->",
"Union",
"[",
"str",
",",
"None",
"]",
":",
"if",
"self",
".",
"has_error",
":",
"exception_data",
"=",
"self",
".",
"_raw",
".",
"get",
"(",
"\"exception\"",
",",
"{",
"}",
")",
"return",
"exception_... | On Lavalink V3, if there was an exception during a load or get tracks call
this property will be populated with the error message.
If there was no error this property will be ``None``. | [
"On",
"Lavalink",
"V3",
"if",
"there",
"was",
"an",
"exception",
"during",
"a",
"load",
"or",
"get",
"tracks",
"call",
"this",
"property",
"will",
"be",
"populated",
"with",
"the",
"error",
"message",
".",
"If",
"there",
"was",
"no",
"error",
"this",
"pr... | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/rest_api.py#L102-L111 |
Cog-Creators/Red-Lavalink | lavalink/rest_api.py | RESTClient.load_tracks | async def load_tracks(self, query) -> LoadResult:
"""
Executes a loadtracks request. Only works on Lavalink V3.
Parameters
----------
query : str
Returns
-------
LoadResult
"""
self.__check_node_ready()
url = self._uri + quote(str... | python | async def load_tracks(self, query) -> LoadResult:
"""
Executes a loadtracks request. Only works on Lavalink V3.
Parameters
----------
query : str
Returns
-------
LoadResult
"""
self.__check_node_ready()
url = self._uri + quote(str... | [
"async",
"def",
"load_tracks",
"(",
"self",
",",
"query",
")",
"->",
"LoadResult",
":",
"self",
".",
"__check_node_ready",
"(",
")",
"url",
"=",
"self",
".",
"_uri",
"+",
"quote",
"(",
"str",
"(",
"query",
")",
")",
"data",
"=",
"await",
"self",
".",... | Executes a loadtracks request. Only works on Lavalink V3.
Parameters
----------
query : str
Returns
-------
LoadResult | [
"Executes",
"a",
"loadtracks",
"request",
".",
"Only",
"works",
"on",
"Lavalink",
"V3",
"."
] | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/rest_api.py#L164-L188 |
Cog-Creators/Red-Lavalink | lavalink/rest_api.py | RESTClient.get_tracks | async def get_tracks(self, query) -> Tuple[Track, ...]:
"""
Gets tracks from lavalink.
Parameters
----------
query : str
Returns
-------
Tuple[Track, ...]
"""
if not self._warned:
log.warn("get_tracks() is now deprecated. Plea... | python | async def get_tracks(self, query) -> Tuple[Track, ...]:
"""
Gets tracks from lavalink.
Parameters
----------
query : str
Returns
-------
Tuple[Track, ...]
"""
if not self._warned:
log.warn("get_tracks() is now deprecated. Plea... | [
"async",
"def",
"get_tracks",
"(",
"self",
",",
"query",
")",
"->",
"Tuple",
"[",
"Track",
",",
"...",
"]",
":",
"if",
"not",
"self",
".",
"_warned",
":",
"log",
".",
"warn",
"(",
"\"get_tracks() is now deprecated. Please switch to using load_tracks().\"",
")",
... | Gets tracks from lavalink.
Parameters
----------
query : str
Returns
-------
Tuple[Track, ...] | [
"Gets",
"tracks",
"from",
"lavalink",
"."
] | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/rest_api.py#L190-L206 |
DLR-RM/RAFCON | source/rafcon/utils/installation.py | get_data_files_tuple | def get_data_files_tuple(*rel_path, **kwargs):
"""Return a tuple which can be used for setup.py's data_files
:param tuple path: List of path elements pointing to a file or a directory of files
:param dict kwargs: Set path_to_file to True is `path` points to a file
:return: tuple of install directory an... | python | def get_data_files_tuple(*rel_path, **kwargs):
"""Return a tuple which can be used for setup.py's data_files
:param tuple path: List of path elements pointing to a file or a directory of files
:param dict kwargs: Set path_to_file to True is `path` points to a file
:return: tuple of install directory an... | [
"def",
"get_data_files_tuple",
"(",
"*",
"rel_path",
",",
"*",
"*",
"kwargs",
")",
":",
"rel_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"*",
"rel_path",
")",
"target_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"\"share\"",
",",
"*",
"rel_p... | Return a tuple which can be used for setup.py's data_files
:param tuple path: List of path elements pointing to a file or a directory of files
:param dict kwargs: Set path_to_file to True is `path` points to a file
:return: tuple of install directory and list of source files
:rtype: tuple(str, [str]) | [
"Return",
"a",
"tuple",
"which",
"can",
"be",
"used",
"for",
"setup",
".",
"py",
"s",
"data_files"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/installation.py#L210-L225 |
DLR-RM/RAFCON | source/rafcon/utils/installation.py | get_data_files_recursively | def get_data_files_recursively(*rel_root_path, **kwargs):
""" Adds all files of the specified path to a data_files compatible list
:param tuple rel_root_path: List of path elements pointing to a directory of files
:return: list of tuples of install directory and list of source files
:rtype: list(tuple(... | python | def get_data_files_recursively(*rel_root_path, **kwargs):
""" Adds all files of the specified path to a data_files compatible list
:param tuple rel_root_path: List of path elements pointing to a directory of files
:return: list of tuples of install directory and list of source files
:rtype: list(tuple(... | [
"def",
"get_data_files_recursively",
"(",
"*",
"rel_root_path",
",",
"*",
"*",
"kwargs",
")",
":",
"result_list",
"=",
"list",
"(",
")",
"rel_root_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"*",
"rel_root_path",
")",
"share_target_root",
"=",
"os",
".... | Adds all files of the specified path to a data_files compatible list
:param tuple rel_root_path: List of path elements pointing to a directory of files
:return: list of tuples of install directory and list of source files
:rtype: list(tuple(str, [str])) | [
"Adds",
"all",
"files",
"of",
"the",
"specified",
"path",
"to",
"a",
"data_files",
"compatible",
"list"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/installation.py#L228-L252 |
DLR-RM/RAFCON | source/rafcon/utils/installation.py | generate_data_files | def generate_data_files():
""" Generate the data_files list used in the setup function
:return: list of tuples of install directory and list of source files
:rtype: list(tuple(str, [str]))
"""
assets_folder = path.join('source', 'rafcon', 'gui', 'assets')
share_folder = path.join(assets_folder,... | python | def generate_data_files():
""" Generate the data_files list used in the setup function
:return: list of tuples of install directory and list of source files
:rtype: list(tuple(str, [str]))
"""
assets_folder = path.join('source', 'rafcon', 'gui', 'assets')
share_folder = path.join(assets_folder,... | [
"def",
"generate_data_files",
"(",
")",
":",
"assets_folder",
"=",
"path",
".",
"join",
"(",
"'source'",
",",
"'rafcon'",
",",
"'gui'",
",",
"'assets'",
")",
"share_folder",
"=",
"path",
".",
"join",
"(",
"assets_folder",
",",
"'share'",
")",
"themes_folder"... | Generate the data_files list used in the setup function
:return: list of tuples of install directory and list of source files
:rtype: list(tuple(str, [str])) | [
"Generate",
"the",
"data_files",
"list",
"used",
"in",
"the",
"setup",
"function"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/installation.py#L255-L299 |
openego/eTraGo | etrago/tools/extendable.py | extendable | def extendable(network, args, line_max):
"""
Function that sets selected components extendable
'network' for all lines, links and transformers
'german_network' for all lines, links and transformers located in Germany
'foreign_network' for all foreign lines, links and transformers
'transformers... | python | def extendable(network, args, line_max):
"""
Function that sets selected components extendable
'network' for all lines, links and transformers
'german_network' for all lines, links and transformers located in Germany
'foreign_network' for all foreign lines, links and transformers
'transformers... | [
"def",
"extendable",
"(",
"network",
",",
"args",
",",
"line_max",
")",
":",
"if",
"'network'",
"in",
"args",
"[",
"'extendable'",
"]",
":",
"network",
".",
"lines",
".",
"s_nom_extendable",
"=",
"True",
"network",
".",
"lines",
".",
"s_nom_min",
"=",
"n... | Function that sets selected components extendable
'network' for all lines, links and transformers
'german_network' for all lines, links and transformers located in Germany
'foreign_network' for all foreign lines, links and transformers
'transformers' for all transformers
'storages' for extendable s... | [
"Function",
"that",
"sets",
"selected",
"components",
"extendable"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/extendable.py#L45-L347 |
openego/eTraGo | etrago/tools/extendable.py | extension_preselection | def extension_preselection(network, args, method, days = 3):
"""
Function that preselects lines which are extendend in snapshots leading to
overloading to reduce nubmer of extension variables.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
... | python | def extension_preselection(network, args, method, days = 3):
"""
Function that preselects lines which are extendend in snapshots leading to
overloading to reduce nubmer of extension variables.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
... | [
"def",
"extension_preselection",
"(",
"network",
",",
"args",
",",
"method",
",",
"days",
"=",
"3",
")",
":",
"weighting",
"=",
"network",
".",
"snapshot_weightings",
"if",
"method",
"==",
"'extreme_situations'",
":",
"snapshots",
"=",
"find_snapshots",
"(",
"... | Function that preselects lines which are extendend in snapshots leading to
overloading to reduce nubmer of extension variables.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args : dict
Arguments set in appl.py
method: str
Choose... | [
"Function",
"that",
"preselects",
"lines",
"which",
"are",
"extendend",
"in",
"snapshots",
"leading",
"to",
"overloading",
"to",
"reduce",
"nubmer",
"of",
"extension",
"variables",
".",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/extendable.py#L350-L452 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | ToolChain.handle | def handle(self, event):
"""
Handle the event by calling each tool until the event is handled
or grabbed.
If a tool is returning True on a button press event, the motion and
button release events are also passed to this
"""
# Allow to handle a subset of events whi... | python | def handle(self, event):
"""
Handle the event by calling each tool until the event is handled
or grabbed.
If a tool is returning True on a button press event, the motion and
button release events are also passed to this
"""
# Allow to handle a subset of events whi... | [
"def",
"handle",
"(",
"self",
",",
"event",
")",
":",
"# Allow to handle a subset of events while having a grabbed tool (between a button press & release event)",
"suppressed_grabbed_tool",
"=",
"None",
"if",
"event",
".",
"type",
"in",
"(",
"Gdk",
".",
"EventType",
".",
... | Handle the event by calling each tool until the event is handled
or grabbed.
If a tool is returning True on a button press event, the motion and
button release events are also passed to this | [
"Handle",
"the",
"event",
"by",
"calling",
"each",
"tool",
"until",
"the",
"event",
"is",
"handled",
"or",
"grabbed",
".",
"If",
"a",
"tool",
"is",
"returning",
"True",
"on",
"a",
"button",
"press",
"event",
"the",
"motion",
"and",
"button",
"release",
"... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L46-L64 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | MoveItemTool.movable_items | def movable_items(self):
"""Filter selection
Filter items of selection that cannot be moved (i.e. are not instances of `Item`) and return the rest.
"""
view = self.view
if self._move_name_v:
yield InMotion(self._item, view)
else:
selected_items =... | python | def movable_items(self):
"""Filter selection
Filter items of selection that cannot be moved (i.e. are not instances of `Item`) and return the rest.
"""
view = self.view
if self._move_name_v:
yield InMotion(self._item, view)
else:
selected_items =... | [
"def",
"movable_items",
"(",
"self",
")",
":",
"view",
"=",
"self",
".",
"view",
"if",
"self",
".",
"_move_name_v",
":",
"yield",
"InMotion",
"(",
"self",
".",
"_item",
",",
"view",
")",
"else",
":",
"selected_items",
"=",
"set",
"(",
"view",
".",
"s... | Filter selection
Filter items of selection that cannot be moved (i.e. are not instances of `Item`) and return the rest. | [
"Filter",
"selection"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L124-L138 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | MoveItemTool.on_button_press | def on_button_press(self, event):
"""Select items
When the mouse button is pressed, the selection is updated.
:param event: The button event
"""
if event.get_button()[1] not in self._buttons:
return False # Only handle events for registered buttons (left mouse clic... | python | def on_button_press(self, event):
"""Select items
When the mouse button is pressed, the selection is updated.
:param event: The button event
"""
if event.get_button()[1] not in self._buttons:
return False # Only handle events for registered buttons (left mouse clic... | [
"def",
"on_button_press",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"get_button",
"(",
")",
"[",
"1",
"]",
"not",
"in",
"self",
".",
"_buttons",
":",
"return",
"False",
"# Only handle events for registered buttons (left mouse clicks)",
"if",
"even... | Select items
When the mouse button is pressed, the selection is updated.
:param event: The button event | [
"Select",
"items"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L140-L176 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | MoveItemTool.on_button_release | def on_button_release(self, event):
"""Write back changes
If one or more items have been moved, the new position are stored in the corresponding meta data and a signal
notifying the change is emitted.
:param event: The button event
"""
affected_models = {}
for ... | python | def on_button_release(self, event):
"""Write back changes
If one or more items have been moved, the new position are stored in the corresponding meta data and a signal
notifying the change is emitted.
:param event: The button event
"""
affected_models = {}
for ... | [
"def",
"on_button_release",
"(",
"self",
",",
"event",
")",
":",
"affected_models",
"=",
"{",
"}",
"for",
"inmotion",
"in",
"self",
".",
"_movable_items",
":",
"inmotion",
".",
"move",
"(",
"(",
"event",
".",
"x",
",",
"event",
".",
"y",
")",
")",
"r... | Write back changes
If one or more items have been moved, the new position are stored in the corresponding meta data and a signal
notifying the change is emitted.
:param event: The button event | [
"Write",
"back",
"changes"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L178-L248 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | HoverItemTool._filter_library_state | def _filter_library_state(self, items):
"""Filters out child elements of library state when they cannot be hovered
Checks if hovered item is within a LibraryState
* if not, the list is returned unfiltered
* if so, STATE_SELECTION_INSIDE_LIBRARY_STATE_ENABLED is checked
* if ... | python | def _filter_library_state(self, items):
"""Filters out child elements of library state when they cannot be hovered
Checks if hovered item is within a LibraryState
* if not, the list is returned unfiltered
* if so, STATE_SELECTION_INSIDE_LIBRARY_STATE_ENABLED is checked
* if ... | [
"def",
"_filter_library_state",
"(",
"self",
",",
"items",
")",
":",
"if",
"not",
"items",
":",
"return",
"items",
"top_most_item",
"=",
"items",
"[",
"0",
"]",
"# If the hovered item is e.g. a connection, we need to get the parental state",
"top_most_state_v",
"=",
"to... | Filters out child elements of library state when they cannot be hovered
Checks if hovered item is within a LibraryState
* if not, the list is returned unfiltered
* if so, STATE_SELECTION_INSIDE_LIBRARY_STATE_ENABLED is checked
* if enabled, the library is selected (instead of the st... | [
"Filters",
"out",
"child",
"elements",
"of",
"library",
"state",
"when",
"they",
"cannot",
"be",
"hovered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L263-L300 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | HoverItemTool._filter_hovered_items | def _filter_hovered_items(self, items, event):
"""Filters out items that cannot be hovered
:param list items: Sorted list of items beneath the cursor
:param Gtk.Event event: Motion event
:return: filtered items
:rtype: list
"""
items = self._filter_library_state(... | python | def _filter_hovered_items(self, items, event):
"""Filters out items that cannot be hovered
:param list items: Sorted list of items beneath the cursor
:param Gtk.Event event: Motion event
:return: filtered items
:rtype: list
"""
items = self._filter_library_state(... | [
"def",
"_filter_hovered_items",
"(",
"self",
",",
"items",
",",
"event",
")",
":",
"items",
"=",
"self",
".",
"_filter_library_state",
"(",
"items",
")",
"if",
"not",
"items",
":",
"return",
"items",
"top_most_item",
"=",
"items",
"[",
"0",
"]",
"second_to... | Filters out items that cannot be hovered
:param list items: Sorted list of items beneath the cursor
:param Gtk.Event event: Motion event
:return: filtered items
:rtype: list | [
"Filters",
"out",
"items",
"that",
"cannot",
"be",
"hovered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L302-L352 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | MultiSelectionTool.on_button_release | def on_button_release(self, event):
"""Select or deselect rubber banded groups of items
The selection of elements is prior and never items are selected or deselected at the same time.
"""
self.queue_draw(self.view)
x0, y0, x1, y1 = self.x0, self.y0, self.x1, self.y1
re... | python | def on_button_release(self, event):
"""Select or deselect rubber banded groups of items
The selection of elements is prior and never items are selected or deselected at the same time.
"""
self.queue_draw(self.view)
x0, y0, x1, y1 = self.x0, self.y0, self.x1, self.y1
re... | [
"def",
"on_button_release",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"queue_draw",
"(",
"self",
".",
"view",
")",
"x0",
",",
"y0",
",",
"x1",
",",
"y1",
"=",
"self",
".",
"x0",
",",
"self",
".",
"y0",
",",
"self",
".",
"x1",
",",
"self... | Select or deselect rubber banded groups of items
The selection of elements is prior and never items are selected or deselected at the same time. | [
"Select",
"or",
"deselect",
"rubber",
"banded",
"groups",
"of",
"items"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L453-L464 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | MoveHandleTool.on_button_press | def on_button_press(self, event):
"""Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around.
"""
if not event.get_button()[1] == 1: # left mouse button
return False
view... | python | def on_button_press(self, event):
"""Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around.
"""
if not event.get_button()[1] == 1: # left mouse button
return False
view... | [
"def",
"on_button_press",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"event",
".",
"get_button",
"(",
")",
"[",
"1",
"]",
"==",
"1",
":",
"# left mouse button",
"return",
"False",
"view",
"=",
"self",
".",
"view",
"if",
"isinstance",
"(",
"view"... | Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around. | [
"Handle",
"button",
"press",
"events",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L475-L511 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | ConnectionTool._set_motion_handle | def _set_motion_handle(self, event):
"""Sets motion handle to currently grabbed handle
"""
item = self.grabbed_item
handle = self.grabbed_handle
pos = event.x, event.y
self.motion_handle = HandleInMotion(item, handle, self.view)
self.motion_handle.GLUE_DISTANCE = ... | python | def _set_motion_handle(self, event):
"""Sets motion handle to currently grabbed handle
"""
item = self.grabbed_item
handle = self.grabbed_handle
pos = event.x, event.y
self.motion_handle = HandleInMotion(item, handle, self.view)
self.motion_handle.GLUE_DISTANCE = ... | [
"def",
"_set_motion_handle",
"(",
"self",
",",
"event",
")",
":",
"item",
"=",
"self",
".",
"grabbed_item",
"handle",
"=",
"self",
".",
"grabbed_handle",
"pos",
"=",
"event",
".",
"x",
",",
"event",
".",
"y",
"self",
".",
"motion_handle",
"=",
"HandleInM... | Sets motion handle to currently grabbed handle | [
"Sets",
"motion",
"handle",
"to",
"currently",
"grabbed",
"handle"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L579-L587 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | ConnectionTool._create_temporary_connection | def _create_temporary_connection(self):
"""Creates a placeholder connection view
:return: New placeholder connection
:rtype: rafcon.gui.mygaphas.items.connection.ConnectionPlaceholderView
"""
if self._is_transition:
self._connection_v = TransitionPlaceholderView(self... | python | def _create_temporary_connection(self):
"""Creates a placeholder connection view
:return: New placeholder connection
:rtype: rafcon.gui.mygaphas.items.connection.ConnectionPlaceholderView
"""
if self._is_transition:
self._connection_v = TransitionPlaceholderView(self... | [
"def",
"_create_temporary_connection",
"(",
"self",
")",
":",
"if",
"self",
".",
"_is_transition",
":",
"self",
".",
"_connection_v",
"=",
"TransitionPlaceholderView",
"(",
"self",
".",
"_parent_state_v",
".",
"hierarchy_level",
")",
"else",
":",
"self",
".",
"_... | Creates a placeholder connection view
:return: New placeholder connection
:rtype: rafcon.gui.mygaphas.items.connection.ConnectionPlaceholderView | [
"Creates",
"a",
"placeholder",
"connection",
"view"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L589-L599 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | ConnectionTool._handle_temporary_connection | def _handle_temporary_connection(self, old_sink, new_sink, of_target=True):
"""Connect connection to new_sink
If new_sink is set, the connection origin or target will be set to new_sink. The connection to old_sink is
being removed.
:param gaphas.aspect.ConnectionSink old_sink: Old sink... | python | def _handle_temporary_connection(self, old_sink, new_sink, of_target=True):
"""Connect connection to new_sink
If new_sink is set, the connection origin or target will be set to new_sink. The connection to old_sink is
being removed.
:param gaphas.aspect.ConnectionSink old_sink: Old sink... | [
"def",
"_handle_temporary_connection",
"(",
"self",
",",
"old_sink",
",",
"new_sink",
",",
"of_target",
"=",
"True",
")",
":",
"def",
"sink_set_and_differs",
"(",
"sink_a",
",",
"sink_b",
")",
":",
"if",
"not",
"sink_a",
":",
"return",
"False",
"if",
"not",
... | Connect connection to new_sink
If new_sink is set, the connection origin or target will be set to new_sink. The connection to old_sink is
being removed.
:param gaphas.aspect.ConnectionSink old_sink: Old sink (if existing)
:param gaphas.aspect.ConnectionSink new_sink: New sink (if exist... | [
"Connect",
"connection",
"to",
"new_sink"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L601-L628 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | ConnectionTool._connect_temporarily | def _connect_temporarily(self, port_v, target=True):
"""Set a connection between the current connection and the given port
:param rafcon.gui.mygaphas.items.ports.PortView port_v: The port to be connected
:param bool target: Whether the connection origin or target should be connected
"""... | python | def _connect_temporarily(self, port_v, target=True):
"""Set a connection between the current connection and the given port
:param rafcon.gui.mygaphas.items.ports.PortView port_v: The port to be connected
:param bool target: Whether the connection origin or target should be connected
"""... | [
"def",
"_connect_temporarily",
"(",
"self",
",",
"port_v",
",",
"target",
"=",
"True",
")",
":",
"if",
"target",
":",
"handle",
"=",
"self",
".",
"_connection_v",
".",
"to_handle",
"(",
")",
"else",
":",
"handle",
"=",
"self",
".",
"_connection_v",
".",
... | Set a connection between the current connection and the given port
:param rafcon.gui.mygaphas.items.ports.PortView port_v: The port to be connected
:param bool target: Whether the connection origin or target should be connected | [
"Set",
"a",
"connection",
"between",
"the",
"current",
"connection",
"and",
"the",
"given",
"port"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L630-L644 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | ConnectionTool._disconnect_temporarily | def _disconnect_temporarily(self, port_v, target=True):
"""Removes a connection between the current connection and the given port
:param rafcon.gui.mygaphas.items.ports.PortView port_v: The port that was connected
:param bool target: Whether the connection origin or target should be disconnecte... | python | def _disconnect_temporarily(self, port_v, target=True):
"""Removes a connection between the current connection and the given port
:param rafcon.gui.mygaphas.items.ports.PortView port_v: The port that was connected
:param bool target: Whether the connection origin or target should be disconnecte... | [
"def",
"_disconnect_temporarily",
"(",
"self",
",",
"port_v",
",",
"target",
"=",
"True",
")",
":",
"if",
"target",
":",
"handle",
"=",
"self",
".",
"_connection_v",
".",
"to_handle",
"(",
")",
"else",
":",
"handle",
"=",
"self",
".",
"_connection_v",
".... | Removes a connection between the current connection and the given port
:param rafcon.gui.mygaphas.items.ports.PortView port_v: The port that was connected
:param bool target: Whether the connection origin or target should be disconnected | [
"Removes",
"a",
"connection",
"between",
"the",
"current",
"connection",
"and",
"the",
"given",
"port"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L646-L660 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | ConnectionCreationTool.on_button_press | def on_button_press(self, event):
"""Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around.
"""
if not event.get_button()[1] == 1: # left mouse button
return False
view... | python | def on_button_press(self, event):
"""Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around.
"""
if not event.get_button()[1] == 1: # left mouse button
return False
view... | [
"def",
"on_button_press",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"event",
".",
"get_button",
"(",
")",
"[",
"1",
"]",
"==",
"1",
":",
"# left mouse button",
"return",
"False",
"view",
"=",
"self",
".",
"view",
"item",
",",
"handle",
"=",
"... | Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around. | [
"Handle",
"button",
"press",
"events",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L670-L702 |
DLR-RM/RAFCON | source/rafcon/gui/mygaphas/tools.py | ConnectionModificationTool.on_button_press | def on_button_press(self, event):
"""Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around.
"""
if not event.get_button()[1] == 1: # left mouse button
return False
view... | python | def on_button_press(self, event):
"""Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around.
"""
if not event.get_button()[1] == 1: # left mouse button
return False
view... | [
"def",
"on_button_press",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"event",
".",
"get_button",
"(",
")",
"[",
"1",
"]",
"==",
"1",
":",
"# left mouse button",
"return",
"False",
"view",
"=",
"self",
".",
"view",
"item",
",",
"handle",
"=",
"... | Handle button press events.
If the (mouse) button is pressed on top of a Handle (item.Handle), that handle is grabbed and can be
dragged around. | [
"Handle",
"button",
"press",
"events",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/tools.py#L750-L777 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/tool_bar.py | ToolBarController.register_view | def register_view(self, view):
"""Called when the View was registered"""
super(ToolBarController, self).register_view(view)
self.view['button_new'].connect('clicked', self.on_button_new_clicked)
self.view['button_open'].connect('clicked', self.on_button_open_clicked)
self.view['b... | python | def register_view(self, view):
"""Called when the View was registered"""
super(ToolBarController, self).register_view(view)
self.view['button_new'].connect('clicked', self.on_button_new_clicked)
self.view['button_open'].connect('clicked', self.on_button_open_clicked)
self.view['b... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"super",
"(",
"ToolBarController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"self",
".",
"view",
"[",
"'button_new'",
"]",
".",
"connect",
"(",
"'clicked'",
",",
"self",
".",
... | Called when the View was registered | [
"Called",
"when",
"the",
"View",
"was",
"registered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/tool_bar.py#L41-L50 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager.initialize | def initialize(self):
"""Initializes the library manager
It searches through all library paths given in the config file for libraries, and loads the states.
This cannot be done in the __init__ function as the library_manager can be compiled and executed by
singleton.py before the state... | python | def initialize(self):
"""Initializes the library manager
It searches through all library paths given in the config file for libraries, and loads the states.
This cannot be done in the __init__ function as the library_manager can be compiled and executed by
singleton.py before the state... | [
"def",
"initialize",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Initializing LibraryManager: Loading libraries ... \"",
")",
"self",
".",
"_libraries",
"=",
"{",
"}",
"self",
".",
"_library_root_paths",
"=",
"{",
"}",
"self",
".",
"_replaced_libraries"... | Initializes the library manager
It searches through all library paths given in the config file for libraries, and loads the states.
This cannot be done in the __init__ function as the library_manager can be compiled and executed by
singleton.py before the state*.pys are loaded | [
"Initializes",
"the",
"library",
"manager"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L75-L125 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager._clean_path | def _clean_path(path):
"""Create a fully fissile absolute system path with no symbolic links and environment variables"""
path = path.replace('"', '')
path = path.replace("'", '')
# Replace ~ with /home/user
path = os.path.expanduser(path)
# Replace environment variables
... | python | def _clean_path(path):
"""Create a fully fissile absolute system path with no symbolic links and environment variables"""
path = path.replace('"', '')
path = path.replace("'", '')
# Replace ~ with /home/user
path = os.path.expanduser(path)
# Replace environment variables
... | [
"def",
"_clean_path",
"(",
"path",
")",
":",
"path",
"=",
"path",
".",
"replace",
"(",
"'\"'",
",",
"''",
")",
"path",
"=",
"path",
".",
"replace",
"(",
"\"'\"",
",",
"''",
")",
"# Replace ~ with /home/user",
"path",
"=",
"os",
".",
"path",
".",
"exp... | Create a fully fissile absolute system path with no symbolic links and environment variables | [
"Create",
"a",
"fully",
"fissile",
"absolute",
"system",
"path",
"with",
"no",
"symbolic",
"links",
"and",
"environment",
"variables"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L128-L143 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager._load_nested_libraries | def _load_nested_libraries(self, library_path, target_dict):
"""Recursively load libraries within path
Adds all libraries specified in a given path and stores them into the provided library dictionary. The library
entries in the dictionary consist only of the path to the library in the file sys... | python | def _load_nested_libraries(self, library_path, target_dict):
"""Recursively load libraries within path
Adds all libraries specified in a given path and stores them into the provided library dictionary. The library
entries in the dictionary consist only of the path to the library in the file sys... | [
"def",
"_load_nested_libraries",
"(",
"self",
",",
"library_path",
",",
"target_dict",
")",
":",
"for",
"library_name",
"in",
"os",
".",
"listdir",
"(",
"library_path",
")",
":",
"library_folder_path",
",",
"library_name",
"=",
"self",
".",
"check_clean_path_of_li... | Recursively load libraries within path
Adds all libraries specified in a given path and stores them into the provided library dictionary. The library
entries in the dictionary consist only of the path to the library in the file system.
:param library_path: the path to add all libraries from
... | [
"Recursively",
"load",
"libraries",
"within",
"path"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L162-L181 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager.get_os_path_to_library | def get_os_path_to_library(self, library_path, library_name, allow_user_interaction=True):
"""Find library_os_path of library
This function retrieves the file system library_os_path of a library specified by a library_path and a
library_name. In case the library does not exist any more at its ... | python | def get_os_path_to_library(self, library_path, library_name, allow_user_interaction=True):
"""Find library_os_path of library
This function retrieves the file system library_os_path of a library specified by a library_path and a
library_name. In case the library does not exist any more at its ... | [
"def",
"get_os_path_to_library",
"(",
"self",
",",
"library_path",
",",
"library_name",
",",
"allow_user_interaction",
"=",
"True",
")",
":",
"original_path_and_name",
"=",
"os",
".",
"path",
".",
"join",
"(",
"library_path",
",",
"library_name",
")",
"library_pat... | Find library_os_path of library
This function retrieves the file system library_os_path of a library specified by a library_path and a
library_name. In case the library does not exist any more at its original location, the user has to specify
an alternative location.
:param str libra... | [
"Find",
"library_os_path",
"of",
"library"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L213-L310 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager._get_library_os_path_from_library_dict_tree | def _get_library_os_path_from_library_dict_tree(self, library_path, library_name):
"""Hand verified library os path from libraries dictionary tree."""
if library_path is None or library_name is None:
return None
path_list = library_path.split(os.sep)
target_lib_dict = self.li... | python | def _get_library_os_path_from_library_dict_tree(self, library_path, library_name):
"""Hand verified library os path from libraries dictionary tree."""
if library_path is None or library_name is None:
return None
path_list = library_path.split(os.sep)
target_lib_dict = self.li... | [
"def",
"_get_library_os_path_from_library_dict_tree",
"(",
"self",
",",
"library_path",
",",
"library_name",
")",
":",
"if",
"library_path",
"is",
"None",
"or",
"library_name",
"is",
"None",
":",
"return",
"None",
"path_list",
"=",
"library_path",
".",
"split",
"(... | Hand verified library os path from libraries dictionary tree. | [
"Hand",
"verified",
"library",
"os",
"path",
"from",
"libraries",
"dictionary",
"tree",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L312-L324 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager._get_library_root_key_for_os_path | def _get_library_root_key_for_os_path(self, path):
"""Return library root key if path is within library root paths"""
path = os.path.realpath(path)
library_root_key = None
for library_root_key, library_root_path in self._library_root_paths.items():
rel_path = os.path.relpath(... | python | def _get_library_root_key_for_os_path(self, path):
"""Return library root key if path is within library root paths"""
path = os.path.realpath(path)
library_root_key = None
for library_root_key, library_root_path in self._library_root_paths.items():
rel_path = os.path.relpath(... | [
"def",
"_get_library_root_key_for_os_path",
"(",
"self",
",",
"path",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"realpath",
"(",
"path",
")",
"library_root_key",
"=",
"None",
"for",
"library_root_key",
",",
"library_root_path",
"in",
"self",
".",
"_librar... | Return library root key if path is within library root paths | [
"Return",
"library",
"root",
"key",
"if",
"path",
"is",
"within",
"library",
"root",
"paths"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L326-L337 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.