DOC: update optimize tutorial #152

Merged
merged 5 commits into from Feb 13, 2012

Projects

None yet

5 participants

@dlax
SciPy member

No description provided.

Denis Laxalde added some commits Feb 6, 2012
@dlax
SciPy member

Also, I had to do fix the path of plot examples in the stats tutorial in order to build the doc on my system. See dlaxalde/scipy@bfd94f6. If this is confirmed I can add this to this branch.

@rgommers
SciPy member

Those plots show up here: http://docs.scipy.org/doc/scipy/reference/tutorial/stats.html, and the original code looks correct to me. How did you build the docs, and what error message did you get?

@pv
SciPy member
pv commented Feb 8, 2012

The problem is that matplotlib's plot directive handles relative paths differently than the one in Scipy. I'd fix them like this .. plot:: /tutorial/examples/... provided it happens to work. (The slash in the front is standard Sphinx notation for absolute paths relative to project directory, so if it works for the plot directive, then best use it.)

EDIT: Bummer, that won't probably work. Then it's best to use what works on the build machine.

@josef-pkt
SciPy member

I think when I added the plots I just looked at the other paths to examples, for example

.. literalinclude:: examples/4-1 in integrate.rst

(It worked at the time I wrote the tutorial.)

@dlax
SciPy member
  • I build the doc using make html from the doc directory, Sphinx version is 1.1.2.
  • I get an IOError saying that doc/source/examples/normdiscr_plot1.py does not exist.

Am I the only one experiencing this?

@rgommers
SciPy member

I have no problem with the current version with Sphinx 1.0.4 or 1.0.7. On the server hosting the docs it works too.

@dlax
SciPy member
@rgommers
SciPy member

Best to report the bug in the Sphinx tracker then I'd think. I'm sticking to 1.0.4 for the release as long as I can, Sphinx is way too fragile to start changing versions for no reason.

@WarrenWeckesser

Am I the only one experiencing this?

I'm using sphinx 1.1.2, and I also have a problem with the plots in the stats tutorial. I've been editing the file locally before building the docs. Dealing with it properly (and dealing with the many warnings that occur when building the docs) has been on my "to do" list for a while--but never quite at the top of the list.

@WarrenWeckesser

diagonal[0] is wrong (see http://projects.scipy.org/scipy/ticket/1248) ; this should be:

diagonal[0] = 1200*x[0]**2 - 400*x[1] + 2

Not your mistake, but perhaps you can fix this along with the rest of your changes.

@WarrenWeckesser

rosen, rosen_der, rosen_hess and rosen_hess_product are already defined in scipy.optimize. What do you think of simply importing these as needed instread of including their implementations in the tutorial?

@dlax
SciPy member
@rgommers
SciPy member

I think leaving them in is fine, because very few readers will be familiar with the Rosenbrock function.

@WarrenWeckesser

OK, I'm fine with leaving them in as examples of how to implement a jacobian and hessian. Perhaps a brief note about it would be helpful, e.g. something like "The Rosenbrock function and its derivatives are included in scipy.optimize. The implementations shown here provide examples of how to define the jacobian and hessian functions."

@dlax
SciPy member
@dlax dlax pushed a commit that referenced this pull request Feb 13, 2012
Denis Laxalde DOC: update optimize tutorial
Merge pull request #152 from dlaxalde:doc/optimize/tutorial
  DOC: mention that Rosenbrock function is implemented in optimize
  DOC: fix rosen_hess definition in optimize tutorial
  DOC: use minimize in SLSQP tutorial and simplify it
  DOC: use minimize in unconstrained minimization tutorial
  DOC: review introduction list in optimize tutorial
24a3532
@dlax dlax merged commit 3dfee27 into scipy:master Feb 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment