Repository navigation
Tutorial about expressions - #1553
Conversation
odow
left a comment
There was a problem hiding this comment.
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! |
|
|
||
| Returns an iterator for the scalar components of the vector function. | ||
|
|
||
| See also [`scalarize`](@ref). |
There was a problem hiding this comment.
I'm surprised this worked. I thought it had to be [`Utilities.scalarize`](@ref)
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
termsmember; should it be advertised more as a recommended practice?