Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
29231: add intersphinx mapping for scipy
Browse files Browse the repository at this point in the history
  • Loading branch information
mwageringel committed Feb 21, 2020
1 parent 6dbca5f commit 3bd5293
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/doc/en/reference/matrices/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions src/sage/calculus/desolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<https://docs.scipy.org/doc/scipy/reference/integrate.html#module-scipy.integrate>`_
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.
Expand Down Expand Up @@ -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:
Expand All @@ -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.
<https://docs.scipy.org/doc/scipy/reference/integrate.html#module-scipy.integrate>`_)
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
Expand Down
4 changes: 3 additions & 1 deletion src/sage/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions src/sage/manifolds/differentiable/integrated_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.odeint.html>`_
:func:`scipy:scipy.integrate.odeint`
via Sage solver
:func:`~sage.calculus.desolvers.desolve_odeint`; ``odeint`` invokes
the LSODA algorithm of the
Expand All @@ -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 <https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html>`_
:obj:`scipy:scipy.integrate.ode`
* ``'dop853'`` - Dormand-Prince Runge-Kutta of order 8(5,3) provided by
`scipy.integrate.ode <https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html>`_
:obj:`scipy:scipy.integrate.ode`
and those provided by ``GSL`` via Sage class
:class:`~sage.calculus.ode.ode_solver`:
Expand Down Expand Up @@ -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 <https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html>`_, 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.
Expand Down Expand Up @@ -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::
Expand Down
28 changes: 15 additions & 13 deletions src/sage/matrix/matrix_double_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1216,17 +1216,17 @@ 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`),
then applies the algorithm for Hermitian matrices. This
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1904,7 +1906,7 @@ cdef class Matrix_double_dense(Matrix_dense):
ALGORITHM:
Use numpy
Uses :func:`scipy:scipy.linalg.det`.
EXAMPLES::
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions src/sage/matroids/matroids_plot_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/sage/modules/vector_double_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 7 additions & 9 deletions src/sage/numerical/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -267,9 +267,7 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
ALGORITHM:
Uses `scipy.optimize.fminbound
<http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fminbound.html>`_
which uses Brent's method.
Uses :func:`scipy:scipy.optimize.fminbound` which uses Brent's method.
AUTHOR:
Expand Down Expand Up @@ -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 <https://docs.scipy.org/doc/scipy/reference/optimize.html>`_
consult SciPy's :mod:`documentation on optimization and root
finding <scipy:scipy.optimize>`.
EXAMPLES:
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 3bd5293

Please sign in to comment.