Follow-up after mean_poisson_deviance array API PR

As a follow-up for #29227.

The following command fails locally:
```
pytest -vl sklearn/metrics/tests/test_common.py -k 'api_regression_metric and mean_poisson_deviance'
```
see full error in https://github.com/scikit-learn/scikit-learn/pull/29227#issuecomment-2244729661

but setting `SCIPY_ARRAY_API=1` works:
```
SCIPY_ARRAY_API=1 pytest -vl sklearn/metrics/tests/test_common.py -k 'api_regression_metric and mean_poisson_deviance'
```

Honestly I think this is fair to say that as a newcomer to the array API work, my feeling is that it can break way too easily in very mysterious ways. There are probably a few unrelated reasons for this but I guess since at the last bi-weekly meetings we agreed that we should try to pay attention to this kind of breakages and improve the situation, here are a few comments on this #29277:
- I think we should have some tests with scipy>=1.14 and `SCIPY_ARRAY_API` unset. This seems something that could easily happen in practice and we should have tests that make sure that nothing breaks. It's not clear to me why only array-api-strict breaks and not pytorch example, maybe as the name implies array-api-strict is even stricter than other namespaces.
- I don't think this is acceptable to skip the test for scipy<1.14 since you know a reasonable user may use `array_api_dispatch=True` with scipy<1.14. To be fair it is not clear to me what happens in this case. I guess scipy will transform the array into a numpy array, and maybe the code afterwards has issues because some arrays are not in the same namespace? Anyway, we should make sure that the user code does not break. If this is really too hard to achieve the alternative is to raise an exception saying something like "to enable array API dispatch with this particular function you need scipy 1.14 and `SCIPY_ARRAY_API=1`".
- the warning about `SCIPY_ARRAY_API` seems too broad (as soon as `set_config(array_api_dispatch=True)` is called?). Could we not have warnings only in a few (at least for now) places where we know we call scipy functions?

_Originally posted by @lesteve in https://github.com/scikit-learn/scikit-learn/issues/29227#issuecomment-2244803503_

COMMENT:
> * the warning about `SCIPY_ARRAY_API` seems too broad (as soon as `set_config(array_api_dispatch=True)` is called?). Could we not have warnings only in a few (at least for now) places where we know we call scipy functions?

I assume you mean https://github.com/scikit-learn/scikit-learn/blob/156ef1b7fe9bc0ee5b281634cfd56b9c54e83277/sklearn/utils/_array_api.py#L111-L121

I think it is fine to have a warning for everything. Especially as scipy plan to remove the need for setting this environment variable. So adding logic to our code only when needed feels like a lot of effort.

Did you see the warning when you ran the tests? Or is it lost in a sea of warnings? Asked differently, why did the warning we already have not prevent your negative experience when running the tests?

One thing we should add IMHO is a check on the minimum version of scipy that the user has installed. If your scipy version is too old, enabling this environment variable won't do anything for you. The newer the installed scipy version is, the more of it will support the array API. So I think this means we require a minimum version for scikit-learn to work. Which means we need a CI setup with that version to make sure we don't rely on things in scipy that are "too new". Should we pick scipy 1.14 as the minimum?


> * I think we should have some tests with scipy>=1.14 and `SCIPY_ARRAY_API` unset. This seems something that could easily happen in practice and we should have tests that make sure that nothing breaks.

For these tests array API support in scikit-learn would be turned off right?



> * I don't think this is acceptable to skip the test for scipy<1.14 since you know a reasonable user may use `array_api_dispatch=True` with scipy<1.14. To be fair it is not clear to me what happens in this case.

I think we should pick a minimum scipy version that you need to use array API. Mostly because "who knows what will happen" if people use an older one. We should implement a check like we have for Numpy in `_check_array_api_dispatch` for this minimum version

Labels: Array API