-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit elements id #224
Comments
So you are correct - this is not implemented. The main reason is because there are multiple places where a name might need to be changed, thus disconnecting things and breaking the simulation. However, we can look into making it so this can happen. |
@GalPerelman I did find the issue. I will need to make a function to perform a rename for nodes and links. The registries for nodes, links, patterns and sources, all use the name of the originally created junction/link/etc. as a key index. That is what gets looped over when you call (for node in wn.node_names), for example. So even though the internal name is changed, you can't actually find that new name in the registry, and it pulls out the old name. But for links, it's getting the internal name for the end nodes. So I will go in and make that change, though it may be a few days for a PR to go all the way up. |
@dbhart Thanks for your response and the suggested solution, it seems that this will do the work for my needs |
Is it still not possible to update the names of pipes, nodes, valves, etc? I think this is a really important feature of a Python Package that manipulates INP models. It is not uncommon the need to rename network elements, which can easily scale up to thousands of elements that need to be renamed. Thank you! |
Is it possible to change the name attribute of junctions and pipes?
For example, if I want to change junctions id that contains 'NN' to 'J'
When using the following code, the output inp file will change the junction names in the PIPES section but not in the JUNCTIONS section. (COORDINATES section is also not changed)
When trying to use
junction.name
instead ofjunction._name
AttributeError is raisedAttributeError: can't set attribute
The text was updated successfully, but these errors were encountered: