-
Notifications
You must be signed in to change notification settings - Fork 92
Add LP Base.read! and tests #1713
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
Conversation
Just use my tests here? It includes some annoying files like https://github.com/odow/LPWriter.jl/blob/master/test/model1_tricky.lp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Most of these tests should be applicable:
https://github.com/odow/LPWriter.jl/blob/master/test/reader.jl
@guilhermebodin what's the status of this? Do you want me to merge this as-is? Or are you going to benchmark the performance first? |
Hi @odow, since we already have a working version, I think it is worth benchmarking this solution and compare with a new one without the |
Okay. So I'll hold off merging this then? Or do you want to work on that in a different PR? |
I was not clear in the previous message, let's hold this PR for a couple days. |
I have changed a few definitions using the file generated with this code model = Model()
@variable(model, x[1:1_000] >= 0)
@constraint(model, con[i=1:200], sum(x) >= i)
@objective(model, Min, sum(x))
io = open("test_big.lp", "w")
write(
io,
model;
format= MOI.FileFormats.FORMAT_LP
) The modifications that made the biggest effect were in the function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking better.
There's lots of untested error scenarios. We should add a bunch of malformed LP files to test the error conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an improvement on what we currently have so it's good by me. There are still a few opportunities to improve things (e.g., CacheLPModel
has abstract fields, I don't know about the cost of try-catch
, we could use more tests to improve coverage), but we can do them in separate, smaller PRs.
Just realized there exists a function |
Let's do improvements in a separate PR. This one is already quite big, and the functionality is stand-alone so there's no problem with merging it. |
This implementation is some copy from https://github.com/odow/LPWriter.jl/blob/master/src/reader.jl
There are still a few missing important features.
I will probably implement them next week.
I have some questions regarding the files we use as test sets. Do you have any suggestions?
Closes #1675