Skip to content
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

can we please get rid of the isascii assertion on variables? #233

Closed
ExpandingMan opened this issue Aug 26, 2019 · 5 comments · Fixed by #237
Closed

can we please get rid of the isascii assertion on variables? #233

ExpandingMan opened this issue Aug 26, 2019 · 5 comments · Fixed by #237

Comments

@ExpandingMan
Copy link
Contributor

I'm assuming the reason for this is that Gurobi only officially supports setting variable names to ASCII, but in Julia, where unicode is ubiquitous this is incredibly annoying, and clearly most things work perfectly fine even if you use non-ascii strings.

Could we simply delete the assertions in get_attrs.jl?

@odow
Copy link
Member

odow commented Aug 26, 2019

Do you mean
https://github.com/JuliaOpt/Gurobi.jl/blob/ffdc849eab5782a22803c06c2e6bb22ffebe0242/src/grb_attrs.jl#L243
and
https://github.com/JuliaOpt/Gurobi.jl/blob/ffdc849eab5782a22803c06c2e6bb22ffebe0242/src/grb_attrs.jl#L254

clearly most things work perfectly fine even if you use non-ascii strings.

Do you have examples? Does Gurobi throw an error? If so, what? Can you round-trip unicode strings?

@ExpandingMan
Copy link
Contributor Author

ExpandingMan commented Aug 26, 2019

Yes, those are what I mean. I know that Gurobi itself does not throw an error, because I've been using unicode strings since the beginning and never had a problem. I haven't explicitly tried to round trip the strings, but it must work because there is never a problem in retrieving the variables.

In the case of variables it's possible to investigate this with, for example, @variable(m, α)

@odow
Copy link
Member

odow commented Aug 26, 2019

We could accept a PR with tests showing that it works okay doesn't cause a terrible error.

@odow
Copy link
Member

odow commented Aug 26, 2019

because I've been using unicode strings since the beginning and never had a problem

One difference is that now we push the strings through to the solver, whereas JuMP used to cache them at the Julia level and the solver never knew what they were named.

@ExpandingMan
Copy link
Contributor Author

Ah, ok I didn't realize there was an actual difference. I'm going to try it and see if it works.

I'd really hate to have to use all ASCII variable names for Gurobi all the time, so if it doesn't work I'll start looking into work arounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants