|
2 | 2 | This module contains a Python wrapper (incl. error handling) for EPANET and EPANET-MSX functions. |
3 | 3 | """ |
4 | 4 | import warnings |
| 5 | +import numpy |
5 | 6 | import epanet |
6 | 7 |
|
7 | 8 |
|
@@ -2006,52 +2007,72 @@ def timetonextevent(self): |
2006 | 2007 | else: |
2007 | 2008 | return self._process_result(epanet.EN_timetonextevent(self._ph)) |
2008 | 2009 |
|
2009 | | - def getnodevalues(self, property: int): |
| 2010 | + def getnodevalues(self, property: int) -> tuple[int, list[float]]: |
2010 | 2011 | """ |
2011 | 2012 | EN_getnodevalues |
2012 | 2013 |
|
2013 | 2014 | Parameters |
2014 | 2015 | ---------- |
2015 | 2016 | property : `int` |
| 2017 | +
|
| 2018 | + Returns |
| 2019 | + ------- |
| 2020 | + `tuple[int, list[float]]` |
| 2021 | + Error code and link values as a list. |
2016 | 2022 | """ |
2017 | 2023 | if self._use_project is False: |
2018 | 2024 | return self._process_result(epanet.ENgetnodevalues(property)) |
2019 | 2025 | else: |
2020 | 2026 | return self._process_result(epanet.EN_getnodevalues(self._ph, property)) |
2021 | 2027 |
|
2022 | | - def getnodevalues_numpy(self, property: int): |
| 2028 | + def getnodevalues_numpy(self, property: int) -> tuple[int, numpy.ndarray]: |
2023 | 2029 | """ |
2024 | 2030 | EN_getnodevalues (NumPy compatible) |
2025 | 2031 |
|
2026 | 2032 | Parameters |
2027 | 2033 | ---------- |
2028 | 2034 | property : `int` |
| 2035 | +
|
| 2036 | + Returns |
| 2037 | + ------- |
| 2038 | + `tuple[int, numpy.ndarray]` |
| 2039 | + Error code and node values as a NumPy array. |
2029 | 2040 | """ |
2030 | 2041 | if self._use_project is False: |
2031 | 2042 | return self._process_result(epanet.ENgetnodevalues_NPY(property)) |
2032 | 2043 | else: |
2033 | 2044 | return self._process_result(epanet.EN_getnodevalues_NPY(self._ph, property)) |
2034 | 2045 |
|
2035 | | - def getlinkvalues(self, property: int): |
| 2046 | + def getlinkvalues(self, property: int) -> tuple[int, list[float]]: |
2036 | 2047 | """ |
2037 | 2048 | EN_getlinkvalues |
2038 | 2049 |
|
2039 | 2050 | Parameters |
2040 | 2051 | ---------- |
2041 | 2052 | property : `int` |
| 2053 | +
|
| 2054 | + Returns |
| 2055 | + ------- |
| 2056 | + `tuple[int, list[float]]` |
| 2057 | + Error code and link values as a list. |
2042 | 2058 | """ |
2043 | 2059 | if self._use_project is False: |
2044 | 2060 | return self._process_result(epanet.ENgetlinkvalues(property)) |
2045 | 2061 | else: |
2046 | 2062 | return self._process_result(epanet.EN_getlinkvalues(self._ph, property)) |
2047 | 2063 |
|
2048 | | - def getlinkvalues_numpy(self, property: int): |
| 2064 | + def getlinkvalues_numpy(self, property: int) -> tuple[int, numpy.ndarray]: |
2049 | 2065 | """ |
2050 | 2066 | EN_getlinkvalues (NumPy compatible) |
2051 | 2067 |
|
2052 | 2068 | Parameters |
2053 | 2069 | ---------- |
2054 | 2070 | property : `int` |
| 2071 | +
|
| 2072 | + Returns |
| 2073 | + ------- |
| 2074 | + `tuple[int, numpy.ndarray]` |
| 2075 | + Error code and link values as a NumPy array. |
2055 | 2076 | """ |
2056 | 2077 | if self._use_project is False: |
2057 | 2078 | return self._process_result(epanet.ENgetlinkvalues_NPY(property)) |
|
0 commit comments