PyTuflow: Difference between revisions

Content deleted Content added
No edit summary
Line 16:
</pre>
 
'''==Methods'''==
{|class="wikitable" style="text-align: left;"
|! style="background-color:#005581; font-weight:bold; color:white" width=30%| Method
Line 189:
|-
|}
 
==channelConnectionCount==
 
<b>channelConnectionCount (</b> Node ID <b>)</b><br>
Returns the number of channels connected to a given node<br>
;Parameters:
: '''Node ID:''' ''str''
:: Name or ID of node e.g. 'Chan_A.1'
;Returns:
: '''Count:''' ''int''
:: Number of connected channels
'''Examples'''
<pre>
import pytuflow as tu
 
# Initialise result class
res = tu.ResData()
 
# load .tpc result file
path = r'C:\TUFLOW\results\M04_5m_001.tpc'
err, message = res.load(path)
 
# check results were loaded successfully
if not err:
node = 'Chan_A.1'
conn_count = res.channelConnectionCount(node)
# print to console
print('{0} number of channels connected to node {1}'.format(conn_count, node))
else:
# did not load correctly, print message
print(message)
</pre>