reVX.least_cost_xmission.least_cost_paths.ReinforcementPaths

class ReinforcementPaths(cost_fpath, features, transmission_lines, clip_buffer=0)[source]

Bases: LeastCostPaths

Compute reinforcement line paths between substations and a single balancing area network node.

Parameters:
  • cost_fpath (str) – Path to h5 file with cost rasters and other required layers.

  • features (geopandas.GeoPackage) – GeoPackage with transmission features. The network node must be the first row of the GeoPackage - the rest should be substations that need to connect to that node.

  • transmission_lines (dict) – Dictionary where the keys are the names of cost layers in the cost HDF5 file and values are arrays with the corresponding existing transmission lines rastered into them (i.e. array value is 1 at a pixel if there is a transmission line, otherwise 0). These arrays will be used to compute the reinforcement costs along existing transmission lines of differing voltages.

  • clip_buffer (int, optional) – Optional number of array elements to buffer clip area by. By default, 0.

Methods

process_least_cost_paths(capacity_class[, ...])

Find the reinforcement line paths between the network node and the substations for the given tie-line capacity class

run(cost_fpath, features_fpath, ...[, ...])

Find the reinforcement line paths between the network node and the substations for the given tie-line capacity class

Attributes

REQUIRED_LAYERS

end_features

GeoDataFrame containing the transmission features to compute the least cost paths to, starting from the start_indices (typically the centroid of the supply curve cell under consideration).

end_indices

Tuple (row, col) index or list of (row, col) indices in the cost array indicating the end location(s) to compute reinforcement line paths to (typically substations within a single reinforcement region).

features

Table of features to compute paths for

start_indices

Tuple of (row_idx, col_idx) in the cost array indicating the start position of all reinforcement line paths to compute (typically, this is the location of the network node in the reinforcement region).

property start_indices

Tuple of (row_idx, col_idx) in the cost array indicating the start position of all reinforcement line paths to compute (typically, this is the location of the network node in the reinforcement region). Paths will be computed from this start location to each of the end_indices, which are also locations in the cost array (typically substations within the reinforcement region of the network node).

Returns:

tuple

property end_indices

Tuple (row, col) index or list of (row, col) indices in the cost array indicating the end location(s) to compute reinforcement line paths to (typically substations within a single reinforcement region). Paths are computed from the start_indices (typically the network node of the reinforcement region) to each of the individual pairs of end_indices.

Returns:

tuple | list

process_least_cost_paths(capacity_class, barrier_mult=100, save_paths=False)[source]

Find the reinforcement line paths between the network node and the substations for the given tie-line capacity class

Parameters:
  • capacity_class (str | int) – Transmission feature capacity_class to use for the ‘base’ greenfield costs. ‘Base’ greenfield costs are only used if the reinforcement path must deviate from existing transmission lines. Typically, a capacity class of 400 MW (230kV transmission line) is used for the base greenfield costs.

  • barrier_mult (int, optional) – Multiplier on transmission barrier costs. By default, 100.

  • max_workers (int, optional) – Number of workers to use for processing. If 1 run in serial, if None use all available cores. By default, None.

  • save_paths (bool, optional) – Flag to save reinforcement line path as a multi-line geometry. By default, False.

Returns:

least_cost_paths (pandas.DataFrame | gpd.GeoDataFrame) – DataFrame of lengths and costs for each reinforcement line path or GeoDataFrame of length, cost, and geometry for each reinforcement line path.

classmethod run(cost_fpath, features_fpath, network_nodes_fpath, region_identifier_column, transmission_lines_fpath, capacity_class, xmission_config=None, clip_buffer=0, barrier_mult=100, indices=None, save_paths=False)[source]

Find the reinforcement line paths between the network node and the substations for the given tie-line capacity class

Parameters:
  • cost_fpath (str) – Path to h5 file with cost rasters and other required layers.

  • features_fpath (str) – Path to GeoPackage with transmission features. The network node must be the first row of the GeoPackage - the rest should be substations that need to connect to that node. This table must have a region_identifier_column column which matches the region_identifier_column ID of the network node to the region_identifier_column ID of the substations that should connect to it.

  • network_nodes_fpath (str) – Path to GeoPackage with network node endpoints. The endpoints should have a region_identifier_column column that identifies matches exactly one of the ID’s in the reinforcement regions GeoPackage to be used in downstream models.

  • region_identifier_column (str) – Name of column in network_nodes_fpath GeoPackage containing a unique identifier for each region.

  • capacity_class (str | int) – Transmission feature capacity_class to use for the ‘base’ greenfield costs. ‘Base’ greenfield costs are only used if the reinforcement path must deviate from existing transmission lines. Typically, a capacity class of 400 MW (230kV transmission line) is used for the base greenfield costs.

  • xmission_config (str | dict | XmissionConfig, optional) – Path to Xmission config .json, dictionary of Xmission config .jsons, or preloaded XmissionConfig objects. By default, None.

  • clip_buffer (int, optional) – Optional number of array elements to buffer clip area by. By default, 0.

  • barrier_mult (int, optional) – Multiplier on transmission barrier costs. By default, 100.

  • max_workers (int, optional) – Number of workers to use for processing. If 1 run in serial, if None use all available cores. By default, None.

  • save_paths (bool, optional) – Flag to save reinforcement line path as a multi-line geometry. By default, False.

Returns:

least_cost_paths (pandas.DataFrame | gpd.GeoDataFrame) – DataFrame of lengths and costs for each reinforcement line path or GeoDataFrame of length, cost, and geometry for each reinforcement line path.

property end_features

GeoDataFrame containing the transmission features to compute the least cost paths to, starting from the start_indices (typically the centroid of the supply curve cell under consideration).

Returns:

pandas.DataFrame

property features

Table of features to compute paths for

Returns:

pandas.DataFrame