dhd.features

Module to get quantitative information on the computed district heating network and to represent it on the plot interface created with the module dhd.plot.

Inputs

All the information on the final system design is stored in the dataframes terminals and pipelines returned by the module dhd.load. These dataframes together with the plot interface created with the module dhd.plot are the necessary inputs of this module.

Functions

dhd.features.get_column_statistics(df, key)[source]

Compute the mean and the standard deviation of the data stored in the column key of the dataframe df.

Parameters:
  • df (DataFrame) –
  • key (string) – Key of the column of interest.
Returns:

  • float – Mean of the data.
  • float – Standard deviation of the data.

dhd.features.get_connection_path(pipelines, id1, id2)[source]

Find the path between two terminals and return the selection of the dataframe pipeplines referring to it.

Parameters:
  • pipelines (GeoDataFrame) – Geodataframe of the pipelines.
  • id1 (string) – Index of the first terminal.
  • id2 (string) – Index of the second terminal.
Returns:

Selection of the dataframe pipelines referring to the connection path.

Return type:

GeoDataFrame

dhd.features.get_intersection_number(pipelines, terminals)[source]

Compute the number of intersections in the district heating network.

Parameters:
  • pipelines (DataFrame) – Dataframe of the district heating network.
  • terminals (DataFrame) – Dataframe of the terminals.
Returns:

Number of intersections.

Return type:

int

dhd.features.get_statistics(pipelines, keys=None)[source]

Print the statistics (mean and standard deviation) of the different columns of the dataframe pipelines.

Parameters:
  • pipelines (GeoDataFrame) – Geodataframe of the pipelines.
  • keys (list, optional) – List of the columns statistics to print. If None all the numeric columns are considered. Default is None.
dhd.features.plot_distribution(pipelines, key, bins=20, color='C1')[source]

Plot the distribution of the data of the column key of the dataframe pipelines on a histogram.

Parameters:
  • pipelines (GeoDataFrame) – Geodataframe of the pipelines.
  • key (string) – Key of the column of interest.
  • bins (int, optional) – Number of bars in the histogram. Default is 20.
  • color (string) – Color of the histogram. Default is ‘C1’.
dhd.features.plot_district_heating_network(pipelines, plot, loc='upper center')[source]

Plot the geometries of the district heating network on the plot interface.

Parameters:
  • pipeplines (GeoDataFrame) – Geodataframe of the district heating network.
  • plot (dhd.plot.Plot) – Plot interface of the considered city.
  • loc (tuple, optional) – Location of the legend box. Default is loc = ‘upper center’.
dhd.features.plot_terminals(terminals, plot, indices=None, loc='lower left')[source]

Plot the geometries of the sinks on the plot interface.

The connected sinks are green and the disconnected sinks are red.

Depending on the type of indices all geometries, a series of geometries or only one geometry are plotted.

Parameters:
  • terminals (GeoDataFrame) – Geodataframe of the terminals.
  • plot (dhd.plot.Plot) – Plot interface of the considered city.
  • indices (None or list or string, optional) – Indices of the sinks to plot. It may be a list or only one index. If None all geometries are plotted. Default is None.
  • loc (tuple, optional) – Location of the legend box. Default is loc = ‘lower left’.