diff --git a/.gitignore b/.gitignore index 643ae47a6..01ebf9a57 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ temp* examples/*.inp wntr/tests/*.png +documentation/_local +documentation/apidoc diff --git a/wntr/epanet/io.py b/wntr/epanet/io.py index 60087d083..696a8e1e9 100644 --- a/wntr/epanet/io.py +++ b/wntr/epanet/io.py @@ -251,7 +251,7 @@ def read(self, inp_files, wn=None): Returns ------- - :class:`~wntr.network.model.WaterNetworkModel` + WaterNetworkModel A water network model object """ @@ -2449,21 +2449,21 @@ class BinFile(object): Parameters ---------- - results_type : list of ResultType, default=None + results_type : list of ResultType, optional This parameter is *only* active when using a subclass of the BinFile that implements - a custom reader or writer. If None, then all results will be saved (node quality, + a custom reader or writer, by default None. If None, then all results will be saved (node quality, demand, link flow, etc.). Otherwise, a list of result types can be passed to limit the memory used. - network : bool, default=False - Save a new WaterNetworkModel from the description in the output binary file. Certain + network : bool, optional + Save a new WaterNetworkModel from the description in the output binary file, by default None. Certain elements may be missing, such as patterns and curves, if this is done. - energy : bool, default=False - Save the pump energy results. - statistics : bool, default=False + energy : bool, optional + Save the pump energy results, by default False. + statistics : bool, optional Save the statistics lines (different from the stats flag in the inp file) that are - automatically calculated regarding hydraulic conditions. - convert_status : bool, default=True - Convert the EPANET link status (8 values) to simpler WNTR status (3 values). By - default, this is done, and the encoded-cause status values are converted simple state + automatically calculated regarding hydraulic conditions, by default False. + convert_status : bool, optional + Convert the EPANET link status (8 values) to simpler WNTR status (3 values), by default True. + When this is done, the encoded-cause status values are converted simple stat values, instead. diff --git a/wntr/epanet/toolkit.py b/wntr/epanet/toolkit.py index 8afbb7578..7e9ef1c9e 100644 --- a/wntr/epanet/toolkit.py +++ b/wntr/epanet/toolkit.py @@ -1,16 +1,6 @@ """ The wntr.epanet.toolkit module is a Python extension for the EPANET Programmers Toolkit DLLs. - -.. rubric:: Contents - -.. autosummary:: - - runepanet - ENepanet - EpanetException - ENgetwarning - """ import ctypes import os diff --git a/wntr/sim/aml/__init__.py b/wntr/sim/aml/__init__.py index 5a21ab6d6..287b3247d 100644 --- a/wntr/sim/aml/__init__.py +++ b/wntr/sim/aml/__init__.py @@ -1,3 +1,5 @@ +"""WNTR's algebraic modeling language module (SWIG).""" + from .expr import Var, Param, exp, log, sin, cos, tan, asin, acos, atan, inequality, sign, abs, value, ConditionalExpression from .aml import Model, ParamDict, VarDict, ConstraintDict, Constraint diff --git a/wntr/sim/aml/aml.py b/wntr/sim/aml/aml.py index 9dd442972..04e2bae60 100644 --- a/wntr/sim/aml/aml.py +++ b/wntr/sim/aml/aml.py @@ -1,3 +1,5 @@ +"""WNTR AML base classes.""" + import sys import scipy from .evaluator import Evaluator diff --git a/wntr/sim/models/__init__.py b/wntr/sim/models/__init__.py index 70ecf6a4a..c38a50956 100644 --- a/wntr/sim/models/__init__.py +++ b/wntr/sim/models/__init__.py @@ -1 +1,3 @@ +"""Elements of the WNTRSimulator model.""" + from wntr.sim.models import constants, param, var, constraint diff --git a/wntr/sim/models/constants.py b/wntr/sim/models/constants.py index a70ae966d..e7fff5d79 100644 --- a/wntr/sim/models/constants.py +++ b/wntr/sim/models/constants.py @@ -1,3 +1,5 @@ +"""Contant values used by WNTRSimulator.""" + import logging from wntr.utils.polynomial_interpolation import cubic_spline diff --git a/wntr/sim/models/constraint.py b/wntr/sim/models/constraint.py index 7ac4edf18..fc9913598 100644 --- a/wntr/sim/models/constraint.py +++ b/wntr/sim/models/constraint.py @@ -1,3 +1,5 @@ +"""Modeling constraints for the WNTRSimulator.""" + import logging from wntr.sim import aml import wntr.network diff --git a/wntr/sim/models/param.py b/wntr/sim/models/param.py index 0a2fd86dd..6aadbac71 100644 --- a/wntr/sim/models/param.py +++ b/wntr/sim/models/param.py @@ -1,3 +1,5 @@ +"""Model parameters for the WNTRSimulator.""" + import logging from wntr.sim import aml from wntr.utils.polynomial_interpolation import cubic_spline diff --git a/wntr/sim/models/utils.py b/wntr/sim/models/utils.py index c9c937582..0aec0489c 100644 --- a/wntr/sim/models/utils.py +++ b/wntr/sim/models/utils.py @@ -1,3 +1,5 @@ +"""Utilities for the WNTRSimulator model.""" + from wntr.utils.ordered_set import OrderedDict, OrderedSet from six import with_metaclass import abc diff --git a/wntr/sim/models/var.py b/wntr/sim/models/var.py index 7413f5ecd..c4b050b36 100644 --- a/wntr/sim/models/var.py +++ b/wntr/sim/models/var.py @@ -1,3 +1,5 @@ +"""Functions to add variables to the WNTRSimulator model.""" + import logging from wntr.sim import aml diff --git a/wntr/sim/network_isolation/__init__.py b/wntr/sim/network_isolation/__init__.py index 2e54f0019..159f0652a 100644 --- a/wntr/sim/network_isolation/__init__.py +++ b/wntr/sim/network_isolation/__init__.py @@ -1 +1,3 @@ +"""The network isolation package (SWIG).""" + from wntr.sim.network_isolation.network_isolation import check_for_isolated_junctions, get_long_size diff --git a/wntr/utils/doc_inheritor.py b/wntr/utils/doc_inheritor.py index b2a088b0f..372fea7f3 100644 --- a/wntr/utils/doc_inheritor.py +++ b/wntr/utils/doc_inheritor.py @@ -1,3 +1,5 @@ +"""Utilitiy for inheriting docstrings.""" + import inspect diff --git a/wntr/utils/logger.py b/wntr/utils/logger.py index afc2066f5..c81a338eb 100644 --- a/wntr/utils/logger.py +++ b/wntr/utils/logger.py @@ -1,3 +1,5 @@ +"""Fuctions to set up a default handler for WNTR that will output to the console and to wntr.log.""" + import logging logging.getLogger('wntr').addHandler(logging.NullHandler()) diff --git a/wntr/utils/ordered_set.py b/wntr/utils/ordered_set.py index 35da772a5..80079438d 100644 --- a/wntr/utils/ordered_set.py +++ b/wntr/utils/ordered_set.py @@ -1,3 +1,5 @@ +"""An ordered set implementation (like an ordered dict).""" + import sys from collections.abc import MutableSet from collections import OrderedDict diff --git a/wntr/utils/polynomial_interpolation.py b/wntr/utils/polynomial_interpolation.py index 1cf17e0a6..d78573cab 100644 --- a/wntr/utils/polynomial_interpolation.py +++ b/wntr/utils/polynomial_interpolation.py @@ -1,3 +1,5 @@ +"""Functions for a polynomial interpolation using cubic spline.""" + def cubic_spline(x1, x2, f1, f2, df1, df2): """ Method to compute the coefficients of a smoothing polynomial.