tsnet.utils package

Submodules

tsnet.utils.calc_parabola_vertex module

The tsnet.utils.calc_parabola_vertex contains function to calculate the parameters of a parabola based on the coordinated of three points on the curve.

tsnet.utils.calc_parabola_vertex.calc_parabola_vertex(points)[source]

Adapted and modifed to get the unknowns for defining a parabola

Parameters:points (list) – Three points on the pump characteristics curve.

tsnet.utils.memo module

tsnet.utils.memo.decorator(d)[source]

Make function d a decorator: d wraps a function fn.

tsnet.utils.memo.memo(f)[source]

Decorator that caches the return value for each call to f(args). Then when called again with same args, we can just look it up.

tsnet.utils.print_time_delta module

tsnet.utils.print_time_delta.print_time_delta(seconds)[source]

tsnet.utils.valve_curve module

The tsnet.utils.valve_curve contains function to define valve characteristics curve, gate valve by default.

tsnet.utils.valve_curve.valve_curve(s, coeff=None)[source]

Define valve curve

Parameters:
  • s (float) – open percentage
  • valve (str, optional) – [description], by default ‘Gate’
Returns:

k – Friction coefficient with given open percentage

Return type:

float

Module contents

The tsnet.utils package contains helper functions.