-
Notifications
You must be signed in to change notification settings - Fork 156
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
Using integer values in input data Dict leads to an InexactError in compute_ac_pf() #938
Comments
I have not had a chance to check your data in detail, but it looks like the data types in the not working json file are not conforming to the data model assumptions. There are some fields which need to integers (e.g., bus ids) and others which can be integers or floats (e.g., a power demand value). The error seems to indicate that one of the integer fields has been given a float value of |
Yeah the issue is
The But we could potentially fix this in PowerModels. The issue is that: Lines 325 to 328 in 8824212
needs to be gen_assignment[i] = Dict{String,Float64}( # Or Dict{String,Any}
"pg" => gen["pg"],
"qg" => gen["qg"]
) There are many cases where we could do better to ensure the proper type conversion. |
@ccoffrin Just thought that this is perhaps something that should either be explicitly rejected as an input not fulfilling the data type assumptions or that should be automatically converted from int to float! (Esp considering that an int type for |
When trying to compute the ac power flow for my model, it didn't work as I had integer zeroes (0) instead of float zeroes (0.0) in my input dictionary.
Attached is the stacktrace and two very similar cases, where one works and one doesn't. The only difference is the 0/0.0.
Stacktrace:
See attached models as examples:
broken_model.json
working_model.json
The only code used was
parse_file()
andcompute_ac_pf()
.The only difference is that pg in the working models is 0.0, while in the broken model it is 0.
I think think that this should maybe be caught somewhere in
correct_network_data!()
.Also doesn't happen if the model is in mixed units (i assume the 0 gets divided by the unit base, leading to a 0.0).
Thanks for your efforts! Love the project!
The text was updated successfully, but these errors were encountered: