Skip to content

Commit fe10e07

Browse files
committed
Add tests for NumPy compatible EPANET functions
1 parent ada1aa8 commit fe10e07

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_epyt.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
This module tests the toolkit functions implemented in the clas EPyT.
33
"""
44
import os
5+
import numpy as np
56
from epanet_plus import EPyT, EpanetConstants
67

78

@@ -88,7 +89,10 @@ def __test_code(epanet_api: EPyT):
8889
assert len(epanet_api.getnodevalues(EpanetConstants.EN_PRESSURE)) > 0
8990
assert len(epanet_api.getlinkvalues(EpanetConstants.EN_FLOW)) > 0
9091
assert len(epanet_api.getnodevalues(EpanetConstants.EN_QUALITY)) > 0
91-
assert len(epanet_api.getlinkvalues(EpanetConstants.EN_QUALITY)) > 0
92+
assert len(epanet_api.getlinkvalues(EpanetConstants.EN_QUALITY)) > 0
93+
94+
assert np.all(epanet_api.getnodevalues_numpy(EpanetConstants.EN_QUALITY) == np.array(epanet_api.getnodevalues(EpanetConstants.EN_QUALITY))) == True
95+
assert np.all(epanet_api.getlinkvalues_numpy(EpanetConstants.EN_QUALITY) == np.array(epanet_api.getlinkvalues(EpanetConstants.EN_QUALITY))) == True
9296

9397
tstep = epanet_api.nextH()
9498
epanet_api.nextQ()

0 commit comments

Comments
 (0)