From 3bd529364f133b7b53bf00138c0acce9eb2d011e Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Fri, 21 Feb 2020 14:34:48 +0100 Subject: [PATCH] 29231: add intersphinx mapping for scipy --- src/doc/en/reference/matrices/index.rst | 2 +- src/sage/calculus/desolvers.py | 11 ++++---- src/sage/docs/conf.py | 4 ++- .../differentiable/integrated_curve.py | 14 +++++----- src/sage/matrix/matrix_double_dense.pyx | 28 ++++++++++--------- src/sage/matroids/matroids_plot_helpers.py | 5 ++-- src/sage/modules/vector_double_dense.pyx | 4 +-- src/sage/numerical/optimize.py | 16 +++++------ 8 files changed, 44 insertions(+), 40 deletions(-) diff --git a/src/doc/en/reference/matrices/index.rst b/src/doc/en/reference/matrices/index.rst index 6dc2a83a821..236e2e5f889 100644 --- a/src/doc/en/reference/matrices/index.rst +++ b/src/doc/en/reference/matrices/index.rst @@ -29,7 +29,7 @@ following additional ways to compute with matrices: - The GSL C-library is included with Sage, and can be used via Cython. -- The ``scipy`` module provides support for +- The :mod:`scipy:scipy` module provides support for *sparse* numerical linear algebra, among many other things. - The ``numpy`` module, which you load by typing diff --git a/src/sage/calculus/desolvers.py b/src/sage/calculus/desolvers.py index 6bd78d2524a..9d7c7dea87a 100644 --- a/src/sage/calculus/desolvers.py +++ b/src/sage/calculus/desolvers.py @@ -27,8 +27,8 @@ order equations, return list of points. - :func:`desolve_odeint` - Solve numerically a system of first-order ordinary - differential equations using ``odeint`` from `scipy.integrate module. - `_ + differential equations using :func:`~scipy:scipy.integrate.odeint` from + the module :mod:`scipy:scipy.integrate`. - :func:`desolve_system` - Solve a system of 1st order ODEs of any size using Maxima. Initial conditions are optional. @@ -1512,7 +1512,7 @@ def desolve_odeint(des, ics, times, dvars, ivar=None, compute_jac=False, args=() , mxstep=0, mxhnil=0, mxordn=12, mxords=5, printmessg=0): r""" Solve numerically a system of first-order ordinary differential equations - using ``odeint`` from scipy.integrate module. + using :func:`scipy:scipy.integrate.odeint`. INPUT: @@ -1530,8 +1530,9 @@ def desolve_odeint(des, ics, times, dvars, ivar=None, compute_jac=False, args=() - ``compute_jac`` -- boolean. If True, the Jacobian of des is computed and used during the integration of Stiff Systems. Default value is False. - Other Parameters (taken from the documentation of odeint function from `scipy.integrate module. - `_) + Other Parameters (taken from the documentation of the + :func:`~scipy:scipy.integrate.odeint` function from + :mod:`scipy:scipy.integrate`): - ``rtol``, ``atol`` : float The input parameters ``rtol`` and ``atol`` determine the error diff --git a/src/sage/docs/conf.py b/src/sage/docs/conf.py index 23cf5d67922..2c2d5ce148d 100644 --- a/src/sage/docs/conf.py +++ b/src/sage/docs/conf.py @@ -173,7 +173,8 @@ def sphinx_plot(graphics, **kwds): 'python': ('https://docs.python.org/', os.path.join(SAGE_DOC_SRC, "common", "python{}.inv".format(python_version))), - 'pplpy': (PPLPY_DOCS, None)} + 'pplpy': (PPLPY_DOCS, None), + 'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None)} def set_intersphinx_mappings(app): """ @@ -852,6 +853,7 @@ def setup(app): if app.srcdir.startswith(SAGE_DOC_SRC): app.add_config_value('intersphinx_mapping', {}, False) app.add_config_value('intersphinx_cache_limit', 5, False) + app.add_config_value('intersphinx_timeout', None, False) # We do *not* fully initialize intersphinx since we call it by hand # in find_sage_dangling_links. # app.connect('missing-reference', missing_reference) diff --git a/src/sage/manifolds/differentiable/integrated_curve.py b/src/sage/manifolds/differentiable/integrated_curve.py index 2b6d75e061d..fcf274e4891 100644 --- a/src/sage/manifolds/differentiable/integrated_curve.py +++ b/src/sage/manifolds/differentiable/integrated_curve.py @@ -945,7 +945,7 @@ def solve(self, step=None, method='odeint', solution_key=None, use for the integration of the curve; available algorithms are: * ``'odeint'`` - makes use of - `scipy.integrate.odeint `_ + :func:`scipy:scipy.integrate.odeint` via Sage solver :func:`~sage.calculus.desolvers.desolve_odeint`; ``odeint`` invokes the LSODA algorithm of the @@ -957,9 +957,9 @@ def solve(self, step=None, method='odeint', solution_key=None, makes use of Maxima's dynamics package via Sage solver :func:`~sage.calculus.desolvers.desolve_system_rk4` (quite slow) * ``'dopri5'`` - Dormand-Prince Runge-Kutta of order (4)5 provided by - `scipy.integrate.ode `_ + :obj:`scipy:scipy.integrate.ode` * ``'dop853'`` - Dormand-Prince Runge-Kutta of order 8(5,3) provided by - `scipy.integrate.ode `_ + :obj:`scipy:scipy.integrate.ode` and those provided by ``GSL`` via Sage class :class:`~sage.calculus.ode.ode_solver`: @@ -1423,8 +1423,8 @@ def solve_across_charts(self, charts=None, step=None, solution_key=None, Integrate the curve numerically over the domain of integration, with the ability to switch chart mid-integration. - The only supported solver is - `scipy.integrate.ode `_, because it supports basic event handling, needed to detect when the + The only supported solver is :obj:`scipy:scipy.integrate.ode`, + because it supports basic event handling, needed to detect when the curve is reaching the frontier of the chart. This is an adaptive step solver. So the ``step`` is not the step of integration but instead the step used to peak at the current chart, and switch if needed. @@ -1527,8 +1527,8 @@ def solve_across_charts(self, charts=None, step=None, solution_key=None, The integration is done as usual, but using the method :meth:`solve_across_charts` instead of :meth:`solve`. This forces the - use of ``scipy.integrate.ode`` as the solver, because of event handling - support. + use of :obj:`scipy:scipy.integrate.ode` as the solver, because of event + handling support. The argument ``verbose=True`` will cause the solver to write a small message each time it is switching chart:: diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx index 99c100bbd9c..b38a69659ac 100644 --- a/src/sage/matrix/matrix_double_dense.pyx +++ b/src/sage/matrix/matrix_double_dense.pyx @@ -747,8 +747,8 @@ cdef class Matrix_double_dense(Matrix_dense): ALGORITHM: - Computation is performed by the ``norm()`` function of - the SciPy/NumPy library. + Computation is performed by the :func:`~scipy:scipy.linalg.norm` + function of the SciPy/NumPy library. EXAMPLES: @@ -891,7 +891,7 @@ cdef class Matrix_double_dense(Matrix_dense): ALGORITHM: The singular values come from the SVD decomposition - computed by SciPy/NumPy. + computed by SciPy/NumPy using :func:`scipy:scipy.linalg.svd`. EXAMPLES: @@ -1216,7 +1216,7 @@ cdef class Matrix_double_dense(Matrix_dense): - ``'default'`` - applicable to any matrix with double-precision floating point entries. - Uses the :meth:`~scipy.linalg.eigvals` method from SciPy. + Uses the :func:`~scipy:scipy.linalg.eigvals` function from SciPy. - ``'symmetric'`` - converts the matrix into a real matrix (i.e. with entries from :class:`~sage.rings.real_double.RDF`), @@ -1224,9 +1224,9 @@ cdef class Matrix_double_dense(Matrix_dense): algorithm can be significantly faster than the ``'default'`` algorithm. - - ``'hermitian'`` - uses the :meth:`~scipy.linalg.eigh` method - from SciPy, which applies only to real symmetric or complex - Hermitian matrices. Since Hermitian is defined as a matrix + - ``'hermitian'`` - uses the :func:`~scipy:scipy.linalg.eigh` + function from SciPy, which applies only to real symmetric or + complex Hermitian matrices. Since Hermitian is defined as a matrix equaling its conjugate-transpose, for a matrix with real entries this property is equivalent to being symmetric. This algorithm can be significantly faster than the @@ -1459,7 +1459,8 @@ cdef class Matrix_double_dense(Matrix_dense): Returns a list of triples, each of the form ``(e,[v],1)``, where ``e`` is the eigenvalue, and ``v`` is an associated left eigenvector. If the matrix is of size `n`, then there are - `n` triples. Values are computed with the SciPy library. + `n` triples. Values are computed with the SciPy library + using :func:`scipy:scipy.linalg.eig`. The format of this output is designed to match the format for exact results. However, since matrices here have numerical @@ -1544,7 +1545,8 @@ cdef class Matrix_double_dense(Matrix_dense): Returns a list of triples, each of the form ``(e,[v],1)``, where ``e`` is the eigenvalue, and ``v`` is an associated right eigenvector. If the matrix is of size `n`, then there - are `n` triples. Values are computed with the SciPy library. + are `n` triples. Values are computed with the SciPy library + using :func:`scipy:scipy.linalg.eig`. The format of this output is designed to match the format for exact results. However, since matrices here have numerical @@ -1637,7 +1639,7 @@ cdef class Matrix_double_dense(Matrix_dense): ALGORITHM: - Uses the ``solve()`` routine from the SciPy ``scipy.linalg`` module. + Uses the function :func:`scipy:scipy.linalg.solve` from SciPy. EXAMPLES: @@ -1776,7 +1778,7 @@ cdef class Matrix_double_dense(Matrix_dense): ALGORITHM: - Uses the ``solve()`` routine from the SciPy ``scipy.linalg`` module, + Uses the function :func:`scipy:scipy.linalg.solve` from SciPy, after taking the transpose of the coefficient matrix. EXAMPLES: @@ -1904,7 +1906,7 @@ cdef class Matrix_double_dense(Matrix_dense): ALGORITHM: - Use numpy + Uses :func:`scipy:scipy.linalg.det`. EXAMPLES:: @@ -2194,7 +2196,7 @@ cdef class Matrix_double_dense(Matrix_dense): ALGORITHM: - Calls "linalg.qr" from SciPy, which is in turn an + Calls :func:`scipy:scipy.linalg.qr` from SciPy, which is in turn an interface to LAPACK routines. EXAMPLES: diff --git a/src/sage/matroids/matroids_plot_helpers.py b/src/sage/matroids/matroids_plot_helpers.py index 1967c76c485..477e8368428 100644 --- a/src/sage/matroids/matroids_plot_helpers.py +++ b/src/sage/matroids/matroids_plot_helpers.py @@ -19,8 +19,9 @@ via an optimization that gives aesthetically pleasing point placement (in some sense. This is not yet implemented). One can then use ``createline`` function to produce sequence of ``100`` points on a smooth - curve containing the points in the specified line which inturn uses - ``scipy.interpolate.splprep`` and ``scipy.interpolate.splev``. Then one + curve containing the points in the specified line which in turn uses + :func:`scipy:scipy.interpolate.splprep` and + :func:`scipy:scipy.interpolate.splev`. Then one can use sage's graphics primitives ``line``, ``point``, ``text`` and ``points`` to produce graphics object containing points (ground set elements) and lines (for a rank 3 matroid, these are flats of rank 2 of diff --git a/src/sage/modules/vector_double_dense.pyx b/src/sage/modules/vector_double_dense.pyx index 1a985af50ea..13b432b837f 100644 --- a/src/sage/modules/vector_double_dense.pyx +++ b/src/sage/modules/vector_double_dense.pyx @@ -595,8 +595,8 @@ cdef class Vector_double_dense(FreeModuleElement): ALGORITHM: - Computation is performed by the ``norm()`` function of - the SciPy/NumPy library. + Computation is performed by the :func:`~scipy:scipy.linalg.norm` + function of the SciPy/NumPy library. EXAMPLES: diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py index d2f83103f2e..f336ad18e8f 100644 --- a/src/sage/numerical/optimize.py +++ b/src/sage/numerical/optimize.py @@ -33,8 +33,8 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals to lie within ``xtol`` of the value return. Should be `\geq 0`. The routine modifies this to take into account the relative precision of doubles. By default, rtol is ``4*numpy.finfo(float).eps``, the - minimum allowed value for ``scipy.optimize.brentq``, which is what - this method uses underneath. This value is equal to ``2.0**-50`` for + minimum allowed value for :func:`scipy:scipy.optimize.brentq`, which is + what this method uses underneath. This value is equal to ``2.0**-50`` for IEEE-754 double precision floats as used by Python. - ``maxiter`` -- integer; if convergence is not achieved in @@ -267,9 +267,7 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500): ALGORITHM: - Uses `scipy.optimize.fminbound - `_ - which uses Brent's method. + Uses :func:`scipy:scipy.optimize.fminbound` which uses Brent's method. AUTHOR: @@ -331,8 +329,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default", .. NOTE:: For additional information on the algorithms implemented in this function, - consult SciPy's `documentation on optimization and root - finding `_ + consult SciPy's :mod:`documentation on optimization and root + finding `. EXAMPLES: @@ -720,8 +718,8 @@ def find_fit(data, model, initial_guess = None, parameters = None, variables = N ALGORITHM: - Uses ``scipy.optimize.leastsq`` which in turn uses MINPACK's lmdif and - lmder algorithms. + Uses :func:`scipy:scipy.optimize.leastsq` which in turn uses MINPACK's + ``lmdif`` and ``lmder`` algorithms. """ import numpy