asselapathirana / epanettools

EPANET calling API for python.
Other
16 stars 13 forks source link

How can I query node base demand from EPANET to python? #47

Open faiijew opened 3 years ago

faiijew commented 3 years ago

Hello

I want to know how can I query node base demand from EPANET to python? I have read 'Some advanced result queries' in https://pypi.org/project/EPANETTOOLS/ . It only shows a max flow node id which above 4500 unit flow. But I want list of nodes which base demand above 0 and other results like table in EPANET.

for example image

my codes `#%%1 n=es.network.nodes num=0 for i in n: if Node.value_type['EN_BASEDEMAND']<10: num=num+1 print(num)

No error but it counts all of my nodes and I don't know why..

%%2

NodeID=[n[x].id for x in list(n)] sorted([y.NodeID for x,y in range(0,len(n)) if ((y.results[d])>0 and y.node_type==j)])

TypeError: cannot unpack non-iterable int object`

PLEASE HELP ME ..