-
Notifications
You must be signed in to change notification settings - Fork 90
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
uniqueness of names #548
Comments
To clarify, when you say "lookup names", you are talking about string based lookups, correct? In my software the variable refrence is what I will always use as the unique variable id. Questions:
|
Yes, I mean lookup by string. More precisely, given a string, return the corresponding
Correct. The
MOF or LP or MPS writers will have to generate unique names (this is already the case because we allow blank names). So the mapping from MOI model to the file formats won't be 1-1. OTOH, if you read an MOF/LP/MPS file into an MOI model you'll be able to look up the variables in the model using their names in the file. |
I think we should encourage authors of JuMP extensions/submodels/etc to use anonymous variables with a meaningful print name, and provide an external way of accessing the variables if required. For example, they can bundle the references into the JuMP extension dictionary with |
Based on clarifications, I think this is a good solution. The semantics are nearly the same as JuMP v0.18, which has been working quite well for our group thus far. @odow, that is basically the convention that we are currently using. |
Throw an error only when looking up a string that corresponds to multiple variables. Closes #548 Closes jump-dev/JuMP.jl#1292
I think the alternative works. For reference, this will create the following use cases:
|
* Allow duplicate variable names Throw an error only when looking up a string that corresponds to multiple variables. Closes #548 Closes jump-dev/JuMP.jl#1292 * more test coverage * share build_name_to_con_map
On the call yesterday we discussed the issue about names for display purposes being different than names that one would want to use as unique lookup keys. I proposed allowing two different names per variable/constraint, a lookup name and a display name. Thinking about it more, this seems too complicated.
New proposal: We allow variables to have arbitrary non-unique names. On lookup, if there are two variables with the same name, we throw an error. That's all.
Pros:
Cons:
@ccoffrin @jd-lara @IainNZ
jump-dev/JuMP.jl#1292
The text was updated successfully, but these errors were encountered: