DOC Investigate scipy-doctest for more convenient doctests

I learned about [scipy-doctest](https://github.com/scipy/scipy_doctest) recent release in the [Scientific Python Discourse announcement](https://discuss.scientific-python.org/t/ann-scipy-doctest-package/1181). Apparently, scipy-doctest has been used internally in numpy and scipy for doctests for some time. In particular it allows floating point comparisons.

After a bit of work from us setting everything up, it would allow to have a few sprint / first good issues.

There is quite a few places where we used the doctest ellipsis, the quick and dirty following regexp finds 595 lines:
```
git grep -P '\d+\.\.\.' | wc -l
```

If you are not sure what I am talking about, this is the `...` for doctest in rst for docstrings e.g. the last line of this snippet:
```py
>>> from sklearn import svm, datasets
>>> from sklearn.model_selection import cross_val_score
>>> X, y = datasets.load_iris(return_X_y=True)
>>> clf = svm.SVC(random_state=0)
>>> cross_val_score(clf, X, y, cv=5, scoring='recall_macro')
array([0.96..., 0.96..., 0.96..., 0.93..., 1.        ])
```

An example of a doctest with a spurious failure recently: https://github.com/scikit-learn/scikit-learn/pull/29140#issuecomment-2139904739

If you are wondering about the difference to [pytest-doctestplus](https://github.com/scientific-python/pytest-doctestplus) look at [this](https://github.com/scipy/scipy_doctest?tab=readme-ov-file#prior-art-and-related-work). This does seem a bit unfortunate to have `scipy/scipy_doctest` and `scientific-python/pytest-doctestplus` but oh well (full disclosure I did not have time to look into the history) ...

COMMENT:
Yes, the goal is to be able to run doctests unmodified and make them whitespace insensitive, be able to use `# may vary` instead of `# doctest: +SKIP`, not worry about numpy 2.2 vs 1.x formatting etc. Basically, just focus on examples being for the reader, instead of wrangling with the tools.

To set it up:

-  in the conftest.py, add an import, https://github.com/scipy/scipy/blob/2fde036ec404512d695568a4259ba16f6c9156b5/scipy/conftest.py#L19, and you've a set of default settings from scipy's decade of usage. 
The rest of conftests in numpy and scipy is further tweaks to these defaults.

- how you run tests in scikit-learn? If spin, numpy adds a `spin check-docs` command, https://github.com/numpy/numpy/blob/main/.spin/cmds.py#L156

- the spin command is of course just syntax sugar on top of `$ pytest --doctest-modules --pyargs installed-module` or, for meson dev installs, `$ pytest --doctest-modules path/to/build-install-dir`.

- one scipy-doctest specific pytest switch, which both scipy and numpy use is `--doctest-collect=api`. This is to only collect docstrings of public objects. 

When `scipy-doctest` is pip-installed in the environment, it automatically hooks into `--doctest-modules`.

The bulk of scipy/numpy conftest.py is indeed,

> - warnings control (probably because warnings are turned into errors)

Yes, that. And we just like to filter out irrelevant known warnings in some cases. Those parts are not essential.

> managing a list of tests to skip or xfail

Indeed. The list of things to skip is kept in the tool, not in the docstrings. Because this is irrelevant to a reader of the docs, or a function is deprecated (so its import emits a DeprecationWarning) etc.

> ignore some tests during collection

Yes, service parts of the library. In numpy, it's distutils for example; in scipy's dev.py, there's an additional list. `pytest-extra-ignore` is just syntax sugar on top of `pytest --ignore path/to/ignore`. 

I don't know if scikit-learn has ReST tutorials. If you do and if you want them to be doctested, numpy has `$ spin check-tutorials`.

------------------------------

If you want, we can have a chat in real time.

Labels: Documentation, Enhancement, RFC