MsxNetworkData#

module wntr.msx.model

class MsxNetworkData[source]#

Bases: NetworkDataBase

Network-specific values associated with a multi-species water quality model

Data is copied from dictionaries passed in, so once created, the dictionaries passed are not connected to this object.

Parameters:
  • patterns (dict, optional) – Patterns to use for sources

  • sources (dict, optional) – Sources defined for the model

  • initial_quality (dict, optional) – Initial values for different species at different nodes, links, and the global value

  • parameter_values (dict, optional) – Parameter values for different pipes and tanks

Notes

patterns

Dictionary keyed by pattern name (str) with values being the multipliers (list of float)

sources

Dictionary keyed by species name (str) with values being dictionaries keyed by junction name (str) with values being the dictionary of settings for the source

initial_quality

Dictionary keyed by species name (str) with values being either an InitialQuality object or the appropriate dictionary representation thereof.

parameter_values

Dictionary keyed by parameter name (str) with values being either a ParameterValues object or the appropriate dictionary representation thereof.


__init__(patterns=None, sources=None, initial_quality=None, parameter_values=None)[source]#
add_pattern(name, multipliers)[source]#

Add a water quality model specific pattern.

Parameters:
  • name (str) – Pattern name

  • multipliers (list of float) – Pattern multipliers

init_new_parameter(param)[source]#

(Re)initialize parameter values for a parameter

Parameters:

param (Parameter) – Parameter to be (re)initialized with network data

Returns:

New network data for the specific parameter

Return type:

ParameterValues

init_new_species(species)[source]#

(Re)set the initial quality values for a species

Parameters:

species (Species) – Species to (re)initialized.

Returns:

New initial quality values

Return type:

InitialQuality

remove_parameter(param)[source]#

Remove values associated with a specific parameter

Ignores non-parameters.

Parameters:

param (Parameter or str) – Parameter or parameter name to be removed from the network data

remove_species(species)[source]#

Remove a species from the network specific model

Parameters:

species (Species or str) – Species to be removed from the network data

to_dict()[source]#

Represent the object as a dictionary

property initial_quality: Dict[str, InitialQuality]#

Dictionary of initial quality values, keyed by species name

property parameter_values: Dict[str, ParameterValues]#

Dictionary of parameter values, keyed by parameter name

property patterns#

Dictionary of patterns, specific for the water quality model, keyed by pattern name.

Note

the WaterNetworkModel cannot see these patterns, so names can be reused, so be careful. Likewise, this model cannot see the WaterNetworkModel patterns, so this could be a source of some confusion.

property sources#

Dictionary of sources, keyed by species name