GC_utils module
- GC_utils.CheckRadialConnectedNetwork(grid, units=False)[source]
Check if the network is both radial and connected.
This method verifies if the network represented by the graph is a radial network and whether it is connected. A radial network is defined as a tree structure (i.e., acyclic and connected).
- Returns:
- A tuple containing three boolean values:
RadialConnected (bool): True if the network is both radial and connected, False otherwise.
connected (bool): True if the network is connected, False otherwise.
radial (bool): True if the network is a tree (radial), False otherwise.
- Return type:
- GC_utils.GC_FitnessCalculation(grid, totalLoad, loss_factor=2, voltage_factor=1, split_factor=1)[source]
- GC_utils.NetworkReconfiguration(grid, all=False, selected_configuration=None, value_all=False, value_configuration=False)[source]
Network reconfiguration : sets the line state to on/off depending on the arguments. The changes are applied to the DistributionNetwork structure, to the internal graph and to the original source of information (openDSS, GridCal, PandaPower)
- Parameters:
all=False – if True all the lines will be set to the value in “value_all”, if False the line status will remain as it is.
selected_configuration=None – if different of None, the values in this list will be set to the value in “value_configuration”
value_configuration=False
value_all=False
extraData=True – this atributte indicates if the functions :DistributionNetwork2Graph(), LinesOutService() and NetworkSummary() will be called
- Returns:
None
- GC_utils.find_value_in_arrays(self, arrays, value)[source]
Finds the index and array containing a specific value.
- GC_utils.list_belongs_to_list_of_lists(list_to_check, list_of_lists)[source]
Checks if the given list is a subset of any list within a list of lists.
- Parameters:
list_to_check – The list to check.
list_of_lists – The list of lists to check against.
- Returns:
True if the list is a subset of any list in the list of lists, otherwise False.
- GC_utils.remove_duplicates(list_of_lists)[source]
Removes duplicate items from each sublist in a list of lists.
- Parameters:
list_of_lists – The list of lists from which to remove duplicates.
- Returns:
The modified list of lists with duplicates removed.