criticalityMaps.mapping package¶
Submodules¶
criticalityMaps.mapping.criticality_map module¶
Created on Wed Aug 7 18:41:45 2019
@author: PHassett
-
criticalityMaps.mapping.criticality_map.make_criticality_map(wn, results_file, output_file=None, pop=None)[source]¶ Make a criticality map from a criticality results file.
- Parameters
wn (wntr waternetwork model) – the wntr waternetwork model of interest
results_file (str/path-like object) – path to the .yml results file from a criticality analysis
output_file (str/path-like) – path and .html file name for map output. Defaults to the path of the results file with ‘.yml’ replaced with ‘_map.html’
pop (dict/Pandas Series, optional) –
population estimate at each node. If None, will use wntr.metrics.population(wn).
Defaults to None
criticalityMaps.mapping.df_map module¶
Created on Mon Sep 9 13:12:07 2019
@author: PHassett
-
class
criticalityMaps.mapping.df_map.wn_dataframe(wn, node_data=None, link_data=None)[source]¶ Bases:
objectA WaterNetwork Dataframe class specifically designed for mapping network components and their attributes
wn: wntr WaterNetworkModel
WaterNetworkModel of interest
- node_data: pandas DataFrame or other object than can be converted to a
DataFrame by pd.DataFrame(node_data)indexed by node id
- link_data: pandas DataFrame or other object than can be converted to a
DataFrame by pd.DataFrame(node_data)indexed by link id
-
make_map(output_file=None, map_columns=[], tooltip_columns=[], geojson_layers={})[source]¶ Make a .html web map of the wn and any data contained in the wn_dataframe
- Parameters
output_file (str/path-like) – path and .html file name for map output. Defaults to the name of the wn .inp file in the working directory.
map_columns (list, optional) –
list of column names in the wn_dataframe to be added as map layers
Defaults to an empty list: [].
tooltip_columns (list, optional) –
list of column names in the wn_dataframe to be added to the informational tooltip that appears when hovering over network components with mouse.
Defaults to an empty list: [].
criticalityMaps.mapping.geojson_handler module¶
Created on Wed Sep 4 08:42:03 2019
@author: PHassett
-
criticalityMaps.mapping.geojson_handler.inp_to_geojson(wn, to_file=True)[source]¶ Write a minimal geojson representation of the Water Network.
- Parameters
wn (wntr WaterNetworkModel object) – The network to be make the geojson from
to_file (Boolean, default=False) – To save the geojson representation as a file in the directory of the inp file
- Returns
wn_geojson – geojson spatial representation of the water network
- Return type
dict in geojson format