Curve#
module wntr.network.elements
- class Curve[source]#
Bases:
object
Curve base class.
Constructor
This class is intended to be instantiated through the
add_curve
method.- Parameters:
name (str) – Name of the curve.
curve_type (str) – The type of curve: None (unspecified), HEAD, HEADLOSS, VOLUME or EFFICIENCY
points (list) – The points in the curve. List of 2-tuples (x,y) ordered by increasing x
original_units (str) – The units the points were defined in
current_units (str) – The units the points are currently defined in. This MUST be ‘SI’ by the time one of the simulators is run.
options (Options, optional) – Water network options to lookup headloss function
- __init__(name, curve_type=None, points=[], original_units=None, current_units='SI', options=None)[source]#
- set_units(original=None, current=None)[source]#
Set the units flags for the curve.
Use this after converting the points, if necessary, to indicate that conversion to SI units is complete.
- property current_units#
The current units that the points are in
- property curve_type#
None (unspecified), HEAD, HEADLOSS, VOLUME or EFFICIENCY
- Type:
The type of curve
- property name#
Curve names must be unique among curves
- property num_points#
Returns the number of points in the curve.
- property original_units#
The original units the points were written in.
- property points#
The points in the curve. List of 2-tuples (x,y) ordered by increasing x