pydata / sparse

Sparse multi-dimensional arrays for the PyData ecosystem

Home Page:https://sparse.pydata.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docs: scipy intersphinx links point to bad urls (404)

delgadom opened this issue · comments

Describe the bug

In the sparse docs, all links to scipy documentation result in 404 errors. See for example

Landing Page
On the first line of the landing page, all pointers to the scipy API reference are broken:

This implements sparse arrays of arbitrary dimension on top of numpy and scipy.sparse.

Here's the corresponding section as markdown (included here only for the purpose of illustrating the URLs - I know in reality this code is written in rst with intersphinx links):

This implements sparse arrays of arbitrary dimension on top of [numpy] 
(https://numpy.org/doc/stable/reference/index.html#module-numpy) and [scipy.sparse] 
(https://docs.scipy.org/doc/scipy/reference/reference/sparse.html#module-scipy.sparse).

From Scipy sparse matrices
Similarly, in the section on "Construct Sparse Arrays", all references to Scipy API docs, including in the section titles, are broken:

From Scipy sparse matrices
To construct COO array from spmatrix objects, you can use the COO.from_scipy_sparse method. As an example, if x is a scipy.sparse.spmatrix, you can do the following to get an equivalent COO array:

Here's the corresponding section as markdown:

From [Scipy sparse matrices](https://docs.scipy.org/doc/scipy/reference/reference/generated/scipy.sparse.spmatrix.html)
[](https://sparse.pydata.org/en/stable/construct.html#from-scipy-sparse-matrices)

To construct [COO](https://sparse.pydata.org/en/stable/generated/sparse.COO.html#sparse.COO) 
array from [spmatrix](https://docs.scipy.org/doc/scipy/reference/reference/generated/scipy.sparse.spmatrix.html#scipy.sparse.spmatrix)
objects, you can use the [COO.from_scipy_sparse](https://sparse.pydata.org/en/stable/generated/sparse.COO.from_scipy_sparse.html#sparse.COO.from_scipy_sparse)
method. As an example, if x is a [scipy.sparse.spmatrix](https://docs.scipy.org/doc/scipy/reference/reference/generated/scipy.sparse.spmatrix.html#scipy.sparse.spmatrix), 
you can do the following to get an equivalent 
[COO](https://sparse.pydata.org/en/stable/generated/sparse.COO.html#sparse.COO) array:

Explanation

The provided links point to https://docs.scipy.org/doc/scipy/reference/reference/generated/..., with reference twice. This should simply be https://docs.scipy.org/doc/scipy/reference/generated/..., as in https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.spmatrix.html#scipy.sparse.spmatrix

Proposed Remedy

The culprit appears to be in docs/conf.py#L188:

    "numpy": ("https://docs.scipy.org/doc/numpy/", None),
    "scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
}

reference should simply be dropped from the scipy link

type:bug is probably not warranted. this is only an issue with the docs :)

Thanks for the issue, would you be willing to make a PR?

Fixed in #543