Skip to content
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

DOC:Add examples to integrate.quadpack docstrings #8440

Merged
merged 4 commits into from Feb 19, 2018

Conversation

@samyak0210
Copy link
Contributor

commented Feb 17, 2018

fix #7168

@samyak0210 samyak0210 changed the title DOC:Add examples to integrate.quadpack docstrings #7168 DOC:Add examples to integrate.quadpack docstrings Feb 17, 2018

--------
Calculate :math: double integration exp(-x*y)/y**5
Limits from 0 to inf

This comment has been minimized.

Copy link
@ev-br

ev-br Feb 17, 2018

Member

This integral over y does not converge.
Maybe better write an exact formula in TeX notation.

This comment has been minimized.

Copy link
@samyak0210

samyak0210 Feb 17, 2018

Author Contributor

Can you please elaborate

This comment has been minimized.

Copy link
@ev-br

ev-br Feb 17, 2018

Member

I actually suggest some simpler integral, which can be checked manually. E.g. (not necessarily this specific example):

Compute the moment of inertia of a square square plate with the axis of rotation at the center of the plate (the answer should be $I = m (h^2 + w^2) / 12$):

In [3]: I, err = dblquad(lambda x, y: x**2 + y**2, -1, 1, lambda x: -1, lambda x : 1)

In [4]: m, err = dblquad(lambda x, y: 1, -1, 1, lambda x: -1, lambda x: 1)

In [5]: I/m / (2**2 + 2**2)
Out[5]: 0.08333333333333333

This comment has been minimized.

Copy link
@samyak0210

samyak0210 Feb 19, 2018

Author Contributor

Done

Limits from 0 to inf
>>> from scipy import integrate
>>> from numpy as np

This comment has been minimized.

Copy link
@ev-br

ev-br Feb 17, 2018

Member

This line is implicit in all docstring examples.

This comment has been minimized.

Copy link
@samyak0210

samyak0210 Feb 17, 2018

Author Contributor

I will remove these lines

This comment has been minimized.

Copy link
@ev-br

ev-br Feb 17, 2018

Member

integrate import should be kept, only import numpy as np is implicit.

This comment has been minimized.

Copy link
@samyak0210

samyak0210 Feb 19, 2018

Author Contributor

Done

samyak0210 added 2 commits Feb 18, 2018
@samyak0210

This comment has been minimized.

Copy link
Contributor Author

commented Feb 19, 2018

@ev-br all changes you requested are done can you just review them

Examples
--------
Calculate :math: double integration x*y**2

This comment has been minimized.

Copy link
@ev-br

ev-br Feb 19, 2018

Member

Stray :math: directive, please remove it.

Examples
--------
Calculate :math: double integration x*y**2

This comment has been minimized.

Copy link
@ev-br

ev-br Feb 19, 2018

Member

Please wrap the expression into double backticks so that it renders as code.

This comment has been minimized.

Copy link
@samyak0210

samyak0210 Feb 19, 2018

Author Contributor

so instead of this line I am replacing it with "Returns double integration of x*y**2 "(without double quotes) . Is this correct @ev-br

@samyak0210

This comment has been minimized.

Copy link
Contributor Author

commented Feb 19, 2018

@ev-br all changes were done. Can you review it?

@ev-br ev-br merged commit 1fc6f17 into scipy:master Feb 19, 2018

4 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/project 75.78% (target 1%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ev-br

This comment has been minimized.

Copy link
Member

commented Feb 19, 2018

Thanks @samyak0210.

@ev-br ev-br added this to the 1.1.0 milestone Feb 19, 2018

@WarrenWeckesser

This comment has been minimized.

Copy link
Member

commented Feb 24, 2018

@samyak0210 Thanks for working on the documentation!

One suggestion, for you and for reviewers: please be sure the example code follows PEP 8. In the example added in this pull request, there should be a space after each comma.

adbugger added a commit to adbugger/scipy that referenced this pull request Mar 11, 2018
DOC:Add examples to integrate.quadpack docstrings (scipy#8440)
* DOC:Add examples to integrate.quadpack docstrings
fix scipy#7168

* changes requested are done

* error handled

* changes done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.