-
Notifications
You must be signed in to change notification settings - Fork 94
Tutorial about expressions #1553
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
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 great! One major comment: should we consider formatting this as a literate tutorial so we make sure it runs? The alternative is to have everything as doctests.
Currently people can't copy-paste the code and have it run.
I have no idea how to make a literate tutorial or doctests, that's the main reason why I started in this way. I saw inhttps://github.com/jump-dev/MathOptInterface.jl/blob/master/docs/src/tutorials/example.md that there are a lot of |
Yeah. These blocks get run on build to check that they reproduce the output. That way you can make sure you don't have typos in the documentation. The alternative is Literate.jl (https://github.com/fredrikekre/Literate.jl) Here's one from JuMP: Here's the modification to make to the |
I've converted the tutorial into doctests. I checked them in the REPL while working on it, I hope the tests will pass… |
@odow Could you please have a look at the current failures? It really looks like different versions of Julia have different outputs regarding types. |
Yeah the docs run in Julia 1.0, which has different printing. A secret is to run this in Julia 1.0 and it will fix everything: MathOptInterface.jl/docs/make.jl Lines 3 to 6 in 6f166a9
|
It now seems to pass :D! |
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.
Looks good. A couple of points.
Returns an iterator for the scalar components of the vector function. | ||
See also [`scalarize`](@ref). |
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.
I'm surprised this worked. I thought it had to be [`Utilities.scalarize`](@ref)
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.
LGTM. Much better than before!
I wished I had this when I started with CP stuff, so here it is :). It's mostly agnostic to #1474, only two sentences would need to be changed.
What is the preferred way of exploring the terms of a function? For now, I've been mostly using the
terms
member; should it be advertised more as a recommended practice?