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/library_manager.py | LibraryManager.get_library_path_and_name_for_os_path | def get_library_path_and_name_for_os_path(self, path):
"""Generate valid library_path and library_name
The method checks if the given os path is in the list of loaded library root paths and use respective
library root key/mounting point to concatenate the respective library_path and separate r... | python | def get_library_path_and_name_for_os_path(self, path):
"""Generate valid library_path and library_name
The method checks if the given os path is in the list of loaded library root paths and use respective
library root key/mounting point to concatenate the respective library_path and separate r... | [
"def",
"get_library_path_and_name_for_os_path",
"(",
"self",
",",
"path",
")",
":",
"library_path",
"=",
"None",
"library_name",
"=",
"None",
"library_root_key",
"=",
"self",
".",
"_get_library_root_key_for_os_path",
"(",
"path",
")",
"if",
"library_root_key",
"is",
... | Generate valid library_path and library_name
The method checks if the given os path is in the list of loaded library root paths and use respective
library root key/mounting point to concatenate the respective library_path and separate respective library_name.
:param str path: A library os pat... | [
"Generate",
"valid",
"library_path",
"and",
"library_name"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L346-L367 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager.get_library_instance | def get_library_instance(self, library_path, library_name):
"""Generate a Library instance from within libraries dictionary tree."""
if self.is_library_in_libraries(library_path, library_name):
from rafcon.core.states.library_state import LibraryState
return LibraryState(library_... | python | def get_library_instance(self, library_path, library_name):
"""Generate a Library instance from within libraries dictionary tree."""
if self.is_library_in_libraries(library_path, library_name):
from rafcon.core.states.library_state import LibraryState
return LibraryState(library_... | [
"def",
"get_library_instance",
"(",
"self",
",",
"library_path",
",",
"library_name",
")",
":",
"if",
"self",
".",
"is_library_in_libraries",
"(",
"library_path",
",",
"library_name",
")",
":",
"from",
"rafcon",
".",
"core",
".",
"states",
".",
"library_state",
... | Generate a Library instance from within libraries dictionary tree. | [
"Generate",
"a",
"Library",
"instance",
"from",
"within",
"libraries",
"dictionary",
"tree",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L369-L375 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager.get_library_state_copy_instance | def get_library_state_copy_instance(self, lib_os_path):
""" A method to get a state copy of the library specified via the lib_os_path.
:param lib_os_path: the location of the library to get a copy for
:return:
"""
# originally libraries were called like this; DO NOT DELETE; int... | python | def get_library_state_copy_instance(self, lib_os_path):
""" A method to get a state copy of the library specified via the lib_os_path.
:param lib_os_path: the location of the library to get a copy for
:return:
"""
# originally libraries were called like this; DO NOT DELETE; int... | [
"def",
"get_library_state_copy_instance",
"(",
"self",
",",
"lib_os_path",
")",
":",
"# originally libraries were called like this; DO NOT DELETE; interesting for performance tests",
"# state_machine = storage.load_state_machine_from_path(lib_os_path)",
"# return state_machine.version, state_mac... | A method to get a state copy of the library specified via the lib_os_path.
:param lib_os_path: the location of the library to get a copy for
:return: | [
"A",
"method",
"to",
"get",
"a",
"state",
"copy",
"of",
"the",
"library",
"specified",
"via",
"the",
"lib_os_path",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L377-L403 |
DLR-RM/RAFCON | source/rafcon/core/library_manager.py | LibraryManager.remove_library_from_file_system | def remove_library_from_file_system(self, library_path, library_name):
"""Remove library from hard disk."""
library_file_system_path = self.get_os_path_to_library(library_path, library_name)[0]
shutil.rmtree(library_file_system_path)
self.refresh_libraries() | python | def remove_library_from_file_system(self, library_path, library_name):
"""Remove library from hard disk."""
library_file_system_path = self.get_os_path_to_library(library_path, library_name)[0]
shutil.rmtree(library_file_system_path)
self.refresh_libraries() | [
"def",
"remove_library_from_file_system",
"(",
"self",
",",
"library_path",
",",
"library_name",
")",
":",
"library_file_system_path",
"=",
"self",
".",
"get_os_path_to_library",
"(",
"library_path",
",",
"library_name",
")",
"[",
"0",
"]",
"shutil",
".",
"rmtree",
... | Remove library from hard disk. | [
"Remove",
"library",
"from",
"hard",
"disk",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/library_manager.py#L405-L409 |
openego/eTraGo | etrago/tools/utilities.py | buses_of_vlvl | def buses_of_vlvl(network, voltage_level):
""" Get bus-ids of given voltage level(s).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
voltage_level: list
Returns
-------
list
List containing bus-ids.
"""
mask = network.buses.v_n... | python | def buses_of_vlvl(network, voltage_level):
""" Get bus-ids of given voltage level(s).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
voltage_level: list
Returns
-------
list
List containing bus-ids.
"""
mask = network.buses.v_n... | [
"def",
"buses_of_vlvl",
"(",
"network",
",",
"voltage_level",
")",
":",
"mask",
"=",
"network",
".",
"buses",
".",
"v_nom",
".",
"isin",
"(",
"voltage_level",
")",
"df",
"=",
"network",
".",
"buses",
"[",
"mask",
"]",
"return",
"df",
".",
"index"
] | Get bus-ids of given voltage level(s).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
voltage_level: list
Returns
-------
list
List containing bus-ids. | [
"Get",
"bus",
"-",
"ids",
"of",
"given",
"voltage",
"level",
"(",
"s",
")",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L57-L75 |
openego/eTraGo | etrago/tools/utilities.py | buses_grid_linked | def buses_grid_linked(network, voltage_level):
""" Get bus-ids of a given voltage level connected to the grid.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
voltage_level: list
Returns
-------
list
List containing bus-ids.
"""
... | python | def buses_grid_linked(network, voltage_level):
""" Get bus-ids of a given voltage level connected to the grid.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
voltage_level: list
Returns
-------
list
List containing bus-ids.
"""
... | [
"def",
"buses_grid_linked",
"(",
"network",
",",
"voltage_level",
")",
":",
"mask",
"=",
"(",
"(",
"network",
".",
"buses",
".",
"index",
".",
"isin",
"(",
"network",
".",
"lines",
".",
"bus0",
")",
"|",
"(",
"network",
".",
"buses",
".",
"index",
".... | Get bus-ids of a given voltage level connected to the grid.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
voltage_level: list
Returns
-------
list
List containing bus-ids. | [
"Get",
"bus",
"-",
"ids",
"of",
"a",
"given",
"voltage",
"level",
"connected",
"to",
"the",
"grid",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L78-L99 |
openego/eTraGo | etrago/tools/utilities.py | geolocation_buses | def geolocation_buses(network, session):
"""
If geopandas is installed:
Use Geometries of buses x/y(lon/lat) and Polygons
of Countries from RenpassGisParameterRegion
in order to locate the buses
Else:
Use coordinats of buses to locate foreign buses, which is less accurate.
Param... | python | def geolocation_buses(network, session):
"""
If geopandas is installed:
Use Geometries of buses x/y(lon/lat) and Polygons
of Countries from RenpassGisParameterRegion
in order to locate the buses
Else:
Use coordinats of buses to locate foreign buses, which is less accurate.
Param... | [
"def",
"geolocation_buses",
"(",
"network",
",",
"session",
")",
":",
"if",
"geopandas",
":",
"# Start db connetion",
"# get renpassG!S scenario data",
"RenpassGISRegion",
"=",
"RenpassGisParameterRegion",
"# Define regions",
"region_id",
"=",
"[",
"'DE'",
",",
"'DK'",
... | If geopandas is installed:
Use Geometries of buses x/y(lon/lat) and Polygons
of Countries from RenpassGisParameterRegion
in order to locate the buses
Else:
Use coordinats of buses to locate foreign buses, which is less accurate.
Parameters
----------
network_etrago: : class: `e... | [
"If",
"geopandas",
"is",
"installed",
":",
"Use",
"Geometries",
"of",
"buses",
"x",
"/",
"y",
"(",
"lon",
"/",
"lat",
")",
"and",
"Polygons",
"of",
"Countries",
"from",
"RenpassGisParameterRegion",
"in",
"order",
"to",
"locate",
"the",
"buses"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L102-L212 |
openego/eTraGo | etrago/tools/utilities.py | buses_by_country | def buses_by_country(network):
"""
Find buses of foreign countries using coordinates
and return them as Pandas Series
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
foreign_buses: Series containing buses by country
"""
... | python | def buses_by_country(network):
"""
Find buses of foreign countries using coordinates
and return them as Pandas Series
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
foreign_buses: Series containing buses by country
"""
... | [
"def",
"buses_by_country",
"(",
"network",
")",
":",
"poland",
"=",
"pd",
".",
"Series",
"(",
"index",
"=",
"network",
".",
"buses",
"[",
"(",
"network",
".",
"buses",
"[",
"'x'",
"]",
">",
"17",
")",
"]",
".",
"index",
",",
"data",
"=",
"\"PL\"",
... | Find buses of foreign countries using coordinates
and return them as Pandas Series
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
foreign_buses: Series containing buses by country | [
"Find",
"buses",
"of",
"foreign",
"countries",
"using",
"coordinates",
"and",
"return",
"them",
"as",
"Pandas",
"Series"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L215-L308 |
openego/eTraGo | etrago/tools/utilities.py | clip_foreign | def clip_foreign(network):
"""
Delete all components and timelines located outside of Germany.
Add transborder flows divided by country of origin as
network.foreign_trade.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
n... | python | def clip_foreign(network):
"""
Delete all components and timelines located outside of Germany.
Add transborder flows divided by country of origin as
network.foreign_trade.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
n... | [
"def",
"clip_foreign",
"(",
"network",
")",
":",
"# get foreign buses by country",
"foreign_buses",
"=",
"network",
".",
"buses",
"[",
"network",
".",
"buses",
".",
"country_code",
"!=",
"'DE'",
"]",
"network",
".",
"buses",
"=",
"network",
".",
"buses",
".",
... | Delete all components and timelines located outside of Germany.
Add transborder flows divided by country of origin as
network.foreign_trade.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network
... | [
"Delete",
"all",
"components",
"and",
"timelines",
"located",
"outside",
"of",
"Germany",
".",
"Add",
"transborder",
"flows",
"divided",
"by",
"country",
"of",
"origin",
"as",
"network",
".",
"foreign_trade",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L311-L395 |
openego/eTraGo | etrago/tools/utilities.py | foreign_links | def foreign_links(network):
"""Change transmission technology of foreign lines from AC to DC (links).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network
Overall container of PyPSA
"""
... | python | def foreign_links(network):
"""Change transmission technology of foreign lines from AC to DC (links).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network
Overall container of PyPSA
"""
... | [
"def",
"foreign_links",
"(",
"network",
")",
":",
"foreign_buses",
"=",
"network",
".",
"buses",
"[",
"network",
".",
"buses",
".",
"country_code",
"!=",
"'DE'",
"]",
"foreign_lines",
"=",
"network",
".",
"lines",
"[",
"network",
".",
"lines",
".",
"bus0",... | Change transmission technology of foreign lines from AC to DC (links).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network
Overall container of PyPSA | [
"Change",
"transmission",
"technology",
"of",
"foreign",
"lines",
"from",
"AC",
"to",
"DC",
"(",
"links",
")",
".",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",
"Network",
"Overall",
"container",
"of",
"PyPSA"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L398-L443 |
openego/eTraGo | etrago/tools/utilities.py | set_q_foreign_loads | def set_q_foreign_loads(network, cos_phi=1):
"""Set reative power timeseries of loads in neighbouring countries
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
cos_phi: float
Choose ration of active and reactive power of foreign loads
Return... | python | def set_q_foreign_loads(network, cos_phi=1):
"""Set reative power timeseries of loads in neighbouring countries
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
cos_phi: float
Choose ration of active and reactive power of foreign loads
Return... | [
"def",
"set_q_foreign_loads",
"(",
"network",
",",
"cos_phi",
"=",
"1",
")",
":",
"foreign_buses",
"=",
"network",
".",
"buses",
"[",
"network",
".",
"buses",
".",
"country_code",
"!=",
"'DE'",
"]",
"network",
".",
"loads_t",
"[",
"'q_set'",
"]",
"[",
"n... | Set reative power timeseries of loads in neighbouring countries
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
cos_phi: float
Choose ration of active and reactive power of foreign loads
Returns
-------
network : :class:`pypsa.Network
... | [
"Set",
"reative",
"power",
"timeseries",
"of",
"loads",
"in",
"neighbouring",
"countries",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",
"Network",
"Overall",
"container",
"of",
"PyPSA",
"cos_phi",
":",
"float",
"Choose",
"ration",... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L446-L472 |
openego/eTraGo | etrago/tools/utilities.py | connected_grid_lines | def connected_grid_lines(network, busids):
""" Get grid lines connected to given buses.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
busids : list
List containing bus-ids.
Returns
-------
:class:`pandas.DataFrame
PyPSA lines.... | python | def connected_grid_lines(network, busids):
""" Get grid lines connected to given buses.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
busids : list
List containing bus-ids.
Returns
-------
:class:`pandas.DataFrame
PyPSA lines.... | [
"def",
"connected_grid_lines",
"(",
"network",
",",
"busids",
")",
":",
"mask",
"=",
"network",
".",
"lines",
".",
"bus1",
".",
"isin",
"(",
"busids",
")",
"|",
"network",
".",
"lines",
".",
"bus0",
".",
"isin",
"(",
"busids",
")",
"return",
"network",... | Get grid lines connected to given buses.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
busids : list
List containing bus-ids.
Returns
-------
:class:`pandas.DataFrame
PyPSA lines. | [
"Get",
"grid",
"lines",
"connected",
"to",
"given",
"buses",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L475-L494 |
openego/eTraGo | etrago/tools/utilities.py | connected_transformer | def connected_transformer(network, busids):
""" Get transformer connected to given buses.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
busids : list
List containing bus-ids.
Returns
-------
:class:`pandas.DataFrame
PyPSA tran... | python | def connected_transformer(network, busids):
""" Get transformer connected to given buses.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
busids : list
List containing bus-ids.
Returns
-------
:class:`pandas.DataFrame
PyPSA tran... | [
"def",
"connected_transformer",
"(",
"network",
",",
"busids",
")",
":",
"mask",
"=",
"(",
"network",
".",
"transformers",
".",
"bus0",
".",
"isin",
"(",
"busids",
")",
")",
"return",
"network",
".",
"transformers",
"[",
"mask",
"]"
] | Get transformer connected to given buses.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
busids : list
List containing bus-ids.
Returns
-------
:class:`pandas.DataFrame
PyPSA transformer. | [
"Get",
"transformer",
"connected",
"to",
"given",
"buses",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L497-L515 |
openego/eTraGo | etrago/tools/utilities.py | load_shedding | def load_shedding(network, **kwargs):
""" Implement load shedding in existing network to identify
feasibility problems
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
marginal_cost : int
Marginal costs for load shedding
p_nom : int
... | python | def load_shedding(network, **kwargs):
""" Implement load shedding in existing network to identify
feasibility problems
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
marginal_cost : int
Marginal costs for load shedding
p_nom : int
... | [
"def",
"load_shedding",
"(",
"network",
",",
"*",
"*",
"kwargs",
")",
":",
"marginal_cost_def",
"=",
"10000",
"# network.generators.marginal_cost.max()*2",
"p_nom_def",
"=",
"network",
".",
"loads_t",
".",
"p_set",
".",
"max",
"(",
")",
".",
"max",
"(",
")",
... | Implement load shedding in existing network to identify
feasibility problems
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
marginal_cost : int
Marginal costs for load shedding
p_nom : int
Installed capacity of load shedding generato... | [
"Implement",
"load",
"shedding",
"in",
"existing",
"network",
"to",
"identify",
"feasibility",
"problems",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",
"Network",
"Overall",
"container",
"of",
"PyPSA",
"marginal_cost",
":",
"int",
... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L518-L554 |
openego/eTraGo | etrago/tools/utilities.py | data_manipulation_sh | def data_manipulation_sh(network):
""" Adds missing components to run calculations with SH scenarios.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
"""
from shapely.geometry import Point, LineString, MultiLineString
from geoalchemy2.shap... | python | def data_manipulation_sh(network):
""" Adds missing components to run calculations with SH scenarios.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
"""
from shapely.geometry import Point, LineString, MultiLineString
from geoalchemy2.shap... | [
"def",
"data_manipulation_sh",
"(",
"network",
")",
":",
"from",
"shapely",
".",
"geometry",
"import",
"Point",
",",
"LineString",
",",
"MultiLineString",
"from",
"geoalchemy2",
".",
"shape",
"import",
"from_shape",
",",
"to_shape",
"# add connection from Luebeck to S... | Adds missing components to run calculations with SH scenarios.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA | [
"Adds",
"missing",
"components",
"to",
"run",
"calculations",
"with",
"SH",
"scenarios",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L557-L604 |
openego/eTraGo | etrago/tools/utilities.py | results_to_csv | def results_to_csv(network, args, pf_solution=None):
""" Function the writes the calaculation results
in csv-files in the desired directory.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict
Contains calculation settings of appl.py
... | python | def results_to_csv(network, args, pf_solution=None):
""" Function the writes the calaculation results
in csv-files in the desired directory.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict
Contains calculation settings of appl.py
... | [
"def",
"results_to_csv",
"(",
"network",
",",
"args",
",",
"pf_solution",
"=",
"None",
")",
":",
"path",
"=",
"args",
"[",
"'csv_export'",
"]",
"if",
"path",
"==",
"False",
":",
"return",
"None",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"p... | Function the writes the calaculation results
in csv-files in the desired directory.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict
Contains calculation settings of appl.py
pf_solution: pandas.Dataframe or None
If pf was calcu... | [
"Function",
"the",
"writes",
"the",
"calaculation",
"results",
"in",
"csv",
"-",
"files",
"in",
"the",
"desired",
"directory",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L612-L655 |
openego/eTraGo | etrago/tools/utilities.py | parallelisation | def parallelisation(network, args, group_size, extra_functionality=None):
"""
Function that splits problem in selected number of
snapshot groups and runs optimization successive for each group.
Not useful for calculations with storage untis or extension.
Parameters
----------
... | python | def parallelisation(network, args, group_size, extra_functionality=None):
"""
Function that splits problem in selected number of
snapshot groups and runs optimization successive for each group.
Not useful for calculations with storage untis or extension.
Parameters
----------
... | [
"def",
"parallelisation",
"(",
"network",
",",
"args",
",",
"group_size",
",",
"extra_functionality",
"=",
"None",
")",
":",
"print",
"(",
"\"Performing linear OPF, {} snapshot(s) at a time:\"",
".",
"format",
"(",
"group_size",
")",
")",
"t",
"=",
"time",
".",
... | Function that splits problem in selected number of
snapshot groups and runs optimization successive for each group.
Not useful for calculations with storage untis or extension.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict
... | [
"Function",
"that",
"splits",
"problem",
"in",
"selected",
"number",
"of",
"snapshot",
"groups",
"and",
"runs",
"optimization",
"successive",
"for",
"each",
"group",
".",
"Not",
"useful",
"for",
"calculations",
"with",
"storage",
"untis",
"or",
"extension",
"."
... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L658-L697 |
openego/eTraGo | etrago/tools/utilities.py | set_slack | def set_slack(network):
""" Function that chosses the bus with the maximum installed power as slack
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network
Overall container of PyPSA
"""
... | python | def set_slack(network):
""" Function that chosses the bus with the maximum installed power as slack
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network
Overall container of PyPSA
"""
... | [
"def",
"set_slack",
"(",
"network",
")",
":",
"old_slack",
"=",
"network",
".",
"generators",
".",
"index",
"[",
"network",
".",
"generators",
".",
"control",
"==",
"'Slack'",
"]",
"[",
"0",
"]",
"# check if old slack was PV or PQ control:",
"if",
"network",
"... | Function that chosses the bus with the maximum installed power as slack
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network
Overall container of PyPSA | [
"Function",
"that",
"chosses",
"the",
"bus",
"with",
"the",
"maximum",
"installed",
"power",
"as",
"slack"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L699-L754 |
openego/eTraGo | etrago/tools/utilities.py | pf_post_lopf | def pf_post_lopf(network, args, extra_functionality, add_foreign_lopf):
""" Function that prepares and runs non-linar load flow using PyPSA pf.
If network has been extendable, a second lopf with reactances adapted to
new s_nom is needed.
If crossborder lines are DC-links, pf is only applied... | python | def pf_post_lopf(network, args, extra_functionality, add_foreign_lopf):
""" Function that prepares and runs non-linar load flow using PyPSA pf.
If network has been extendable, a second lopf with reactances adapted to
new s_nom is needed.
If crossborder lines are DC-links, pf is only applied... | [
"def",
"pf_post_lopf",
"(",
"network",
",",
"args",
",",
"extra_functionality",
",",
"add_foreign_lopf",
")",
":",
"network_pf",
"=",
"network",
"# Update x of extended lines and transformers",
"if",
"network_pf",
".",
"lines",
".",
"s_nom_extendable",
".",
"any",
"("... | Function that prepares and runs non-linar load flow using PyPSA pf.
If network has been extendable, a second lopf with reactances adapted to
new s_nom is needed.
If crossborder lines are DC-links, pf is only applied on german network.
Crossborder flows are still considerd due to the active ... | [
"Function",
"that",
"prepares",
"and",
"runs",
"non",
"-",
"linar",
"load",
"flow",
"using",
"PyPSA",
"pf",
".",
"If",
"network",
"has",
"been",
"extendable",
"a",
"second",
"lopf",
"with",
"reactances",
"adapted",
"to",
"new",
"s_nom",
"is",
"needed",
"."... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L757-L946 |
openego/eTraGo | etrago/tools/utilities.py | distribute_q | def distribute_q(network, allocation='p_nom'):
""" Function that distributes reactive power at bus to all installed
generators and storages.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
allocation: str
Choose key to distribute reactive p... | python | def distribute_q(network, allocation='p_nom'):
""" Function that distributes reactive power at bus to all installed
generators and storages.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
allocation: str
Choose key to distribute reactive p... | [
"def",
"distribute_q",
"(",
"network",
",",
"allocation",
"=",
"'p_nom'",
")",
":",
"network",
".",
"allocation",
"=",
"allocation",
"if",
"allocation",
"==",
"'p'",
":",
"p_sum",
"=",
"network",
".",
"generators_t",
"[",
"'p'",
"]",
".",
"groupby",
"(",
... | Function that distributes reactive power at bus to all installed
generators and storages.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
allocation: str
Choose key to distribute reactive power:
'p_nom' to dirstribute via p_nom
'p' t... | [
"Function",
"that",
"distributes",
"reactive",
"power",
"at",
"bus",
"to",
"all",
"installed",
"generators",
"and",
"storages",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L949-L1026 |
openego/eTraGo | etrago/tools/utilities.py | calc_line_losses | def calc_line_losses(network):
""" Calculate losses per line with PF result data
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
s0 : series
apparent power of line
i0 : series
current of line
-------
"""
# Line losses
... | python | def calc_line_losses(network):
""" Calculate losses per line with PF result data
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
s0 : series
apparent power of line
i0 : series
current of line
-------
"""
# Line losses
... | [
"def",
"calc_line_losses",
"(",
"network",
")",
":",
"# Line losses",
"# calculate apparent power S = sqrt(p² + q²) [in MW]",
"s0_lines",
"=",
"(",
"(",
"network",
".",
"lines_t",
".",
"p0",
"**",
"2",
"+",
"network",
".",
"lines_t",
".",
"q0",
"**",
"2",
")",
... | Calculate losses per line with PF result data
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
s0 : series
apparent power of line
i0 : series
current of line
------- | [
"Calculate",
"losses",
"per",
"line",
"with",
"PF",
"result",
"data",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",
"Network",
"Overall",
"container",
"of",
"PyPSA",
"s0",
":",
"series",
"apparent",
"power",
"of",
"line",
"i0",... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1029-L1076 |
openego/eTraGo | etrago/tools/utilities.py | set_line_costs | def set_line_costs(network, args,
cost110=230, cost220=290, cost380=85, costDC=375):
""" Set capital costs for extendable lines in respect to PyPSA [€/MVA]
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict containing settings... | python | def set_line_costs(network, args,
cost110=230, cost220=290, cost380=85, costDC=375):
""" Set capital costs for extendable lines in respect to PyPSA [€/MVA]
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict containing settings... | [
"def",
"set_line_costs",
"(",
"network",
",",
"args",
",",
"cost110",
"=",
"230",
",",
"cost220",
"=",
"290",
",",
"cost380",
"=",
"85",
",",
"costDC",
"=",
"375",
")",
":",
"network",
".",
"lines",
"[",
"\"v_nom\"",
"]",
"=",
"network",
".",
"lines"... | Set capital costs for extendable lines in respect to PyPSA [€/MVA]
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict containing settings from appl.py
cost110 : capital costs per km for 110kV lines and cables
default: 230€/MVA/km,... | [
"Set",
"capital",
"costs",
"for",
"extendable",
"lines",
"in",
"respect",
"to",
"PyPSA",
"[",
"€",
"/",
"MVA",
"]",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",
"Network",
"Overall",
"container",
"of",
"PyPSA",
"args",
":",
... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1158-L1199 |
openego/eTraGo | etrago/tools/utilities.py | set_trafo_costs | def set_trafo_costs(network, args, cost110_220=7500, cost110_380=17333,
cost220_380=14166):
""" Set capital costs for extendable transformers in respect
to PyPSA [€/MVA]
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
cost110_220... | python | def set_trafo_costs(network, args, cost110_220=7500, cost110_380=17333,
cost220_380=14166):
""" Set capital costs for extendable transformers in respect
to PyPSA [€/MVA]
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
cost110_220... | [
"def",
"set_trafo_costs",
"(",
"network",
",",
"args",
",",
"cost110_220",
"=",
"7500",
",",
"cost110_380",
"=",
"17333",
",",
"cost220_380",
"=",
"14166",
")",
":",
"network",
".",
"transformers",
"[",
"\"v_nom0\"",
"]",
"=",
"network",
".",
"transformers",... | Set capital costs for extendable transformers in respect
to PyPSA [€/MVA]
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
cost110_220 : capital costs for 110/220kV transformer
default: 7500€/MVA, source: costs for extra trafo in
... | [
"Set",
"capital",
"costs",
"for",
"extendable",
"transformers",
"in",
"respect",
"to",
"PyPSA",
"[",
"€",
"/",
"MVA",
"]",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",
"Network",
"Overall",
"container",
"of",
"PyPSA",
"cost110... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1202-L1235 |
openego/eTraGo | etrago/tools/utilities.py | add_missing_components | def add_missing_components(network):
# Munich
"""Add missing transformer at Heizkraftwerk Nord in Munich and missing
transformer in Stuttgart
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network... | python | def add_missing_components(network):
# Munich
"""Add missing transformer at Heizkraftwerk Nord in Munich and missing
transformer in Stuttgart
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network... | [
"def",
"add_missing_components",
"(",
"network",
")",
":",
"# Munich",
"\"\"\"https://www.swm.de/privatkunden/unternehmen/energieerzeugung/heizkraftwerke.html?utm_medium=301\n\n to bus 25096:\n 25369 (86)\n 28232 (24)\n 25353 to 25356 (79)\n to bus 23822: (110kV bus of 380/110-kV-... | Add missing transformer at Heizkraftwerk Nord in Munich and missing
transformer in Stuttgart
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
network : :class:`pypsa.Network
Overall container of PyPSA | [
"Add",
"missing",
"transformer",
"at",
"Heizkraftwerk",
"Nord",
"in",
"Munich",
"and",
"missing",
"transformer",
"in",
"Stuttgart",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",
"Network",
"Overall",
"container",
"of",
"PyPSA"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1238-L1438 |
openego/eTraGo | etrago/tools/utilities.py | convert_capital_costs | def convert_capital_costs(network, start_snapshot, end_snapshot, p=0.05, T=40):
""" Convert capital_costs to fit to pypsa and caluculated time
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
p : interest rate, default 0.05
T : number of periods, defa... | python | def convert_capital_costs(network, start_snapshot, end_snapshot, p=0.05, T=40):
""" Convert capital_costs to fit to pypsa and caluculated time
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
p : interest rate, default 0.05
T : number of periods, defa... | [
"def",
"convert_capital_costs",
"(",
"network",
",",
"start_snapshot",
",",
"end_snapshot",
",",
"p",
"=",
"0.05",
",",
"T",
"=",
"40",
")",
":",
"# Add costs for DC-converter",
"network",
".",
"links",
".",
"capital_cost",
"=",
"network",
".",
"links",
".",
... | Convert capital_costs to fit to pypsa and caluculated time
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
p : interest rate, default 0.05
T : number of periods, default 40 years (source: StromNEV Anlage 1)
------- | [
"Convert",
"capital_costs",
"to",
"fit",
"to",
"pypsa",
"and",
"caluculated",
"time",
"Parameters",
"----------",
"network",
":",
":",
"class",
":",
"pypsa",
".",
"Network",
"Overall",
"container",
"of",
"PyPSA",
"p",
":",
"interest",
"rate",
"default",
"0",
... | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1441-L1474 |
openego/eTraGo | etrago/tools/utilities.py | find_snapshots | def find_snapshots(network, carrier, maximum = True, minimum = True, n = 3):
"""
Function that returns snapshots with maximum and/or minimum feed-in of
selected carrier.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
carrier: str
Selec... | python | def find_snapshots(network, carrier, maximum = True, minimum = True, n = 3):
"""
Function that returns snapshots with maximum and/or minimum feed-in of
selected carrier.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
carrier: str
Selec... | [
"def",
"find_snapshots",
"(",
"network",
",",
"carrier",
",",
"maximum",
"=",
"True",
",",
"minimum",
"=",
"True",
",",
"n",
"=",
"3",
")",
":",
"if",
"carrier",
"==",
"'residual load'",
":",
"power_plants",
"=",
"network",
".",
"generators",
"[",
"netwo... | Function that returns snapshots with maximum and/or minimum feed-in of
selected carrier.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
carrier: str
Selected carrier of generators
maximum: bool
Choose if timestep of maximal feed-in is r... | [
"Function",
"that",
"returns",
"snapshots",
"with",
"maximum",
"and",
"/",
"or",
"minimum",
"feed",
"-",
"in",
"of",
"selected",
"carrier",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1477-L1532 |
openego/eTraGo | etrago/tools/utilities.py | ramp_limits | def ramp_limits(network):
""" Add ramping constraints to thermal power plants.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
"""
carrier = ['coal', 'biomass', 'gas', 'oil', 'waste', 'lignite',
'urani... | python | def ramp_limits(network):
""" Add ramping constraints to thermal power plants.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
-------
"""
carrier = ['coal', 'biomass', 'gas', 'oil', 'waste', 'lignite',
'urani... | [
"def",
"ramp_limits",
"(",
"network",
")",
":",
"carrier",
"=",
"[",
"'coal'",
",",
"'biomass'",
",",
"'gas'",
",",
"'oil'",
",",
"'waste'",
",",
"'lignite'",
",",
"'uranium'",
",",
"'geothermal'",
"]",
"data",
"=",
"{",
"'start_up_cost'",
":",
"[",
"77"... | Add ramping constraints to thermal power plants.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
Returns
------- | [
"Add",
"ramping",
"constraints",
"to",
"thermal",
"power",
"plants",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1535-L1571 |
openego/eTraGo | etrago/tools/utilities.py | get_args_setting | def get_args_setting(args, jsonpath='scenario_setting.json'):
"""
Get and open json file with scenaio settings of eTraGo ``args``.
The settings incluedes all eTraGo specific settings of arguments and
parameters for a reproducible calculation.
Parameters
----------
json_file : str
D... | python | def get_args_setting(args, jsonpath='scenario_setting.json'):
"""
Get and open json file with scenaio settings of eTraGo ``args``.
The settings incluedes all eTraGo specific settings of arguments and
parameters for a reproducible calculation.
Parameters
----------
json_file : str
D... | [
"def",
"get_args_setting",
"(",
"args",
",",
"jsonpath",
"=",
"'scenario_setting.json'",
")",
":",
"if",
"not",
"jsonpath",
"==",
"None",
":",
"with",
"open",
"(",
"jsonpath",
")",
"as",
"f",
":",
"args",
"=",
"json",
".",
"load",
"(",
"f",
")",
"retur... | Get and open json file with scenaio settings of eTraGo ``args``.
The settings incluedes all eTraGo specific settings of arguments and
parameters for a reproducible calculation.
Parameters
----------
json_file : str
Default: ``scenario_setting.json``
Name of scenario setting json fi... | [
"Get",
"and",
"open",
"json",
"file",
"with",
"scenaio",
"settings",
"of",
"eTraGo",
"args",
".",
"The",
"settings",
"incluedes",
"all",
"eTraGo",
"specific",
"settings",
"of",
"arguments",
"and",
"parameters",
"for",
"a",
"reproducible",
"calculation",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1574-L1597 |
openego/eTraGo | etrago/tools/utilities.py | set_line_country_tags | def set_line_country_tags(network):
"""
Set country tag for AC- and DC-lines.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
"""
transborder_lines_0 = network.lines[network.lines['bus0'].isin(
network.buses.index[network.buses['coun... | python | def set_line_country_tags(network):
"""
Set country tag for AC- and DC-lines.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
"""
transborder_lines_0 = network.lines[network.lines['bus0'].isin(
network.buses.index[network.buses['coun... | [
"def",
"set_line_country_tags",
"(",
"network",
")",
":",
"transborder_lines_0",
"=",
"network",
".",
"lines",
"[",
"network",
".",
"lines",
"[",
"'bus0'",
"]",
".",
"isin",
"(",
"network",
".",
"buses",
".",
"index",
"[",
"network",
".",
"buses",
"[",
"... | Set country tag for AC- and DC-lines.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA | [
"Set",
"country",
"tag",
"for",
"AC",
"-",
"and",
"DC",
"-",
"lines",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1600-L1649 |
openego/eTraGo | etrago/tools/utilities.py | crossborder_capacity | def crossborder_capacity(network, method, capacity_factor):
"""
Adjust interconnector capacties.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
method : string
Method of correction. Options are 'ntc_acer' and 'thermal_acer'.
'ntc_acer' c... | python | def crossborder_capacity(network, method, capacity_factor):
"""
Adjust interconnector capacties.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
method : string
Method of correction. Options are 'ntc_acer' and 'thermal_acer'.
'ntc_acer' c... | [
"def",
"crossborder_capacity",
"(",
"network",
",",
"method",
",",
"capacity_factor",
")",
":",
"if",
"method",
"==",
"'ntc_acer'",
":",
"cap_per_country",
"=",
"{",
"'AT'",
":",
"4900",
",",
"'CH'",
":",
"2695",
",",
"'CZ'",
":",
"1301",
",",
"'DK'",
":... | Adjust interconnector capacties.
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
method : string
Method of correction. Options are 'ntc_acer' and 'thermal_acer'.
'ntc_acer' corrects all capacities according to values published by
the ACE... | [
"Adjust",
"interconnector",
"capacties",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1652-L1755 |
openego/eTraGo | etrago/tools/utilities.py | set_branch_capacity | def set_branch_capacity(network, args):
"""
Set branch capacity factor of lines and transformers, different factors for
HV (110kV) and eHV (220kV, 380kV).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict
Settings in appl.py
""... | python | def set_branch_capacity(network, args):
"""
Set branch capacity factor of lines and transformers, different factors for
HV (110kV) and eHV (220kV, 380kV).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict
Settings in appl.py
""... | [
"def",
"set_branch_capacity",
"(",
"network",
",",
"args",
")",
":",
"network",
".",
"lines",
"[",
"\"s_nom_total\"",
"]",
"=",
"network",
".",
"lines",
".",
"s_nom",
".",
"copy",
"(",
")",
"network",
".",
"transformers",
"[",
"\"s_nom_total\"",
"]",
"=",
... | Set branch capacity factor of lines and transformers, different factors for
HV (110kV) and eHV (220kV, 380kV).
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
args: dict
Settings in appl.py | [
"Set",
"branch",
"capacity",
"factor",
"of",
"lines",
"and",
"transformers",
"different",
"factors",
"for",
"HV",
"(",
"110kV",
")",
"and",
"eHV",
"(",
"220kV",
"380kV",
")",
"."
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1758-L1792 |
openego/eTraGo | etrago/tools/utilities.py | max_line_ext | def max_line_ext(network, snapshots, share=1.01):
"""
Sets maximal share of overall network extension
as extra functionality in LOPF
Parameters
----------
share: float
Maximal share of network extension in p.u.
"""
lines_snom = network.lines.s_nom.sum()
links_pnom = networ... | python | def max_line_ext(network, snapshots, share=1.01):
"""
Sets maximal share of overall network extension
as extra functionality in LOPF
Parameters
----------
share: float
Maximal share of network extension in p.u.
"""
lines_snom = network.lines.s_nom.sum()
links_pnom = networ... | [
"def",
"max_line_ext",
"(",
"network",
",",
"snapshots",
",",
"share",
"=",
"1.01",
")",
":",
"lines_snom",
"=",
"network",
".",
"lines",
".",
"s_nom",
".",
"sum",
"(",
")",
"links_pnom",
"=",
"network",
".",
"links",
".",
"p_nom",
".",
"sum",
"(",
"... | Sets maximal share of overall network extension
as extra functionality in LOPF
Parameters
----------
share: float
Maximal share of network extension in p.u. | [
"Sets",
"maximal",
"share",
"of",
"overall",
"network",
"extension",
"as",
"extra",
"functionality",
"in",
"LOPF"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1794-L1820 |
openego/eTraGo | etrago/tools/utilities.py | min_renewable_share | def min_renewable_share(network, snapshots, share=0.72):
"""
Sets minimal renewable share of generation as extra functionality in LOPF
Parameters
----------
share: float
Minimal share of renewable generation in p.u.
"""
renewables = ['wind_onshore', 'wind_offshore',
... | python | def min_renewable_share(network, snapshots, share=0.72):
"""
Sets minimal renewable share of generation as extra functionality in LOPF
Parameters
----------
share: float
Minimal share of renewable generation in p.u.
"""
renewables = ['wind_onshore', 'wind_offshore',
... | [
"def",
"min_renewable_share",
"(",
"network",
",",
"snapshots",
",",
"share",
"=",
"0.72",
")",
":",
"renewables",
"=",
"[",
"'wind_onshore'",
",",
"'wind_offshore'",
",",
"'biomass'",
",",
"'solar'",
",",
"'run_of_river'",
"]",
"res",
"=",
"list",
"(",
"net... | Sets minimal renewable share of generation as extra functionality in LOPF
Parameters
----------
share: float
Minimal share of renewable generation in p.u. | [
"Sets",
"minimal",
"renewable",
"share",
"of",
"generation",
"as",
"extra",
"functionality",
"in",
"LOPF"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1822-L1852 |
openego/eTraGo | etrago/tools/utilities.py | max_curtailment | def max_curtailment(network, snapshots, curtail_max=0.03):
"""
each RE can only be curtailed (over all snapshots)
with respect to curtail_max
Parameters
----------
curtail_max: float
maximal curtailment per power plant in p.u.
"""
renewables = ['wind_onshore', 'wind_offsho... | python | def max_curtailment(network, snapshots, curtail_max=0.03):
"""
each RE can only be curtailed (over all snapshots)
with respect to curtail_max
Parameters
----------
curtail_max: float
maximal curtailment per power plant in p.u.
"""
renewables = ['wind_onshore', 'wind_offsho... | [
"def",
"max_curtailment",
"(",
"network",
",",
"snapshots",
",",
"curtail_max",
"=",
"0.03",
")",
":",
"renewables",
"=",
"[",
"'wind_onshore'",
",",
"'wind_offshore'",
",",
"'solar'",
"]",
"res",
"=",
"list",
"(",
"network",
".",
"generators",
".",
"index",... | each RE can only be curtailed (over all snapshots)
with respect to curtail_max
Parameters
----------
curtail_max: float
maximal curtailment per power plant in p.u. | [
"each",
"RE",
"can",
"only",
"be",
"curtailed",
"(",
"over",
"all",
"snapshots",
")",
"with",
"respect",
"to",
"curtail_max"
] | train | https://github.com/openego/eTraGo/blob/2a8fc6d4368d0e9abe6fe0d0c39baf66ea0126b9/etrago/tools/utilities.py#L1855-L1894 |
Cog-Creators/Red-Lavalink | lavalink/node.py | get_node | def get_node(guild_id: int, ignore_ready_status: bool = False) -> Node:
"""
Gets a node based on a guild ID, useful for noding separation. If the
guild ID does not already have a node association, the least used
node is returned. Skips over nodes that are not yet ready.
Parameters
----------
... | python | def get_node(guild_id: int, ignore_ready_status: bool = False) -> Node:
"""
Gets a node based on a guild ID, useful for noding separation. If the
guild ID does not already have a node association, the least used
node is returned. Skips over nodes that are not yet ready.
Parameters
----------
... | [
"def",
"get_node",
"(",
"guild_id",
":",
"int",
",",
"ignore_ready_status",
":",
"bool",
"=",
"False",
")",
"->",
"Node",
":",
"guild_count",
"=",
"1e10",
"least_used",
"=",
"None",
"for",
"node",
"in",
"_nodes",
":",
"guild_ids",
"=",
"node",
".",
"play... | Gets a node based on a guild ID, useful for noding separation. If the
guild ID does not already have a node association, the least used
node is returned. Skips over nodes that are not yet ready.
Parameters
----------
guild_id : int
ignore_ready_status : bool
Returns
-------
Node | [
"Gets",
"a",
"node",
"based",
"on",
"a",
"guild",
"ID",
"useful",
"for",
"noding",
"separation",
".",
"If",
"the",
"guild",
"ID",
"does",
"not",
"already",
"have",
"a",
"node",
"association",
"the",
"least",
"used",
"node",
"is",
"returned",
".",
"Skips"... | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/node.py#L335-L368 |
Cog-Creators/Red-Lavalink | lavalink/node.py | join_voice | async def join_voice(guild_id: int, channel_id: int):
"""
Joins a voice channel by ID's.
Parameters
----------
guild_id : int
channel_id : int
"""
node = get_node(guild_id)
voice_ws = node.get_voice_ws(guild_id)
await voice_ws.voice_state(guild_id, channel_id) | python | async def join_voice(guild_id: int, channel_id: int):
"""
Joins a voice channel by ID's.
Parameters
----------
guild_id : int
channel_id : int
"""
node = get_node(guild_id)
voice_ws = node.get_voice_ws(guild_id)
await voice_ws.voice_state(guild_id, channel_id) | [
"async",
"def",
"join_voice",
"(",
"guild_id",
":",
"int",
",",
"channel_id",
":",
"int",
")",
":",
"node",
"=",
"get_node",
"(",
"guild_id",
")",
"voice_ws",
"=",
"node",
".",
"get_voice_ws",
"(",
"guild_id",
")",
"await",
"voice_ws",
".",
"voice_state",
... | Joins a voice channel by ID's.
Parameters
----------
guild_id : int
channel_id : int | [
"Joins",
"a",
"voice",
"channel",
"by",
"ID",
"s",
"."
] | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/node.py#L371-L382 |
Cog-Creators/Red-Lavalink | lavalink/node.py | Node.connect | async def connect(self, timeout=None):
"""
Connects to the Lavalink player event websocket.
Parameters
----------
timeout : int
Time after which to timeout on attempting to connect to the Lavalink websocket,
``None`` is considered never, but the underlyin... | python | async def connect(self, timeout=None):
"""
Connects to the Lavalink player event websocket.
Parameters
----------
timeout : int
Time after which to timeout on attempting to connect to the Lavalink websocket,
``None`` is considered never, but the underlyin... | [
"async",
"def",
"connect",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"self",
".",
"_is_shutdown",
"=",
"False",
"combo_uri",
"=",
"\"ws://{}:{}\"",
".",
"format",
"(",
"self",
".",
"host",
",",
"self",
".",
"rest",
")",
"uri",
"=",
"\"ws://{}... | Connects to the Lavalink player event websocket.
Parameters
----------
timeout : int
Time after which to timeout on attempting to connect to the Lavalink websocket,
``None`` is considered never, but the underlying code may stop trying past a
certain point.
... | [
"Connects",
"to",
"the",
"Lavalink",
"player",
"event",
"websocket",
"."
] | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/node.py#L92-L133 |
Cog-Creators/Red-Lavalink | lavalink/node.py | Node.listener | async def listener(self):
"""
Listener task for receiving ops from Lavalink.
"""
while self._ws.open and self._is_shutdown is False:
try:
data = json.loads(await self._ws.recv())
except websockets.ConnectionClosed:
break
... | python | async def listener(self):
"""
Listener task for receiving ops from Lavalink.
"""
while self._ws.open and self._is_shutdown is False:
try:
data = json.loads(await self._ws.recv())
except websockets.ConnectionClosed:
break
... | [
"async",
"def",
"listener",
"(",
"self",
")",
":",
"while",
"self",
".",
"_ws",
".",
"open",
"and",
"self",
".",
"_is_shutdown",
"is",
"False",
":",
"try",
":",
"data",
"=",
"json",
".",
"loads",
"(",
"await",
"self",
".",
"_ws",
".",
"recv",
"(",
... | Listener task for receiving ops from Lavalink. | [
"Listener",
"task",
"for",
"receiving",
"ops",
"from",
"Lavalink",
"."
] | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/node.py#L164-L185 |
Cog-Creators/Red-Lavalink | lavalink/node.py | Node.join_voice_channel | async def join_voice_channel(self, guild_id, channel_id):
"""
Alternative way to join a voice channel if node is known.
"""
voice_ws = self.get_voice_ws(guild_id)
await voice_ws.voice_state(guild_id, channel_id) | python | async def join_voice_channel(self, guild_id, channel_id):
"""
Alternative way to join a voice channel if node is known.
"""
voice_ws = self.get_voice_ws(guild_id)
await voice_ws.voice_state(guild_id, channel_id) | [
"async",
"def",
"join_voice_channel",
"(",
"self",
",",
"guild_id",
",",
"channel_id",
")",
":",
"voice_ws",
"=",
"self",
".",
"get_voice_ws",
"(",
"guild_id",
")",
"await",
"voice_ws",
".",
"voice_state",
"(",
"guild_id",
",",
"channel_id",
")"
] | Alternative way to join a voice channel if node is known. | [
"Alternative",
"way",
"to",
"join",
"a",
"voice",
"channel",
"if",
"node",
"is",
"known",
"."
] | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/node.py#L249-L254 |
Cog-Creators/Red-Lavalink | lavalink/node.py | Node.disconnect | async def disconnect(self):
"""
Shuts down and disconnects the websocket.
"""
self._is_shutdown = True
self.ready.clear()
self.update_state(NodeState.DISCONNECTING)
await self.player_manager.disconnect()
if self._ws is not None and self._ws.open:
... | python | async def disconnect(self):
"""
Shuts down and disconnects the websocket.
"""
self._is_shutdown = True
self.ready.clear()
self.update_state(NodeState.DISCONNECTING)
await self.player_manager.disconnect()
if self._ws is not None and self._ws.open:
... | [
"async",
"def",
"disconnect",
"(",
"self",
")",
":",
"self",
".",
"_is_shutdown",
"=",
"True",
"self",
".",
"ready",
".",
"clear",
"(",
")",
"self",
".",
"update_state",
"(",
"NodeState",
".",
"DISCONNECTING",
")",
"await",
"self",
".",
"player_manager",
... | Shuts down and disconnects the websocket. | [
"Shuts",
"down",
"and",
"disconnects",
"the",
"websocket",
"."
] | train | https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/node.py#L256-L276 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/overview.py | StateOverviewController.register_view | def register_view(self, view):
"""Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
:param rafcon.gui.views.state_editor.overview.StateOverviewView view: A state overview view instance
"""
# p... | python | def register_view(self, view):
"""Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
:param rafcon.gui.views.state_editor.overview.StateOverviewView view: A state overview view instance
"""
# p... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"# prepare State Type Change ComboBox",
"super",
"(",
"StateOverviewController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"self",
".",
"allowed_state_classes",
"=",
"self",
".",
"get_allo... | Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
:param rafcon.gui.views.state_editor.overview.StateOverviewView view: A state overview view instance | [
"Called",
"when",
"the",
"View",
"was",
"registered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/overview.py#L73-L145 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | BarrierConcurrencyState.run | def run(self):
""" This defines the sequence of actions that are taken when the barrier concurrency state is executed
:return:
"""
logger.debug("Starting execution of {0}{1}".format(self, " (backwards)" if self.backward_execution else ""))
self.setup_run()
# data to be ... | python | def run(self):
""" This defines the sequence of actions that are taken when the barrier concurrency state is executed
:return:
"""
logger.debug("Starting execution of {0}{1}".format(self, " (backwards)" if self.backward_execution else ""))
self.setup_run()
# data to be ... | [
"def",
"run",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Starting execution of {0}{1}\"",
".",
"format",
"(",
"self",
",",
"\" (backwards)\"",
"if",
"self",
".",
"backward_execution",
"else",
"\"\"",
")",
")",
"self",
".",
"setup_run",
"(",
")",
... | This defines the sequence of actions that are taken when the barrier concurrency state is executed
:return: | [
"This",
"defines",
"the",
"sequence",
"of",
"actions",
"that",
"are",
"taken",
"when",
"the",
"barrier",
"concurrency",
"state",
"is",
"executed"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L100-L181 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | BarrierConcurrencyState.run_decider_state | def run_decider_state(self, decider_state, child_errors, final_outcomes_dict):
""" Runs the decider state of the barrier concurrency state. The decider state decides on which outcome the
barrier concurrency is left.
:param decider_state: the decider state of the barrier concurrency state
... | python | def run_decider_state(self, decider_state, child_errors, final_outcomes_dict):
""" Runs the decider state of the barrier concurrency state. The decider state decides on which outcome the
barrier concurrency is left.
:param decider_state: the decider state of the barrier concurrency state
... | [
"def",
"run_decider_state",
"(",
"self",
",",
"decider_state",
",",
"child_errors",
",",
"final_outcomes_dict",
")",
":",
"decider_state",
".",
"state_execution_status",
"=",
"StateExecutionStatus",
".",
"ACTIVE",
"# forward the decider specific data",
"decider_state",
".",... | Runs the decider state of the barrier concurrency state. The decider state decides on which outcome the
barrier concurrency is left.
:param decider_state: the decider state of the barrier concurrency state
:param child_errors: error of the concurrent branches
:param final_outcomes_dict:... | [
"Runs",
"the",
"decider",
"state",
"of",
"the",
"barrier",
"concurrency",
"state",
".",
"The",
"decider",
"state",
"decides",
"on",
"which",
"outcome",
"the",
"barrier",
"concurrency",
"is",
"left",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L183-L208 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | BarrierConcurrencyState._check_transition_validity | def _check_transition_validity(self, check_transition):
""" Transition of BarrierConcurrencyStates must least fulfill the condition of a ContainerState.
Start transitions are forbidden in the ConcurrencyState.
:param check_transition: the transition to check for validity
:return:
... | python | def _check_transition_validity(self, check_transition):
""" Transition of BarrierConcurrencyStates must least fulfill the condition of a ContainerState.
Start transitions are forbidden in the ConcurrencyState.
:param check_transition: the transition to check for validity
:return:
... | [
"def",
"_check_transition_validity",
"(",
"self",
",",
"check_transition",
")",
":",
"valid",
",",
"message",
"=",
"super",
"(",
"BarrierConcurrencyState",
",",
"self",
")",
".",
"_check_transition_validity",
"(",
"check_transition",
")",
"if",
"not",
"valid",
":"... | Transition of BarrierConcurrencyStates must least fulfill the condition of a ContainerState.
Start transitions are forbidden in the ConcurrencyState.
:param check_transition: the transition to check for validity
:return: | [
"Transition",
"of",
"BarrierConcurrencyStates",
"must",
"least",
"fulfill",
"the",
"condition",
"of",
"a",
"ContainerState",
".",
"Start",
"transitions",
"are",
"forbidden",
"in",
"the",
"ConcurrencyState",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L210-L241 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | BarrierConcurrencyState.add_state | def add_state(self, state, storage_load=False):
"""Overwrite the parent class add_state method
Add automatic transition generation for the decider_state.
:param state: The state to be added
:return:
"""
state_id = super(BarrierConcurrencyState, self).add_state(state)
... | python | def add_state(self, state, storage_load=False):
"""Overwrite the parent class add_state method
Add automatic transition generation for the decider_state.
:param state: The state to be added
:return:
"""
state_id = super(BarrierConcurrencyState, self).add_state(state)
... | [
"def",
"add_state",
"(",
"self",
",",
"state",
",",
"storage_load",
"=",
"False",
")",
":",
"state_id",
"=",
"super",
"(",
"BarrierConcurrencyState",
",",
"self",
")",
".",
"add_state",
"(",
"state",
")",
"if",
"not",
"storage_load",
"and",
"not",
"self",
... | Overwrite the parent class add_state method
Add automatic transition generation for the decider_state.
:param state: The state to be added
:return: | [
"Overwrite",
"the",
"parent",
"class",
"add_state",
"method"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L244-L258 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | BarrierConcurrencyState.states | def states(self, states):
""" Overwrite the setter of the container state base class as special handling for the decider state is needed.
:param states: the dictionary of new states
:raises exceptions.TypeError: if the states parameter is not of type dict
"""
# First safely remo... | python | def states(self, states):
""" Overwrite the setter of the container state base class as special handling for the decider state is needed.
:param states: the dictionary of new states
:raises exceptions.TypeError: if the states parameter is not of type dict
"""
# First safely remo... | [
"def",
"states",
"(",
"self",
",",
"states",
")",
":",
"# First safely remove all existing states (recursively!), as they will be replaced",
"state_ids",
"=",
"list",
"(",
"self",
".",
"states",
".",
"keys",
"(",
")",
")",
"for",
"state_id",
"in",
"state_ids",
":",
... | Overwrite the setter of the container state base class as special handling for the decider state is needed.
:param states: the dictionary of new states
:raises exceptions.TypeError: if the states parameter is not of type dict | [
"Overwrite",
"the",
"setter",
"of",
"the",
"container",
"state",
"base",
"class",
"as",
"special",
"handling",
"for",
"the",
"decider",
"state",
"is",
"needed",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L263-L285 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | BarrierConcurrencyState.remove_state | def remove_state(self, state_id, recursive=True, force=False, destroy=True):
""" Overwrite the parent class remove state method by checking if the user tries to delete the decider state
:param state_id: the id of the state to remove
:param recursive: a flag to indicate a recursive disassembling... | python | def remove_state(self, state_id, recursive=True, force=False, destroy=True):
""" Overwrite the parent class remove state method by checking if the user tries to delete the decider state
:param state_id: the id of the state to remove
:param recursive: a flag to indicate a recursive disassembling... | [
"def",
"remove_state",
"(",
"self",
",",
"state_id",
",",
"recursive",
"=",
"True",
",",
"force",
"=",
"False",
",",
"destroy",
"=",
"True",
")",
":",
"if",
"state_id",
"==",
"UNIQUE_DECIDER_STATE_ID",
"and",
"force",
"is",
"False",
":",
"raise",
"Attribut... | Overwrite the parent class remove state method by checking if the user tries to delete the decider state
:param state_id: the id of the state to remove
:param recursive: a flag to indicate a recursive disassembling of all substates
:param force: a flag to indicate forcefully deletion of all sta... | [
"Overwrite",
"the",
"parent",
"class",
"remove",
"state",
"method",
"by",
"checking",
"if",
"the",
"user",
"tries",
"to",
"delete",
"the",
"decider",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L287-L301 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | DeciderState.get_outcome_for_state_name | def get_outcome_for_state_name(self, name):
""" Returns the final outcome of the child state specified by name.
Note: This is utility function that is used by the programmer to make a decision based on the final outcome
of its child states. A state is not uniquely specified by the name, but as ... | python | def get_outcome_for_state_name(self, name):
""" Returns the final outcome of the child state specified by name.
Note: This is utility function that is used by the programmer to make a decision based on the final outcome
of its child states. A state is not uniquely specified by the name, but as ... | [
"def",
"get_outcome_for_state_name",
"(",
"self",
",",
"name",
")",
":",
"return_value",
"=",
"None",
"for",
"state_id",
",",
"name_outcome_tuple",
"in",
"self",
".",
"final_outcomes_dict",
".",
"items",
"(",
")",
":",
"if",
"name_outcome_tuple",
"[",
"0",
"]"... | Returns the final outcome of the child state specified by name.
Note: This is utility function that is used by the programmer to make a decision based on the final outcome
of its child states. A state is not uniquely specified by the name, but as the programmer normally does not want
to use sta... | [
"Returns",
"the",
"final",
"outcome",
"of",
"the",
"child",
"state",
"specified",
"by",
"name",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L352-L367 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | DeciderState.get_outcome_for_state_id | def get_outcome_for_state_id(self, state_id):
""" Returns the final outcome of the child state specified by the state_id.
:param state_id: The id of the state to get the final outcome for.
:return:
"""
return_value = None
for s_id, name_outcome_tuple in self.final_outcom... | python | def get_outcome_for_state_id(self, state_id):
""" Returns the final outcome of the child state specified by the state_id.
:param state_id: The id of the state to get the final outcome for.
:return:
"""
return_value = None
for s_id, name_outcome_tuple in self.final_outcom... | [
"def",
"get_outcome_for_state_id",
"(",
"self",
",",
"state_id",
")",
":",
"return_value",
"=",
"None",
"for",
"s_id",
",",
"name_outcome_tuple",
"in",
"self",
".",
"final_outcomes_dict",
".",
"items",
"(",
")",
":",
"if",
"s_id",
"==",
"state_id",
":",
"ret... | Returns the final outcome of the child state specified by the state_id.
:param state_id: The id of the state to get the final outcome for.
:return: | [
"Returns",
"the",
"final",
"outcome",
"of",
"the",
"child",
"state",
"specified",
"by",
"the",
"state_id",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L369-L380 |
DLR-RM/RAFCON | source/rafcon/core/states/barrier_concurrency_state.py | DeciderState.get_errors_for_state_name | def get_errors_for_state_name(self, name):
""" Returns the error message of the child state specified by name.
Note: This is utility function that is used by the programmer to make a decision based on the final outcome
of its child states. A state is not uniquely specified by the name, but as t... | python | def get_errors_for_state_name(self, name):
""" Returns the error message of the child state specified by name.
Note: This is utility function that is used by the programmer to make a decision based on the final outcome
of its child states. A state is not uniquely specified by the name, but as t... | [
"def",
"get_errors_for_state_name",
"(",
"self",
",",
"name",
")",
":",
"return_value",
"=",
"None",
"for",
"state_id",
",",
"name_outcome_tuple",
"in",
"self",
".",
"child_errors",
".",
"items",
"(",
")",
":",
"if",
"name_outcome_tuple",
"[",
"0",
"]",
"=="... | Returns the error message of the child state specified by name.
Note: This is utility function that is used by the programmer to make a decision based on the final outcome
of its child states. A state is not uniquely specified by the name, but as the programmer normally does not want
to use sta... | [
"Returns",
"the",
"error",
"message",
"of",
"the",
"child",
"state",
"specified",
"by",
"name",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/states/barrier_concurrency_state.py#L382-L397 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/utils/extended_controller.py | ExtendedController.add_controller | def add_controller(self, key, controller):
"""Add child controller
The passed controller is registered as child of self. The register_actions method of the child controller is
called, allowing the child controller to register shortcut callbacks.
:param key: Name of the controller (uniq... | python | def add_controller(self, key, controller):
"""Add child controller
The passed controller is registered as child of self. The register_actions method of the child controller is
called, allowing the child controller to register shortcut callbacks.
:param key: Name of the controller (uniq... | [
"def",
"add_controller",
"(",
"self",
",",
"key",
",",
"controller",
")",
":",
"assert",
"isinstance",
"(",
"controller",
",",
"ExtendedController",
")",
"controller",
".",
"parent",
"=",
"self",
"self",
".",
"__child_controllers",
"[",
"key",
"]",
"=",
"con... | Add child controller
The passed controller is registered as child of self. The register_actions method of the child controller is
called, allowing the child controller to register shortcut callbacks.
:param key: Name of the controller (unique within self), to later access it again
:par... | [
"Add",
"child",
"controller"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/extended_controller.py#L51-L65 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/utils/extended_controller.py | ExtendedController.remove_controller | def remove_controller(self, controller):
"""Remove child controller and destroy it
Removes all references to the child controller and calls destroy() on the controller.
:param str | ExtendedController controller: Either the child controller object itself or its registered name
:return:... | python | def remove_controller(self, controller):
"""Remove child controller and destroy it
Removes all references to the child controller and calls destroy() on the controller.
:param str | ExtendedController controller: Either the child controller object itself or its registered name
:return:... | [
"def",
"remove_controller",
"(",
"self",
",",
"controller",
")",
":",
"# Get name of controller",
"if",
"isinstance",
"(",
"controller",
",",
"ExtendedController",
")",
":",
"# print(self.__class__.__name__, \" remove \", controller.__class__.__name__)",
"for",
"key",
",",
... | Remove child controller and destroy it
Removes all references to the child controller and calls destroy() on the controller.
:param str | ExtendedController controller: Either the child controller object itself or its registered name
:return: Whether the controller was existing
:rtype:... | [
"Remove",
"child",
"controller",
"and",
"destroy",
"it"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/extended_controller.py#L67-L96 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/utils/extended_controller.py | ExtendedController.register_actions | def register_actions(self, shortcut_manager):
"""Register callback methods for triggered actions in all child controllers.
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings
between shortcuts and actions.
"""
assert ... | python | def register_actions(self, shortcut_manager):
"""Register callback methods for triggered actions in all child controllers.
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings
between shortcuts and actions.
"""
assert ... | [
"def",
"register_actions",
"(",
"self",
",",
"shortcut_manager",
")",
":",
"assert",
"isinstance",
"(",
"shortcut_manager",
",",
"ShortcutManager",
")",
"self",
".",
"__shortcut_manager",
"=",
"shortcut_manager",
"for",
"controller",
"in",
"list",
"(",
"self",
"."... | Register callback methods for triggered actions in all child controllers.
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings
between shortcuts and actions. | [
"Register",
"callback",
"methods",
"for",
"triggered",
"actions",
"in",
"all",
"child",
"controllers",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/extended_controller.py#L147-L162 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/utils/extended_controller.py | ExtendedController.destroy | def destroy(self):
"""Recursively destroy all Controllers
The method remove all controllers, which calls the destroy method of the child controllers. Then,
all registered models are relieved and and the widget hand by the initial view argument is destroyed.
"""
self.disconnect_a... | python | def destroy(self):
"""Recursively destroy all Controllers
The method remove all controllers, which calls the destroy method of the child controllers. Then,
all registered models are relieved and and the widget hand by the initial view argument is destroyed.
"""
self.disconnect_a... | [
"def",
"destroy",
"(",
"self",
")",
":",
"self",
".",
"disconnect_all_signals",
"(",
")",
"controller_names",
"=",
"[",
"key",
"for",
"key",
"in",
"self",
".",
"__child_controllers",
"]",
"for",
"controller_name",
"in",
"controller_names",
":",
"self",
".",
... | Recursively destroy all Controllers
The method remove all controllers, which calls the destroy method of the child controllers. Then,
all registered models are relieved and and the widget hand by the initial view argument is destroyed. | [
"Recursively",
"destroy",
"all",
"Controllers"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/extended_controller.py#L186-L212 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/utils/extended_controller.py | ExtendedController.observe_model | def observe_model(self, model):
"""Make this model observable within the controller
The method also keeps track of all observed models, in order to be able to relieve them later on.
:param gtkmvc3.Model model: The model to be observed
"""
self.__registered_models.add(model)
... | python | def observe_model(self, model):
"""Make this model observable within the controller
The method also keeps track of all observed models, in order to be able to relieve them later on.
:param gtkmvc3.Model model: The model to be observed
"""
self.__registered_models.add(model)
... | [
"def",
"observe_model",
"(",
"self",
",",
"model",
")",
":",
"self",
".",
"__registered_models",
".",
"add",
"(",
"model",
")",
"return",
"super",
"(",
"ExtendedController",
",",
"self",
")",
".",
"observe_model",
"(",
"model",
")"
] | Make this model observable within the controller
The method also keeps track of all observed models, in order to be able to relieve them later on.
:param gtkmvc3.Model model: The model to be observed | [
"Make",
"this",
"model",
"observable",
"within",
"the",
"controller"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/extended_controller.py#L214-L222 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/utils/extended_controller.py | ExtendedController.relieve_model | def relieve_model(self, model):
"""Do no longer observe the model
The model is also removed from the internal set of tracked models.
:param gtkmvc3.Model model: The model to be relieved
"""
self.__registered_models.remove(model)
return super(ExtendedController, self).re... | python | def relieve_model(self, model):
"""Do no longer observe the model
The model is also removed from the internal set of tracked models.
:param gtkmvc3.Model model: The model to be relieved
"""
self.__registered_models.remove(model)
return super(ExtendedController, self).re... | [
"def",
"relieve_model",
"(",
"self",
",",
"model",
")",
":",
"self",
".",
"__registered_models",
".",
"remove",
"(",
"model",
")",
"return",
"super",
"(",
"ExtendedController",
",",
"self",
")",
".",
"relieve_model",
"(",
"model",
")"
] | Do no longer observe the model
The model is also removed from the internal set of tracked models.
:param gtkmvc3.Model model: The model to be relieved | [
"Do",
"no",
"longer",
"observe",
"the",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/extended_controller.py#L224-L232 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/utils/extended_controller.py | ExtendedController.relieve_all_models | def relieve_all_models(self):
"""Relieve all registered models
The method uses the set of registered models to relieve them.
"""
map(self.relieve_model, list(self.__registered_models))
self.__registered_models.clear() | python | def relieve_all_models(self):
"""Relieve all registered models
The method uses the set of registered models to relieve them.
"""
map(self.relieve_model, list(self.__registered_models))
self.__registered_models.clear() | [
"def",
"relieve_all_models",
"(",
"self",
")",
":",
"map",
"(",
"self",
".",
"relieve_model",
",",
"list",
"(",
"self",
".",
"__registered_models",
")",
")",
"self",
".",
"__registered_models",
".",
"clear",
"(",
")"
] | Relieve all registered models
The method uses the set of registered models to relieve them. | [
"Relieve",
"all",
"registered",
"models"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/extended_controller.py#L234-L240 |
DLR-RM/RAFCON | source/rafcon/core/state_elements/data_port.py | DataPort.change_data_type | def change_data_type(self, data_type, default_value=None):
"""This method changes both the data type and default value. If one of the parameters does not fit,
an exception is thrown and no property is changed. Using this method ensures a consistent data type
and default value and only notifies o... | python | def change_data_type(self, data_type, default_value=None):
"""This method changes both the data type and default value. If one of the parameters does not fit,
an exception is thrown and no property is changed. Using this method ensures a consistent data type
and default value and only notifies o... | [
"def",
"change_data_type",
"(",
"self",
",",
"data_type",
",",
"default_value",
"=",
"None",
")",
":",
"old_data_type",
"=",
"self",
".",
"data_type",
"self",
".",
"data_type",
"=",
"data_type",
"if",
"default_value",
"is",
"None",
":",
"default_value",
"=",
... | This method changes both the data type and default value. If one of the parameters does not fit,
an exception is thrown and no property is changed. Using this method ensures a consistent data type
and default value and only notifies once.
:param data_type: The new data type
:param defau... | [
"This",
"method",
"changes",
"both",
"the",
"data",
"type",
"and",
"default",
"value",
".",
"If",
"one",
"of",
"the",
"parameters",
"does",
"not",
"fit",
"an",
"exception",
"is",
"thrown",
"and",
"no",
"property",
"is",
"changed",
".",
"Using",
"this",
"... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_elements/data_port.py#L189-L219 |
DLR-RM/RAFCON | source/rafcon/core/state_elements/data_port.py | DataPort.check_default_value | def check_default_value(self, default_value, data_type=None):
"""Check whether the passed default value suits to the passed data type. If no data type is passed, the
data type of the data port is used. If the default value does not fit, an exception is thrown. If the default
value is of type str... | python | def check_default_value(self, default_value, data_type=None):
"""Check whether the passed default value suits to the passed data type. If no data type is passed, the
data type of the data port is used. If the default value does not fit, an exception is thrown. If the default
value is of type str... | [
"def",
"check_default_value",
"(",
"self",
",",
"default_value",
",",
"data_type",
"=",
"None",
")",
":",
"if",
"data_type",
"is",
"None",
":",
"data_type",
"=",
"self",
".",
"data_type",
"if",
"default_value",
"is",
"not",
"None",
":",
"# If the default value... | Check whether the passed default value suits to the passed data type. If no data type is passed, the
data type of the data port is used. If the default value does not fit, an exception is thrown. If the default
value is of type string, it is tried to convert that value to the data type.
:param ... | [
"Check",
"whether",
"the",
"passed",
"default",
"value",
"suits",
"to",
"the",
"passed",
"data",
"type",
".",
"If",
"no",
"data",
"type",
"is",
"passed",
"the",
"data",
"type",
"of",
"the",
"data",
"port",
"is",
"used",
".",
"If",
"the",
"default",
"va... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_elements/data_port.py#L221-L257 |
DLR-RM/RAFCON | source/rafcon/core/interface.py | open_folder_cmd_line | def open_folder_cmd_line(query, default_path=None):
"""Queries the user for a path to open
:param str query: Query that asks the user for a specific folder path to be opened
:param str default_path: Path to use if the user doesn't specify a path
:return: Input path from the user or `default_path` ... | python | def open_folder_cmd_line(query, default_path=None):
"""Queries the user for a path to open
:param str query: Query that asks the user for a specific folder path to be opened
:param str default_path: Path to use if the user doesn't specify a path
:return: Input path from the user or `default_path` ... | [
"def",
"open_folder_cmd_line",
"(",
"query",
",",
"default_path",
"=",
"None",
")",
":",
"user_input",
"=",
"input",
"(",
"query",
"+",
"': '",
")",
"if",
"len",
"(",
"user_input",
")",
"==",
"0",
":",
"user_input",
"=",
"default_path",
"if",
"not",
"use... | Queries the user for a path to open
:param str query: Query that asks the user for a specific folder path to be opened
:param str default_path: Path to use if the user doesn't specify a path
:return: Input path from the user or `default_path` if nothing is specified or None if path does not exist
... | [
"Queries",
"the",
"user",
"for",
"a",
"path",
"to",
"open",
":",
"param",
"str",
"query",
":",
"Query",
"that",
"asks",
"the",
"user",
"for",
"a",
"specific",
"folder",
"path",
"to",
"be",
"opened",
":",
"param",
"str",
"default_path",
":",
"Path",
"to... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/interface.py#L24-L37 |
DLR-RM/RAFCON | source/rafcon/core/interface.py | create_folder_cmd_line | def create_folder_cmd_line(query, default_name=None, default_path=None):
"""Queries the user for a path to be created
:param str query: Query that asks the user for a specific folder path to be created
:param str default_name: Default name of the folder to be created
:param str default_path: Path in w... | python | def create_folder_cmd_line(query, default_name=None, default_path=None):
"""Queries the user for a path to be created
:param str query: Query that asks the user for a specific folder path to be created
:param str default_name: Default name of the folder to be created
:param str default_path: Path in w... | [
"def",
"create_folder_cmd_line",
"(",
"query",
",",
"default_name",
"=",
"None",
",",
"default_path",
"=",
"None",
")",
":",
"default",
"=",
"None",
"if",
"default_name",
"and",
"default_path",
":",
"default",
"=",
"os",
".",
"path",
".",
"join",
"(",
"def... | Queries the user for a path to be created
:param str query: Query that asks the user for a specific folder path to be created
:param str default_name: Default name of the folder to be created
:param str default_path: Path in which the folder is created if the user doesn't specify a path
:return: Input... | [
"Queries",
"the",
"user",
"for",
"a",
"path",
"to",
"be",
"created"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/interface.py#L42-L65 |
DLR-RM/RAFCON | source/rafcon/core/interface.py | save_folder_cmd_line | def save_folder_cmd_line(query, default_name=None, default_path=None):
"""Queries the user for a path or file to be saved into
The folder or file has not to be created already and will not be created by this function. The parent directory
of folder and file has to exist otherwise the function will return N... | python | def save_folder_cmd_line(query, default_name=None, default_path=None):
"""Queries the user for a path or file to be saved into
The folder or file has not to be created already and will not be created by this function. The parent directory
of folder and file has to exist otherwise the function will return N... | [
"def",
"save_folder_cmd_line",
"(",
"query",
",",
"default_name",
"=",
"None",
",",
"default_path",
"=",
"None",
")",
":",
"default",
"=",
"None",
"if",
"default_name",
"and",
"default_path",
":",
"default",
"=",
"os",
".",
"path",
".",
"join",
"(",
"defau... | Queries the user for a path or file to be saved into
The folder or file has not to be created already and will not be created by this function. The parent directory
of folder and file has to exist otherwise the function will return None.
:param str query: Query that asks the user for a specific folder/fil... | [
"Queries",
"the",
"user",
"for",
"a",
"path",
"or",
"file",
"to",
"be",
"saved",
"into"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/interface.py#L70-L91 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/transitions.py | StateTransitionsListController.register_view | def register_view(self, view):
"""Called when the View was registered
"""
super(StateTransitionsListController, self).register_view(view)
def cell_text(column, cell_renderer, model, iter, data):
t_id = model.get_value(iter, self.ID_STORAGE_ID)
in_external = 'exte... | python | def register_view(self, view):
"""Called when the View was registered
"""
super(StateTransitionsListController, self).register_view(view)
def cell_text(column, cell_renderer, model, iter, data):
t_id = model.get_value(iter, self.ID_STORAGE_ID)
in_external = 'exte... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"super",
"(",
"StateTransitionsListController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"def",
"cell_text",
"(",
"column",
",",
"cell_renderer",
",",
"model",
",",
"iter",
",",
"... | 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/state_editor/transitions.py#L79-L124 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/transitions.py | StateTransitionsListController.remove_core_element | def remove_core_element(self, model):
"""Remove respective core element of handed transition model
:param TransitionModel model: Transition model which core element should be removed
:return:
"""
assert model.transition.parent is self.model.state or model.transition.parent is se... | python | def remove_core_element(self, model):
"""Remove respective core element of handed transition model
:param TransitionModel model: Transition model which core element should be removed
:return:
"""
assert model.transition.parent is self.model.state or model.transition.parent is se... | [
"def",
"remove_core_element",
"(",
"self",
",",
"model",
")",
":",
"assert",
"model",
".",
"transition",
".",
"parent",
"is",
"self",
".",
"model",
".",
"state",
"or",
"model",
".",
"transition",
".",
"parent",
"is",
"self",
".",
"model",
".",
"parent",
... | Remove respective core element of handed transition model
:param TransitionModel model: Transition model which core element should be removed
:return: | [
"Remove",
"respective",
"core",
"element",
"of",
"handed",
"transition",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/transitions.py#L172-L179 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/transitions.py | StateTransitionsListController.get_possible_combos_for_transition | def get_possible_combos_for_transition(trans, model, self_model, is_external=False):
""" The function provides combos for a transition and its respective
:param trans:
:param model:
:param self_model:
:param is_external:
:return:
"""
from_state_combo = Gt... | python | def get_possible_combos_for_transition(trans, model, self_model, is_external=False):
""" The function provides combos for a transition and its respective
:param trans:
:param model:
:param self_model:
:param is_external:
:return:
"""
from_state_combo = Gt... | [
"def",
"get_possible_combos_for_transition",
"(",
"trans",
",",
"model",
",",
"self_model",
",",
"is_external",
"=",
"False",
")",
":",
"from_state_combo",
"=",
"Gtk",
".",
"ListStore",
"(",
"GObject",
".",
"TYPE_STRING",
",",
"GObject",
".",
"TYPE_STRING",
")",... | The function provides combos for a transition and its respective
:param trans:
:param model:
:param self_model:
:param is_external:
:return: | [
"The",
"function",
"provides",
"combos",
"for",
"a",
"transition",
"and",
"its",
"respective"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/transitions.py#L309-L419 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/transitions.py | StateTransitionsListController._update_internal_data_base | def _update_internal_data_base(self):
""" Updates Internal combo knowledge for any actual transition by calling get_possible_combos_for_transition-
function for those.
"""
model = self.model
# print("clean data base")
### FOR COMBOS
# internal transitions
... | python | def _update_internal_data_base(self):
""" Updates Internal combo knowledge for any actual transition by calling get_possible_combos_for_transition-
function for those.
"""
model = self.model
# print("clean data base")
### FOR COMBOS
# internal transitions
... | [
"def",
"_update_internal_data_base",
"(",
"self",
")",
":",
"model",
"=",
"self",
".",
"model",
"# print(\"clean data base\")",
"### FOR COMBOS",
"# internal transitions",
"# - take all internal states",
"# - take all not used internal outcomes of this states",
"# external transition... | Updates Internal combo knowledge for any actual transition by calling get_possible_combos_for_transition-
function for those. | [
"Updates",
"Internal",
"combo",
"knowledge",
"for",
"any",
"actual",
"transition",
"by",
"calling",
"get_possible_combos_for_transition",
"-",
"function",
"for",
"those",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/transitions.py#L421-L498 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/transitions.py | StateTransitionsListController._update_tree_store | def _update_tree_store(self):
""" Updates TreeStore of the Gtk.ListView according internal combo knowledge gained by
_update_internal_data_base function call.
"""
self.list_store.clear()
if self.view_dict['transitions_internal'] and isinstance(self.model, ContainerStateModel) an... | python | def _update_tree_store(self):
""" Updates TreeStore of the Gtk.ListView according internal combo knowledge gained by
_update_internal_data_base function call.
"""
self.list_store.clear()
if self.view_dict['transitions_internal'] and isinstance(self.model, ContainerStateModel) an... | [
"def",
"_update_tree_store",
"(",
"self",
")",
":",
"self",
".",
"list_store",
".",
"clear",
"(",
")",
"if",
"self",
".",
"view_dict",
"[",
"'transitions_internal'",
"]",
"and",
"isinstance",
"(",
"self",
".",
"model",
",",
"ContainerStateModel",
")",
"and",... | Updates TreeStore of the Gtk.ListView according internal combo knowledge gained by
_update_internal_data_base function call. | [
"Updates",
"TreeStore",
"of",
"the",
"Gtk",
".",
"ListView",
"according",
"internal",
"combo",
"knowledge",
"gained",
"by",
"_update_internal_data_base",
"function",
"call",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/transitions.py#L500-L586 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/transitions.py | StateTransitionsEditorController.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("delete", self.trans_list_ctrl.remove_action_callback)
shortcut_mana... | 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("delete", self.trans_list_ctrl.remove_action_callback)
shortcut_mana... | [
"def",
"register_actions",
"(",
"self",
",",
"shortcut_manager",
")",
":",
"shortcut_manager",
".",
"add_callback_for_action",
"(",
"\"delete\"",
",",
"self",
".",
"trans_list_ctrl",
".",
"remove_action_callback",
")",
"shortcut_manager",
".",
"add_callback_for_action",
... | 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/state_editor/transitions.py#L701-L707 |
DLR-RM/RAFCON | source/rafcon/gui/models/auto_backup.py | move_dirty_lock_file | def move_dirty_lock_file(dirty_lock_file, sm_path):
""" Move the dirt_lock file to the sm_path and thereby is not found by auto recovery of backup anymore """
if dirty_lock_file is not None \
and not dirty_lock_file == os.path.join(sm_path, dirty_lock_file.split(os.sep)[-1]):
logger.debug("M... | python | def move_dirty_lock_file(dirty_lock_file, sm_path):
""" Move the dirt_lock file to the sm_path and thereby is not found by auto recovery of backup anymore """
if dirty_lock_file is not None \
and not dirty_lock_file == os.path.join(sm_path, dirty_lock_file.split(os.sep)[-1]):
logger.debug("M... | [
"def",
"move_dirty_lock_file",
"(",
"dirty_lock_file",
",",
"sm_path",
")",
":",
"if",
"dirty_lock_file",
"is",
"not",
"None",
"and",
"not",
"dirty_lock_file",
"==",
"os",
".",
"path",
".",
"join",
"(",
"sm_path",
",",
"dirty_lock_file",
".",
"split",
"(",
"... | Move the dirt_lock file to the sm_path and thereby is not found by auto recovery of backup anymore | [
"Move",
"the",
"dirt_lock",
"file",
"to",
"the",
"sm_path",
"and",
"thereby",
"is",
"not",
"found",
"by",
"auto",
"recovery",
"of",
"backup",
"anymore"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/auto_backup.py#L92-L98 |
DLR-RM/RAFCON | source/rafcon/gui/models/auto_backup.py | AutoBackupModel.write_backup_meta_data | def write_backup_meta_data(self):
"""Write the auto backup meta data into the current tmp-storage path"""
auto_backup_meta_file = os.path.join(self._tmp_storage_path, FILE_NAME_AUTO_BACKUP)
storage.storage_utils.write_dict_to_json(self.meta, auto_backup_meta_file) | python | def write_backup_meta_data(self):
"""Write the auto backup meta data into the current tmp-storage path"""
auto_backup_meta_file = os.path.join(self._tmp_storage_path, FILE_NAME_AUTO_BACKUP)
storage.storage_utils.write_dict_to_json(self.meta, auto_backup_meta_file) | [
"def",
"write_backup_meta_data",
"(",
"self",
")",
":",
"auto_backup_meta_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_tmp_storage_path",
",",
"FILE_NAME_AUTO_BACKUP",
")",
"storage",
".",
"storage_utils",
".",
"write_dict_to_json",
"(",
"self",... | Write the auto backup meta data into the current tmp-storage path | [
"Write",
"the",
"auto",
"backup",
"meta",
"data",
"into",
"the",
"current",
"tmp",
"-",
"storage",
"path"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/auto_backup.py#L398-L401 |
DLR-RM/RAFCON | source/rafcon/gui/models/auto_backup.py | AutoBackupModel.update_last_backup_meta_data | def update_last_backup_meta_data(self):
"""Update the auto backup meta data with internal recovery information"""
self.meta['last_backup']['time'] = get_time_string_for_float(self.last_backup_time)
self.meta['last_backup']['file_system_path'] = self._tmp_storage_path
self.meta['last_back... | python | def update_last_backup_meta_data(self):
"""Update the auto backup meta data with internal recovery information"""
self.meta['last_backup']['time'] = get_time_string_for_float(self.last_backup_time)
self.meta['last_backup']['file_system_path'] = self._tmp_storage_path
self.meta['last_back... | [
"def",
"update_last_backup_meta_data",
"(",
"self",
")",
":",
"self",
".",
"meta",
"[",
"'last_backup'",
"]",
"[",
"'time'",
"]",
"=",
"get_time_string_for_float",
"(",
"self",
".",
"last_backup_time",
")",
"self",
".",
"meta",
"[",
"'last_backup'",
"]",
"[",
... | Update the auto backup meta data with internal recovery information | [
"Update",
"the",
"auto",
"backup",
"meta",
"data",
"with",
"internal",
"recovery",
"information"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/auto_backup.py#L403-L407 |
DLR-RM/RAFCON | source/rafcon/gui/models/auto_backup.py | AutoBackupModel.update_last_sm_origin_meta_data | def update_last_sm_origin_meta_data(self):
"""Update the auto backup meta data with information of the state machine origin"""
# TODO finally maybe remove this when all backup features are integrated into one backup-structure
# data also used e.g. to backup tabs
self.meta['last_saved']['... | python | def update_last_sm_origin_meta_data(self):
"""Update the auto backup meta data with information of the state machine origin"""
# TODO finally maybe remove this when all backup features are integrated into one backup-structure
# data also used e.g. to backup tabs
self.meta['last_saved']['... | [
"def",
"update_last_sm_origin_meta_data",
"(",
"self",
")",
":",
"# TODO finally maybe remove this when all backup features are integrated into one backup-structure",
"# data also used e.g. to backup tabs",
"self",
".",
"meta",
"[",
"'last_saved'",
"]",
"[",
"'time'",
"]",
"=",
"... | Update the auto backup meta data with information of the state machine origin | [
"Update",
"the",
"auto",
"backup",
"meta",
"data",
"with",
"information",
"of",
"the",
"state",
"machine",
"origin"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/auto_backup.py#L409-L414 |
DLR-RM/RAFCON | source/rafcon/gui/models/auto_backup.py | AutoBackupModel._check_for_dyn_timed_auto_backup | def _check_for_dyn_timed_auto_backup(self):
""" The method implements the timed storage feature.
The method re-initiating a new timed thread if the state-machine not already stored to backup
(what could be caused by the force_temp_storage_interval) or force the storing of the state-machine if... | python | def _check_for_dyn_timed_auto_backup(self):
""" The method implements the timed storage feature.
The method re-initiating a new timed thread if the state-machine not already stored to backup
(what could be caused by the force_temp_storage_interval) or force the storing of the state-machine if... | [
"def",
"_check_for_dyn_timed_auto_backup",
"(",
"self",
")",
":",
"current_time",
"=",
"time",
".",
"time",
"(",
")",
"self",
".",
"timer_request_lock",
".",
"acquire",
"(",
")",
"# sm = self.state_machine_model.state_machine",
"# TODO check for self._timer_request_time is ... | The method implements the timed storage feature.
The method re-initiating a new timed thread if the state-machine not already stored to backup
(what could be caused by the force_temp_storage_interval) or force the storing of the state-machine if there
is no new request for a timed backup. Ne... | [
"The",
"method",
"implements",
"the",
"timed",
"storage",
"feature",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/auto_backup.py#L429-L460 |
DLR-RM/RAFCON | source/rafcon/gui/models/auto_backup.py | AutoBackupModel.check_for_auto_backup | def check_for_auto_backup(self, force=False):
""" The method implements the checks for possible auto backup of the state-machine according duration till
the last change together with the private method _check_for_dyn_timed_auto_backup.
If the only_fix_interval is True this function is called on... | python | def check_for_auto_backup(self, force=False):
""" The method implements the checks for possible auto backup of the state-machine according duration till
the last change together with the private method _check_for_dyn_timed_auto_backup.
If the only_fix_interval is True this function is called on... | [
"def",
"check_for_auto_backup",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"timed_temp_storage_enabled",
":",
"return",
"sm",
"=",
"self",
".",
"state_machine_model",
".",
"state_machine",
"current_time",
"=",
"time",
".",
"ti... | The method implements the checks for possible auto backup of the state-machine according duration till
the last change together with the private method _check_for_dyn_timed_auto_backup.
If the only_fix_interval is True this function is called ones in the beginning and is called by a timed-
thre... | [
"The",
"method",
"implements",
"the",
"checks",
"for",
"possible",
"auto",
"backup",
"of",
"the",
"state",
"-",
"machine",
"according",
"duration",
"till",
"the",
"last",
"change",
"together",
"with",
"the",
"private",
"method",
"_check_for_dyn_timed_auto_backup",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/auto_backup.py#L501-L543 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_icons.py | StateIconController.on_drag_data_get | def on_drag_data_get(self, widget, context, data, info, time):
"""dragged state is inserted and its state_id sent to the receiver
:param widget:
:param context:
:param data: SelectionData: contains state_id
:param info:
:param time:
"""
import rafcon.gui.... | python | def on_drag_data_get(self, widget, context, data, info, time):
"""dragged state is inserted and its state_id sent to the receiver
:param widget:
:param context:
:param data: SelectionData: contains state_id
:param info:
:param time:
"""
import rafcon.gui.... | [
"def",
"on_drag_data_get",
"(",
"self",
",",
"widget",
",",
"context",
",",
"data",
",",
"info",
",",
"time",
")",
":",
"import",
"rafcon",
".",
"gui",
".",
"helpers",
".",
"state_machine",
"as",
"gui_helper_state_machine",
"state",
"=",
"self",
".",
"_get... | dragged state is inserted and its state_id sent to the receiver
:param widget:
:param context:
:param data: SelectionData: contains state_id
:param info:
:param time: | [
"dragged",
"state",
"is",
"inserted",
"and",
"its",
"state_id",
"sent",
"to",
"the",
"receiver"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_icons.py#L52-L63 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_icons.py | StateIconController.on_mouse_click | def on_mouse_click(self, widget, event):
"""state insertion on mouse click
:param widget:
:param Gdk.Event event: mouse click event
"""
import rafcon.gui.helpers.state_machine as gui_helper_state_machine
if self.view.get_path_at_pos(int(event.x), int(event.y)) is not Non... | python | def on_mouse_click(self, widget, event):
"""state insertion on mouse click
:param widget:
:param Gdk.Event event: mouse click event
"""
import rafcon.gui.helpers.state_machine as gui_helper_state_machine
if self.view.get_path_at_pos(int(event.x), int(event.y)) is not Non... | [
"def",
"on_mouse_click",
"(",
"self",
",",
"widget",
",",
"event",
")",
":",
"import",
"rafcon",
".",
"gui",
".",
"helpers",
".",
"state_machine",
"as",
"gui_helper_state_machine",
"if",
"self",
".",
"view",
".",
"get_path_at_pos",
"(",
"int",
"(",
"event",
... | state insertion on mouse click
:param widget:
:param Gdk.Event event: mouse click event | [
"state",
"insertion",
"on",
"mouse",
"click"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_icons.py#L81-L90 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_icons.py | StateIconController.on_mouse_motion | def on_mouse_motion(self, widget, event):
"""selection on mouse over
:param widget:
:param Gdk.Event event: mouse motion event
"""
path = self.view.get_path_at_pos(int(event.x), int(event.y))
if path is not None:
self.view.select_path(path)
else:
... | python | def on_mouse_motion(self, widget, event):
"""selection on mouse over
:param widget:
:param Gdk.Event event: mouse motion event
"""
path = self.view.get_path_at_pos(int(event.x), int(event.y))
if path is not None:
self.view.select_path(path)
else:
... | [
"def",
"on_mouse_motion",
"(",
"self",
",",
"widget",
",",
"event",
")",
":",
"path",
"=",
"self",
".",
"view",
".",
"get_path_at_pos",
"(",
"int",
"(",
"event",
".",
"x",
")",
",",
"int",
"(",
"event",
".",
"y",
")",
")",
"if",
"path",
"is",
"no... | selection on mouse over
:param widget:
:param Gdk.Event event: mouse motion event | [
"selection",
"on",
"mouse",
"over"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_icons.py#L92-L102 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_icons.py | StateIconController._get_state | def _get_state(self):
"""get state instance which was clicked on
:return: State that represents the icon which was clicked on
:rtype: rafcon.core.states.State
"""
selected = self.view.get_selected_items()
if not selected:
return
shorthand, state_clas... | python | def _get_state(self):
"""get state instance which was clicked on
:return: State that represents the icon which was clicked on
:rtype: rafcon.core.states.State
"""
selected = self.view.get_selected_items()
if not selected:
return
shorthand, state_clas... | [
"def",
"_get_state",
"(",
"self",
")",
":",
"selected",
"=",
"self",
".",
"view",
".",
"get_selected_items",
"(",
")",
"if",
"not",
"selected",
":",
"return",
"shorthand",
",",
"state_class",
"=",
"self",
".",
"view",
".",
"states",
"[",
"selected",
"[",... | get state instance which was clicked on
:return: State that represents the icon which was clicked on
:rtype: rafcon.core.states.State | [
"get",
"state",
"instance",
"which",
"was",
"clicked",
"on"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_icons.py#L104-L115 |
DLR-RM/RAFCON | source/rafcon/gui/utils/notification_overview.py | NotificationOverview.get_nice_info_dict_string | def get_nice_info_dict_string(self, info, level='\t', overview=None):
""" Inserts all elements of a notification info-dictionary of gtkmvc3 or a Signal into one string and indicates
levels of calls defined by 'kwargs'. Additionally, the elements get structured into a dict that holds all levels
o... | python | def get_nice_info_dict_string(self, info, level='\t', overview=None):
""" Inserts all elements of a notification info-dictionary of gtkmvc3 or a Signal into one string and indicates
levels of calls defined by 'kwargs'. Additionally, the elements get structured into a dict that holds all levels
o... | [
"def",
"get_nice_info_dict_string",
"(",
"self",
",",
"info",
",",
"level",
"=",
"'\\t'",
",",
"overview",
"=",
"None",
")",
":",
"def",
"get_nice_meta_signal_msg_tuple_string",
"(",
"meta_signal_msg_tuple",
",",
"level",
",",
"overview",
")",
":",
"meta_signal_di... | Inserts all elements of a notification info-dictionary of gtkmvc3 or a Signal into one string and indicates
levels of calls defined by 'kwargs'. Additionally, the elements get structured into a dict that holds all levels
of the general notification key-value pairs in faster accessible lists. The diction... | [
"Inserts",
"all",
"elements",
"of",
"a",
"notification",
"info",
"-",
"dictionary",
"of",
"gtkmvc3",
"or",
"a",
"Signal",
"into",
"one",
"string",
"and",
"indicates",
"levels",
"of",
"calls",
"defined",
"by",
"kwargs",
".",
"Additionally",
"the",
"elements",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/utils/notification_overview.py#L114-L269 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/outcomes.py | StateOutcomesListController.register_view | def register_view(self, view):
"""Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
"""
super(StateOutcomesListController, self).register_view(view)
if isinstance(view, StateOutcomesTreeView):
... | python | def register_view(self, view):
"""Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
"""
super(StateOutcomesListController, self).register_view(view)
if isinstance(view, StateOutcomesTreeView):
... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"super",
"(",
"StateOutcomesListController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"if",
"isinstance",
"(",
"view",
",",
"StateOutcomesTreeView",
")",
":",
"self",
".",
"connect_... | Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application | [
"Called",
"when",
"the",
"View",
"was",
"registered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/outcomes.py#L89-L105 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/outcomes.py | StateOutcomesListController.apply_new_outcome_name | def apply_new_outcome_name(self, path, new_name):
"""Apply the newly entered outcome name it is was changed
:param str path: The path string of the renderer
:param str new_name: Newly entered outcome name
"""
# Don't do anything if outcome name didn't change
if new_name ... | python | def apply_new_outcome_name(self, path, new_name):
"""Apply the newly entered outcome name it is was changed
:param str path: The path string of the renderer
:param str new_name: Newly entered outcome name
"""
# Don't do anything if outcome name didn't change
if new_name ... | [
"def",
"apply_new_outcome_name",
"(",
"self",
",",
"path",
",",
"new_name",
")",
":",
"# Don't do anything if outcome name didn't change",
"if",
"new_name",
"==",
"self",
".",
"list_store",
"[",
"path",
"]",
"[",
"self",
".",
"NAME_STORAGE_ID",
"]",
":",
"return",... | Apply the newly entered outcome name it is was changed
:param str path: The path string of the renderer
:param str new_name: Newly entered outcome name | [
"Apply",
"the",
"newly",
"entered",
"outcome",
"name",
"it",
"is",
"was",
"changed"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/outcomes.py#L107-L123 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/outcomes.py | StateOutcomesListController.on_to_state_edited | def on_to_state_edited(self, renderer, path, new_state_identifier):
"""Connects the outcome with a transition to the newly set state
:param Gtk.CellRendererText renderer: The cell renderer that was edited
:param str path: The path string of the renderer
:param str new_state_identifier: ... | python | def on_to_state_edited(self, renderer, path, new_state_identifier):
"""Connects the outcome with a transition to the newly set state
:param Gtk.CellRendererText renderer: The cell renderer that was edited
:param str path: The path string of the renderer
:param str new_state_identifier: ... | [
"def",
"on_to_state_edited",
"(",
"self",
",",
"renderer",
",",
"path",
",",
"new_state_identifier",
")",
":",
"def",
"do_self_transition_check",
"(",
"t_id",
",",
"new_state_identifier",
")",
":",
"# add self transition meta data",
"if",
"'self'",
"in",
"new_state_id... | Connects the outcome with a transition to the newly set state
:param Gtk.CellRendererText renderer: The cell renderer that was edited
:param str path: The path string of the renderer
:param str new_state_identifier: An identifier for the new state that was selected | [
"Connects",
"the",
"outcome",
"with",
"a",
"transition",
"to",
"the",
"newly",
"set",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/outcomes.py#L125-L171 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/outcomes.py | StateOutcomesListController.on_to_outcome_edited | def on_to_outcome_edited(self, renderer, path, new_outcome_identifier):
"""Connects the outcome with a transition to the newly set outcome
:param Gtk.CellRendererText renderer: The cell renderer that was edited
:param str path: The path string of the renderer
:param str new_outcome_iden... | python | def on_to_outcome_edited(self, renderer, path, new_outcome_identifier):
"""Connects the outcome with a transition to the newly set outcome
:param Gtk.CellRendererText renderer: The cell renderer that was edited
:param str path: The path string of the renderer
:param str new_outcome_iden... | [
"def",
"on_to_outcome_edited",
"(",
"self",
",",
"renderer",
",",
"path",
",",
"new_outcome_identifier",
")",
":",
"if",
"self",
".",
"model",
".",
"parent",
"is",
"None",
":",
"return",
"outcome_id",
"=",
"self",
".",
"list_store",
"[",
"path",
"]",
"[",
... | Connects the outcome with a transition to the newly set outcome
:param Gtk.CellRendererText renderer: The cell renderer that was edited
:param str path: The path string of the renderer
:param str new_outcome_identifier: An identifier for the new outcome that was selected | [
"Connects",
"the",
"outcome",
"with",
"a",
"transition",
"to",
"the",
"newly",
"set",
"outcome"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/outcomes.py#L173-L213 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/outcomes.py | StateOutcomesListController.remove_core_element | def remove_core_element(self, model):
"""Remove respective core element of handed outcome model
:param OutcomeModel model: Outcome model which core element should be removed
:return:
"""
assert model.outcome.parent is self.model.state
gui_helper_state_machine.delete_core... | python | def remove_core_element(self, model):
"""Remove respective core element of handed outcome model
:param OutcomeModel model: Outcome model which core element should be removed
:return:
"""
assert model.outcome.parent is self.model.state
gui_helper_state_machine.delete_core... | [
"def",
"remove_core_element",
"(",
"self",
",",
"model",
")",
":",
"assert",
"model",
".",
"outcome",
".",
"parent",
"is",
"self",
".",
"model",
".",
"state",
"gui_helper_state_machine",
".",
"delete_core_element_of_model",
"(",
"model",
")"
] | Remove respective core element of handed outcome model
:param OutcomeModel model: Outcome model which core element should be removed
:return: | [
"Remove",
"respective",
"core",
"element",
"of",
"handed",
"outcome",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/outcomes.py#L225-L232 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/outcomes.py | StateOutcomesEditorController.register_view | def register_view(self, view):
"""Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
"""
super(StateOutcomesEditorController, self).register_view(view)
if isinstance(view, StateOutcomesEditorVie... | python | def register_view(self, view):
"""Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
"""
super(StateOutcomesEditorController, self).register_view(view)
if isinstance(view, StateOutcomesEditorVie... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"super",
"(",
"StateOutcomesEditorController",
",",
"self",
")",
".",
"register_view",
"(",
"view",
")",
"if",
"isinstance",
"(",
"view",
",",
"StateOutcomesEditorView",
")",
":",
"self",
".",
"conn... | Called when the View was registered
Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application | [
"Called",
"when",
"the",
"View",
"was",
"registered"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/outcomes.py#L359-L371 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/state_editor/outcomes.py | StateOutcomesEditorController.paste_action_callback | def paste_action_callback(self, *event):
"""Callback method for paste action"""
if react_to_event(self.view, self.oc_list_ctrl.tree_view, event) and self.oc_list_ctrl.active_entry_widget is None:
global_clipboard.paste(self.model, limited=['outcomes'])
return True | python | def paste_action_callback(self, *event):
"""Callback method for paste action"""
if react_to_event(self.view, self.oc_list_ctrl.tree_view, event) and self.oc_list_ctrl.active_entry_widget is None:
global_clipboard.paste(self.model, limited=['outcomes'])
return True | [
"def",
"paste_action_callback",
"(",
"self",
",",
"*",
"event",
")",
":",
"if",
"react_to_event",
"(",
"self",
".",
"view",
",",
"self",
".",
"oc_list_ctrl",
".",
"tree_view",
",",
"event",
")",
"and",
"self",
".",
"oc_list_ctrl",
".",
"active_entry_widget",... | Callback method for paste action | [
"Callback",
"method",
"for",
"paste",
"action"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/outcomes.py#L384-L388 |
DLR-RM/RAFCON | source/rafcon/gui/views/state_editor/state_editor.py | StateEditorView.bring_tab_to_the_top | def bring_tab_to_the_top(self, tab_label):
"""Find tab with label tab_label in list of notebook's and set it to the current page.
:param tab_label: String containing the label of the tab to be focused
"""
page = self.page_dict[tab_label]
for notebook in self.notebook_names:
... | python | def bring_tab_to_the_top(self, tab_label):
"""Find tab with label tab_label in list of notebook's and set it to the current page.
:param tab_label: String containing the label of the tab to be focused
"""
page = self.page_dict[tab_label]
for notebook in self.notebook_names:
... | [
"def",
"bring_tab_to_the_top",
"(",
"self",
",",
"tab_label",
")",
":",
"page",
"=",
"self",
".",
"page_dict",
"[",
"tab_label",
"]",
"for",
"notebook",
"in",
"self",
".",
"notebook_names",
":",
"page_num",
"=",
"self",
"[",
"notebook",
"]",
".",
"page_num... | Find tab with label tab_label in list of notebook's 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",
"notebook",
"s",
"and",
"set",
"it",
"to",
"the",
"current",
"page",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/state_editor/state_editor.py#L133-L143 |
DLR-RM/RAFCON | source/rafcon/gui/controllers/debug_console.py | DebugConsoleController.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",
"\"LOGGING\"",
"in",
"config_key",
":",
"self",
".",
"update_log_button_state",
"(",
... | 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/debug_console.py#L69-L78 |
DLR-RM/RAFCON | source/rafcon/gui/utils/comparison.py | compare_variables | def compare_variables(tree_model, iter1, iter2, user_data=None):
"""Triggered upon updating the list of global variables
Helper method to sort global variables alphabetically.
:param tree_model: Tree model implementing the Gtk.TreeSortable interface.
:param iter1: Points at a row.
... | python | def compare_variables(tree_model, iter1, iter2, user_data=None):
"""Triggered upon updating the list of global variables
Helper method to sort global variables alphabetically.
:param tree_model: Tree model implementing the Gtk.TreeSortable interface.
:param iter1: Points at a row.
... | [
"def",
"compare_variables",
"(",
"tree_model",
",",
"iter1",
",",
"iter2",
",",
"user_data",
"=",
"None",
")",
":",
"path1",
"=",
"tree_model",
".",
"get_path",
"(",
"iter1",
")",
"[",
"0",
"]",
"path2",
"=",
"tree_model",
".",
"get_path",
"(",
"iter2",
... | Triggered upon updating the list of global variables
Helper method to sort global variables alphabetically.
:param tree_model: Tree model implementing the Gtk.TreeSortable interface.
:param iter1: Points at a row.
:param iter2: Points at a row. | [
"Triggered",
"upon",
"updating",
"the",
"list",
"of",
"global",
"variables"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/utils/comparison.py#L15-L37 |
DLR-RM/RAFCON | source/rafcon/core/state_machine_manager.py | StateMachineManager.has_dirty_state_machine | def has_dirty_state_machine(self):
"""Checks if one of the registered sm has the marked_dirty flag set to True (i.e. the sm was recently modified,
without being saved)
:return: True if contains state machine that is marked dirty, False otherwise.
"""
for sm in self.state_machine... | python | def has_dirty_state_machine(self):
"""Checks if one of the registered sm has the marked_dirty flag set to True (i.e. the sm was recently modified,
without being saved)
:return: True if contains state machine that is marked dirty, False otherwise.
"""
for sm in self.state_machine... | [
"def",
"has_dirty_state_machine",
"(",
"self",
")",
":",
"for",
"sm",
"in",
"self",
".",
"state_machines",
".",
"values",
"(",
")",
":",
"if",
"sm",
".",
"marked_dirty",
":",
"return",
"True",
"return",
"False"
] | Checks if one of the registered sm has the marked_dirty flag set to True (i.e. the sm was recently modified,
without being saved)
:return: True if contains state machine that is marked dirty, False otherwise. | [
"Checks",
"if",
"one",
"of",
"the",
"registered",
"sm",
"has",
"the",
"marked_dirty",
"flag",
"set",
"to",
"True",
"(",
"i",
".",
"e",
".",
"the",
"sm",
"was",
"recently",
"modified",
"without",
"being",
"saved",
")"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_machine_manager.py#L70-L79 |
DLR-RM/RAFCON | source/rafcon/core/state_machine_manager.py | StateMachineManager.reset_dirty_flags | def reset_dirty_flags(self):
"""Set all marked_dirty flags of the state machine to false."""
for sm_id, sm in self.state_machines.items():
sm.marked_dirty = False | python | def reset_dirty_flags(self):
"""Set all marked_dirty flags of the state machine to false."""
for sm_id, sm in self.state_machines.items():
sm.marked_dirty = False | [
"def",
"reset_dirty_flags",
"(",
"self",
")",
":",
"for",
"sm_id",
",",
"sm",
"in",
"self",
".",
"state_machines",
".",
"items",
"(",
")",
":",
"sm",
".",
"marked_dirty",
"=",
"False"
] | Set all marked_dirty flags of the state machine to false. | [
"Set",
"all",
"marked_dirty",
"flags",
"of",
"the",
"state",
"machine",
"to",
"false",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_machine_manager.py#L81-L84 |
DLR-RM/RAFCON | source/rafcon/core/state_machine_manager.py | StateMachineManager.add_state_machine | def add_state_machine(self, state_machine):
"""Add a state machine to the list of managed state machines. If there is no active state machine set yet,
then set as active state machine.
:param state_machine: State Machine Object
:raises exceptions.AttributeError: if the passed state ... | python | def add_state_machine(self, state_machine):
"""Add a state machine to the list of managed state machines. If there is no active state machine set yet,
then set as active state machine.
:param state_machine: State Machine Object
:raises exceptions.AttributeError: if the passed state ... | [
"def",
"add_state_machine",
"(",
"self",
",",
"state_machine",
")",
":",
"if",
"not",
"isinstance",
"(",
"state_machine",
",",
"StateMachine",
")",
":",
"raise",
"AttributeError",
"(",
"\"State machine must be of type StateMachine\"",
")",
"if",
"state_machine",
".",
... | Add a state machine to the list of managed state machines. If there is no active state machine set yet,
then set as active state machine.
:param state_machine: State Machine Object
:raises exceptions.AttributeError: if the passed state machine was already added of is of a wrong type | [
"Add",
"a",
"state",
"machine",
"to",
"the",
"list",
"of",
"managed",
"state",
"machines",
".",
"If",
"there",
"is",
"no",
"active",
"state",
"machine",
"set",
"yet",
"then",
"set",
"as",
"active",
"state",
"machine",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_machine_manager.py#L93-L107 |
DLR-RM/RAFCON | source/rafcon/core/state_machine_manager.py | StateMachineManager.remove_state_machine | def remove_state_machine(self, state_machine_id):
"""Remove the state machine for a specified state machine id from the list of registered state machines.
:param state_machine_id: the id of the state machine to be removed
"""
import rafcon.core.singleton as core_singletons
remov... | python | def remove_state_machine(self, state_machine_id):
"""Remove the state machine for a specified state machine id from the list of registered state machines.
:param state_machine_id: the id of the state machine to be removed
"""
import rafcon.core.singleton as core_singletons
remov... | [
"def",
"remove_state_machine",
"(",
"self",
",",
"state_machine_id",
")",
":",
"import",
"rafcon",
".",
"core",
".",
"singleton",
"as",
"core_singletons",
"removed_state_machine",
"=",
"None",
"if",
"state_machine_id",
"in",
"self",
".",
"_state_machines",
":",
"l... | Remove the state machine for a specified state machine id from the list of registered state machines.
:param state_machine_id: the id of the state machine to be removed | [
"Remove",
"the",
"state",
"machine",
"for",
"a",
"specified",
"state",
"machine",
"id",
"from",
"the",
"list",
"of",
"registered",
"state",
"machines",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_machine_manager.py#L110-L126 |
DLR-RM/RAFCON | source/rafcon/core/state_machine_manager.py | StateMachineManager.get_active_state_machine | def get_active_state_machine(self):
"""Return a reference to the active state-machine
"""
if self._active_state_machine_id in self._state_machines:
return self._state_machines[self._active_state_machine_id]
else:
return None | python | def get_active_state_machine(self):
"""Return a reference to the active state-machine
"""
if self._active_state_machine_id in self._state_machines:
return self._state_machines[self._active_state_machine_id]
else:
return None | [
"def",
"get_active_state_machine",
"(",
"self",
")",
":",
"if",
"self",
".",
"_active_state_machine_id",
"in",
"self",
".",
"_state_machines",
":",
"return",
"self",
".",
"_state_machines",
"[",
"self",
".",
"_active_state_machine_id",
"]",
"else",
":",
"return",
... | Return a reference to the active state-machine | [
"Return",
"a",
"reference",
"to",
"the",
"active",
"state",
"-",
"machine"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_machine_manager.py#L128-L134 |
DLR-RM/RAFCON | source/rafcon/core/state_machine_manager.py | StateMachineManager.get_open_state_machine_of_file_system_path | def get_open_state_machine_of_file_system_path(self, file_system_path):
"""Return a reference to the state machine with respective path if open
"""
for sm in self.state_machines.values():
if sm.file_system_path == file_system_path:
return sm | python | def get_open_state_machine_of_file_system_path(self, file_system_path):
"""Return a reference to the state machine with respective path if open
"""
for sm in self.state_machines.values():
if sm.file_system_path == file_system_path:
return sm | [
"def",
"get_open_state_machine_of_file_system_path",
"(",
"self",
",",
"file_system_path",
")",
":",
"for",
"sm",
"in",
"self",
".",
"state_machines",
".",
"values",
"(",
")",
":",
"if",
"sm",
".",
"file_system_path",
"==",
"file_system_path",
":",
"return",
"sm... | Return a reference to the state machine with respective path if open | [
"Return",
"a",
"reference",
"to",
"the",
"state",
"machine",
"with",
"respective",
"path",
"if",
"open"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_machine_manager.py#L136-L141 |
DLR-RM/RAFCON | source/rafcon/gui/views/undocked_window.py | UndockedWindowView.reset_title | def reset_title(self, title, notebook_identifier):
"""Triggered whenever a notebook tab is switched in the left bar.
Resets the title of the un-docked window to the format 'upper_open_tab / lower_open_tab'
:param title: The name of the newly selected tab
:param notebook: string taking ... | python | def reset_title(self, title, notebook_identifier):
"""Triggered whenever a notebook tab is switched in the left bar.
Resets the title of the un-docked window to the format 'upper_open_tab / lower_open_tab'
:param title: The name of the newly selected tab
:param notebook: string taking ... | [
"def",
"reset_title",
"(",
"self",
",",
"title",
",",
"notebook_identifier",
")",
":",
"current_title",
"=",
"self",
".",
"get_top_widget",
"(",
")",
".",
"get_title",
"(",
")",
"upper_title",
"=",
"current_title",
".",
"split",
"(",
"'/'",
")",
"[",
"0",
... | Triggered whenever a notebook tab is switched in the left bar.
Resets the title of the un-docked window to the format 'upper_open_tab / lower_open_tab'
:param title: The name of the newly selected tab
:param notebook: string taking one of two values 'upper' or 'lower' indicating which notebook... | [
"Triggered",
"whenever",
"a",
"notebook",
"tab",
"is",
"switched",
"in",
"the",
"left",
"bar",
"."
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/undocked_window.py#L57-L72 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | negative_check_for_model_in_expected_future_models | def negative_check_for_model_in_expected_future_models(target_state_m, model, msg, delete=True, with_logger=None):
""" Checks if the expected future models list/set includes still a specific model
Return False if the handed model is still in and also creates a warning message as feedback.
:param StateMode... | python | def negative_check_for_model_in_expected_future_models(target_state_m, model, msg, delete=True, with_logger=None):
""" Checks if the expected future models list/set includes still a specific model
Return False if the handed model is still in and also creates a warning message as feedback.
:param StateMode... | [
"def",
"negative_check_for_model_in_expected_future_models",
"(",
"target_state_m",
",",
"model",
",",
"msg",
",",
"delete",
"=",
"True",
",",
"with_logger",
"=",
"None",
")",
":",
"if",
"with_logger",
"is",
"None",
":",
"with_logger",
"=",
"logger",
"# check that... | Checks if the expected future models list/set includes still a specific model
Return False if the handed model is still in and also creates a warning message as feedback.
:param StateModel target_state_m: The state model which expected_future_models attribute should be checked
:param Model model: Model to... | [
"Checks",
"if",
"the",
"expected",
"future",
"models",
"list",
"/",
"set",
"includes",
"still",
"a",
"specific",
"model"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L40-L63 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | check_expected_future_model_list_is_empty | def check_expected_future_model_list_is_empty(target_state_m, msg, delete=True, with_logger=None):
""" Checks if the expected future models list/set is empty
Return False if there are still elements in and also creates a warning message as feedback.
:param StateModel target_state_m: The state model which ... | python | def check_expected_future_model_list_is_empty(target_state_m, msg, delete=True, with_logger=None):
""" Checks if the expected future models list/set is empty
Return False if there are still elements in and also creates a warning message as feedback.
:param StateModel target_state_m: The state model which ... | [
"def",
"check_expected_future_model_list_is_empty",
"(",
"target_state_m",
",",
"msg",
",",
"delete",
"=",
"True",
",",
"with_logger",
"=",
"None",
")",
":",
"if",
"with_logger",
"is",
"None",
":",
"with_logger",
"=",
"logger",
"# check that the model in the list expe... | Checks if the expected future models list/set is empty
Return False if there are still elements in and also creates a warning message as feedback.
:param StateModel target_state_m: The state model which expected_future_models attribute should be checked
:param str msg: Message for the logger if a model is... | [
"Checks",
"if",
"the",
"expected",
"future",
"models",
"list",
"/",
"set",
"is",
"empty"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L66-L88 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | update_models_recursively | def update_models_recursively(state_m, expected=True):
""" If a state model is reused the model depth maybe is to low. Therefore this method checks if all
library state models are created with reliable depth
:param bool expected: Define newly generated library models as expected or triggers logger war... | python | def update_models_recursively(state_m, expected=True):
""" If a state model is reused the model depth maybe is to low. Therefore this method checks if all
library state models are created with reliable depth
:param bool expected: Define newly generated library models as expected or triggers logger war... | [
"def",
"update_models_recursively",
"(",
"state_m",
",",
"expected",
"=",
"True",
")",
":",
"assert",
"isinstance",
"(",
"state_m",
",",
"AbstractStateModel",
")",
"if",
"isinstance",
"(",
"state_m",
",",
"LibraryStateModel",
")",
":",
"if",
"not",
"state_m",
... | If a state model is reused the model depth maybe is to low. Therefore this method checks if all
library state models are created with reliable depth
:param bool expected: Define newly generated library models as expected or triggers logger warnings if False | [
"If",
"a",
"state",
"model",
"is",
"reused",
"the",
"model",
"depth",
"maybe",
"is",
"to",
"low",
".",
"Therefore",
"this",
"method",
"checks",
"if",
"all",
"library",
"state",
"models",
"are",
"created",
"with",
"reliable",
"depth",
":",
"param",
"bool",
... | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L91-L110 |
DLR-RM/RAFCON | source/rafcon/gui/helpers/state.py | add_state | def add_state(container_state_m, state_type):
"""Add a state to a container state
Adds a state of type state_type to the given container_state
:param rafcon.gui.models.container_state.ContainerState container_state_m: A model of a container state to add
the new state to
:param rafcon.core.enums.... | python | def add_state(container_state_m, state_type):
"""Add a state to a container state
Adds a state of type state_type to the given container_state
:param rafcon.gui.models.container_state.ContainerState container_state_m: A model of a container state to add
the new state to
:param rafcon.core.enums.... | [
"def",
"add_state",
"(",
"container_state_m",
",",
"state_type",
")",
":",
"if",
"container_state_m",
"is",
"None",
":",
"logger",
".",
"error",
"(",
"\"Cannot add a state without a parent.\"",
")",
"return",
"False",
"if",
"not",
"isinstance",
"(",
"container_state... | Add a state to a container state
Adds a state of type state_type to the given container_state
:param rafcon.gui.models.container_state.ContainerState container_state_m: A model of a container state to add
the new state to
:param rafcon.core.enums.StateType state_type: The type of state that should b... | [
"Add",
"a",
"state",
"to",
"a",
"container",
"state"
] | train | https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/helpers/state.py#L113-L144 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.