Add `scipy.optimize.Result` to API docs #3010

Merged
merged 2 commits into from Nov 9, 2013

Conversation

Projects
None yet
6 participants
@cdeil
Contributor

cdeil commented Oct 22, 2013

The return value of scipy.optimize.minimize is a scipy.optimize.Result object as described here:
http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.optimize.minimize.html

But scipy.optimize.Result is currently missing from the scipy API docs.
I guess all that is needed is to list it in the docstring here?
https://github.com/scipy/scipy/blob/master/scipy/optimize/__init__.py
But I wasn't sure where to put it ... a new section at the end?

@pv

This comment has been minimized.

Show comment Hide comment
@pv

pv Oct 20, 2013

Member

I'd perhaps put it somewhere quite up, maybe immediately after minimize, or to a separate autosummary list after the first one.

The optimize module docstring is IMHO quite confusing overall and would be useful to restructure.

Member

pv commented Oct 20, 2013

I'd perhaps put it somewhere quite up, maybe immediately after minimize, or to a separate autosummary list after the first one.

The optimize module docstring is IMHO quite confusing overall and would be useful to restructure.

@cdeil

This comment has been minimized.

Show comment Hide comment
@cdeil

cdeil Oct 22, 2013

Contributor

I tried just listing the Result class in the docstring in optimize/__init__.py (see commit 97d5315).
This doesn't work.

@pv You mentioned that an overall restructure of the optimize docstring might be good ... can you do it?

Apart from that I tried went through the optimize tutorial and put a few (hopefully) improvements into 6c07eaa .
The main change is fixing some examples where keyword argument names have changed.

Contributor

cdeil commented Oct 22, 2013

I tried just listing the Result class in the docstring in optimize/__init__.py (see commit 97d5315).
This doesn't work.

@pv You mentioned that an overall restructure of the optimize docstring might be good ... can you do it?

Apart from that I tried went through the optimize tutorial and put a few (hopefully) improvements into 6c07eaa .
The main change is fixing some examples where keyword argument names have changed.

@coveralls

This comment has been minimized.

Show comment Hide comment
@coveralls

coveralls Oct 22, 2013

Coverage Status

Coverage remained the same when pulling 97d5315 on cdeil:optimize_docs into ba387ba on scipy:master.

Coverage Status

Coverage remained the same when pulling 97d5315 on cdeil:optimize_docs into ba387ba on scipy:master.

pv added a commit that referenced this pull request Nov 9, 2013

Merge pull request #3010 from cdeil/optimize_docs
DOC: optimize: add Result to API docs + fix tutorial

@pv pv merged commit fb0451d into scipy:master Nov 9, 2013

1 check passed

default The Travis CI build passed
Details
@pv

This comment has been minimized.

Show comment Hide comment
@pv

pv Nov 9, 2013

Member

Thanks, looks good. The restructuring can be done later on.

Member

pv commented Nov 9, 2013

Thanks, looks good. The restructuring can be done later on.

@cdeil

This comment has been minimized.

Show comment Hide comment
@cdeil

cdeil Nov 9, 2013

Contributor

@pv Result still doesn't appear in the API docs. I wasn't able to figure out a way to include it (see comment above).
Do you know how to do it or should I open a new issue?

Contributor

cdeil commented Nov 9, 2013

@pv Result still doesn't appear in the API docs. I wasn't able to figure out a way to include it (see comment above).
Do you know how to do it or should I open a new issue?

@rgommers

This comment has been minimized.

Show comment Hide comment
@rgommers

rgommers Nov 9, 2013

Member

Result should be added to __all__ in optimize/_minimize.py, then it'll appear.

Member

rgommers commented Nov 9, 2013

Result should be added to __all__ in optimize/_minimize.py, then it'll appear.

@pv

This comment has been minimized.

Show comment Hide comment
@pv

pv Nov 9, 2013

Member

Fixed in 8594f29

Member

pv commented Nov 9, 2013

Fixed in 8594f29

@cdeil

This comment has been minimized.

Show comment Hide comment
@cdeil

cdeil Nov 9, 2013

Contributor

Result still doesn't show up at http://docs.scipy.org/doc/scipy-dev/reference/optimize.html .
@pv In 8594f29 you added Result to __all__ in optimize.py, @rgommers said it should be added to __all__ in _minimize.py, maybe that's why?

Contributor

cdeil commented Nov 9, 2013

Result still doesn't show up at http://docs.scipy.org/doc/scipy-dev/reference/optimize.html .
@pv In 8594f29 you added Result to __all__ in optimize.py, @rgommers said it should be added to __all__ in _minimize.py, maybe that's why?

@pv

This comment has been minimized.

Show comment Hide comment
@pv

pv Nov 9, 2013

Member

The docs.scipy.org pages are updated only daily, not immediately.

Member

pv commented Nov 9, 2013

The docs.scipy.org pages are updated only daily, not immediately.

@rgommers

This comment has been minimized.

Show comment Hide comment
@rgommers

rgommers Nov 9, 2013

Member

Since Result wasn't public before, it can be renamed I think. The name is way too generic imho. MinimizeResult?

Member

rgommers commented Nov 9, 2013

Since Result wasn't public before, it can be renamed I think. The name is way too generic imho. MinimizeResult?

@cdeil

This comment has been minimized.

Show comment Hide comment
@cdeil

cdeil Nov 10, 2013

Contributor

OK. It's in the docs now. Thanks!

+1 to changing to the more specific name of MinimizeResult.

Contributor

cdeil commented Nov 10, 2013

OK. It's in the docs now. Thanks!

+1 to changing to the more specific name of MinimizeResult.

@pv

This comment has been minimized.

Show comment Hide comment
@pv

pv Nov 10, 2013

Member

Yes, it's probably too generic, so +1 for rename

Member

pv commented Nov 10, 2013

Yes, it's probably too generic, so +1 for rename

@dlax

This comment has been minimized.

Show comment Hide comment
@dlax

dlax Nov 10, 2013

Member

Ralf Gommers a écrit :

Since |Result| wasn't public before, it can be renamed I think. The name
is way too generic imho. |MinimizeResult|?

It's used in root() as well, so something like OptimizeResult may be better.

Member

dlax commented Nov 10, 2013

Ralf Gommers a écrit :

Since |Result| wasn't public before, it can be renamed I think. The name
is way too generic imho. |MinimizeResult|?

It's used in root() as well, so something like OptimizeResult may be better.

@argriffing

This comment has been minimized.

Show comment Hide comment
@argriffing

argriffing Nov 10, 2013

Contributor

If we have namespaces then what about optimize.Result? Not that it really matters to me.

Contributor

argriffing commented Nov 10, 2013

If we have namespaces then what about optimize.Result? Not that it really matters to me.

rgommers added a commit to rgommers/scipy that referenced this pull request Dec 17, 2013

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