Skip to content

THe riversplit node is not supported correctly. #54

Description

@knoxsp

See the conversation from discord below. There is an issue with the riversllit node, which was worked around using a losslink, but we should support all pywr node types.

User — 02/06/2025, 12:47
Hi, everyone! Does anybody know how to use the riversplit? I don't know how to set factors, the log pop out an error :
1 : 1 2025-06-02 10:09:46,325 - CRITICAL - !!Output: An error occurred parsing parameter 'riversplit_1:factors'. Value is '{'type': 'constantparameter', 'values': [0.1, 0.3, 0.6]}'. Error is: 'PywrParameter rule failures' Exiting.

this is my factor and slot_name:
slot_names
{    "type": "constantparameter",
    "values": [
    "riversplit_to_main",
    "riversplit_to_Wuluwati",
    "riversplit_to_Yulongkashi"
]
}

factors 
{    "type": "constantparameter",
    "values": [
    0.1,
    0.3,
    0.6
]
} 
User — 03/06/2025, 02:24
Hi everyone, I set a new attribute at a edge [from_slot], why the pywr_json I export doesn't have the attribute setting? by the way, the log I run my model on app.waterstrategy.org also pop out an error: 
for node1 in self.iter_slots(slot_name=from_slot, is_connector=True):
File /usr/local/lib/python3.10/dist-packages/pywr-1.6.1.dev213+gef0758f-py3.10-linux-x86_64.egg/pywr/nodes.py, line 996, in iter_slots
i = self.slot_names.index(slot_name)
ValueError: None is not in list
Image
Image
jgonzalez18 — 03/06/2025, 09:36
Hi @User , you can not add attributes to an edge. If you explain to me what you want to represent in your model, maybe I can help you with some alternatives. Best!
User — 04/06/2025, 04:31
I need to simulate the water conveyance and infiltration in river channels (eg. 30% water will  infiltration into groundwater), I found the RiverSplit node can split water by factors with slot. But it require "slots_name" of RiverSplit node and "from_slot" of  the edge link upto RiverSplit node.
jgonzalez18 — 05/06/2025, 06:24
Ok, the easiest way to represent infiltration in river channels is using a Losslink node. Please check the screenshot, there you will see how to use it. Let me know if you have any further questions. Best
Image
Stephen Knox — 06/06/2025, 15:07
Hi @User did you manage to get the losss link working?
User — Yesterday at 04:05
@Stephen Knox @jgonzalez18 Yes, loss link node is working. I replaced riversplit node with a output node and to losslink nodes. but then the network is more complicate and not essay to understand. otherwise, I download the "riversplit" version network json file, and add “from_slot” attribute to edge link upto riversplit, it works in my computer. 

so I guess the platform maybe need to improve the function which generate network json file where add attribute to edge

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions