Comments (7)
I was able to address the above issue by getting a list for the leaknode and checking if it already exists. However, I am having error. I do not know the cause of this and what I can do to address it.
ndexError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_28132/2498113446.py in
94 wn.remove_node(j)
95 sim = wntr.sim.WNTRSimulator(wn)
---> 96 results = sim.run_sim(solver=wntr.sim.solvers.NewtonSolver, backup_solver=None, solver_options={'MAXITER':3000, 'TOL':0.0003, 'BT_MAXITER':200},
97 backup_solver_options=None, convergence_error=False, HW_approx='default',
98 diagnostics=False)
~\Anaconda3\lib\site-packages\wntr\sim\core.py in run_sim(self, solver, backup_solver, solver_options, backup_solver_options, convergence_error, HW_approx, diagnostics)
1242 results.network_name = self._wn.name
1243
-> 1244 self._initialize_internal_graph()
1245 self._change_tracker.set_reference_point('graph')
1246 self._change_tracker.set_reference_point('model')
~\Anaconda3\lib\site-packages\wntr\sim\core.py in _initialize_internal_graph(self)
1418 self._number_of_connections = [0 for i in range(self._wn.num_nodes)]
1419 for node_id in self._node_id_to_name.keys():
-> 1420 self._number_of_connections[node_id] = self._internal_graph.indptr[node_id+1] - self._internal_graph.indptr[node_id]
1421 self._number_of_connections = np.array(self._number_of_connections, dtype=self._int_dtype)
1422
IndexError: index 255 is out of bounds for axis 0 with size 255
from wntr.
I'm happy to hear that you were able to get a list of leak nodes.
"RuntimeError: Cannot remove node..." indicates that the leak node is associated with a control and cannot be removed until the control is removed. This error is thrown anytime you try to remove an element with a control.
I'm not able to follow the third issue regarding index 255. Please post a complete example with a network from the examples folder.
from wntr.
from wntr.
If you get the control name using wn.control_name_list
, you can remove the control using wn.remove_control("control name")
.
You can also remove the leak from the junction object using junction.remove_leak()
. The junction object stores the control name and calls remove_control
.
from wntr.
from wntr.
from wntr.
Thanks @uthmankareem, Feel free update #342 with updates on using WNTR in Google Collab.
from wntr.
Related Issues (20)
- Questions about optimal scheduling of pumping stations HOT 1
- runnin the program HOT 3
- wntr.network.options has some abnormal annotation contents HOT 1
- Writing an inp file 'self' argument error message HOT 2
- Create a control object or rule object from text input HOT 5
- Get the reactions tab in the inp file from a water network instance HOT 1
- Add PBV support to [VALVES] section
- Generating Interactive leaflet networks HOT 7
- Pipe status problem HOT 4
- AttributeError: 'WaterNetworkModel' object has no attribute 'write_inpfile' HOT 3
- Differences with my epanet from zero model and inp from wntr model HOT 4
- Values in [DEMANDS] section are repetead and others are missing HOT 8
- Unable to remove leaks from network model HOT 3
- Not able to save the network with modified elements as an INP file. HOT 2
- EPANET Error 110 HOT 1
- leaflet map popups HOT 5
- Todini Index Calculation for the Net6 network - Values outside the range [0,1] HOT 5
- Update EPANET binaries for MacOS arm64 HOT 1
- Check deprecation and future warnings, and version compatibility for dependencies
- Pressure Threshold for Resilience indices like Todini and MRI HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wntr.