Improve error message when scipy is missing for NDPointIndex#11085
Improve error message when scipy is missing for NDPointIndex#11085dcherian merged 10 commits intopydata:mainfrom
Conversation
|
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. |
|
thanks for the PR, @Sakshee-D. This looks good to me, but we might need a test? This might require more changes, though: right now, the dedicated test module ( |
|
Thanks for the suggestion. I’ll include this in the PR so you can review it there and suggest any changes if needed. |
| @@ -8,8 +8,9 @@ | |||
|
|
|||
|
|
|||
| def test_ndpointindex_missing_scipy(monkeypatch): | |||
There was a problem hiding this comment.
instead of the monkey patching it should be enough to check on the environments that don't install scipy (also needs from xarray.tests import has_scipy):
| def test_ndpointindex_missing_scipy(monkeypatch): | |
| @pytest.mark.skipif(has_scipy) | |
| def test_ndpointindex_missing_scipy(): |
|
Thanks for pointing that out . |
- Add missing bug fixes: pydata#11064, pydata#11026, pydata#11022, pydata#11005, pydata#10980, pydata#10788, pydata#11085 - Add missing documentation entries: pydata#10958, pydata#11094, pydata#11080 - Add missing performance entry: pydata#11105 - Add Internal Changes section with pydata#11108 - Fix rST roles: use :py:func:, :py:meth:, :py:class: consistently - Fix missing commas between :issue: and :pull: references - Fix typo in Dataset.identical entry - Fix wrong PR number for coord ordering (11098 -> 11091) - Add missing :pull: reference for arithmetic_compat (pydata#10943) Co-authored-by: Claude <noreply@anthropic.com>
|
Thanks for the review and handling the remaining changes and merge . |
|
Thank you for contributing! |
PR: pydata#11085 Issue: pydata#11047 Base commit: 0a2d81c Changed lines: 24
This PR improves the error message raised when using
NDPointIndexwithoutscipyinstalled.Previously, the missing dependency error was raised indirectly during index creation. This change wraps the
scipyimport inScipyKDTreeAdapterand raises a more actionableImportErrorexplaining thatscipyis required.Manual testing
scipyis not installedscipyis installedRelated to #11047