-
Notifications
You must be signed in to change notification settings - Fork 5
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
Priority parameter should be non-optional #1732
Comments
Priority paramneter is only required when use_allocation=true. If you do not use allocation, the priority parameter can be optional. |
Thanks @gijsber . In this case the documentation should be updated since it gave not only me but also other user and developer some confusion. However, if I run models with allocation active and user demand node without specifying priority, the model can still be run. This is the same situation even for the models with main network. This should still be looked into. |
if you have a model with allocation active and user demand node without specifying priority, you should get a validation error |
I agree with you @gijsber . An error should be given in this case. What worried me is that the model can still run even though the mode has such error. This mean that in the current implementation, priority parameter is not needed. We should change the implementation into one that actually make use of the priority, then give an error if priority is missing. |
A finding on this issue. When reading the demand nodes into geodata based, a column "priority" is created and all the values inside this column are initialized as 0. Therefore, even if no priority parameter are given to the demand nodes, the model can still run. The nodes would have priorities of 0. To avoid that, I wrote a validation function for all the demand nodes. If allocation is active, priorities is a mandatory field. If priority is given but allocation is not active, a warning message will be display but the program will still run |
We don't have warning messages thus far, because @visr is not a fan of them. I think the priorities not being used when allocation is not active does belong in the documentation but does not need the warning message. Note that the priority is mandatory in the core: Lines 278 to 294 in 98df891
The default value of Ribasim/python/ribasim/ribasim/schemas.py Lines 246 to 261 in 98df891
Not sure how that ends up in that automatically generated file, maybe it's standard for Currently priorities < 1 are accepted in the core. That's quite a handy design, because then you don't have to shift all other priorities if you want to add a new most important priority level. A downside of this is that the default I think the best way to solve this is as follows:
|
It is easier to do validation with the default value. I suggest that we keep it for now. |
What
Recently in solving issue #1724 , it has come to me that even thought the priority of user demand is not given, the whole program can still be run.
As this is not a desire behavior, investigation into the reason is needed.
The text was updated successfully, but these errors were encountered: