html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/5424#issuecomment-862579076,https://api.github.com/repos/pydata/xarray/issues/5424,862579076,MDEyOklzc3VlQ29tbWVudDg2MjU3OTA3Ng==,2448579,2021-06-16T17:42:34Z,2021-06-16T17:42:34Z,MEMBER,"> there's a config for disabling bottleneck — assuming that's correct, we'd take a PR for one.
Yeah I think it'd be nice to opt-in/out to bottleneck and maybe even support numbagg somehow.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,908464731
https://github.com/pydata/xarray/issues/5424#issuecomment-852355465,https://api.github.com/repos/pydata/xarray/issues/5424,852355465,MDEyOklzc3VlQ29tbWVudDg1MjM1NTQ2NQ==,5635139,2021-06-01T18:36:04Z,2021-06-01T18:36:04Z,MEMBER,"I don't think there's a config for disabling bottleneck — assuming that's correct, we'd take a PR for one.
FYI one does seem to work is setting the type to float:
```python
...: xarr.astype(float).max()
Out[1]:
array(0.)
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,908464731
https://github.com/pydata/xarray/issues/5424#issuecomment-852334068,https://api.github.com/repos/pydata/xarray/issues/5424,852334068,MDEyOklzc3VlQ29tbWVudDg1MjMzNDA2OA==,3801015,2021-06-01T18:01:05Z,2021-06-01T18:01:05Z,CONTRIBUTOR,"Annoyingly the bug affects pretty much every bottleneck function, not just max, and I'm dealing with a large codebase where lots of the code just uses the methods attached to the `xr.DataArray`s.
Is there a way of disabling use of bottleneck inside xarray without uninstalling bottleneck? And if so do you know if this is expected to give the same results? Pandas (probably a few versions ago now) had a situation where if you uninstalled bottleneck it would use some other routine, but the nan-handling was then different - I think it caused the all-nan `sum` to flick between nan and zero if I recall.
Quick response appreciated though, and I might have a delve into fixing bottleneck myself if I get the free time.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,908464731
https://github.com/pydata/xarray/issues/5424#issuecomment-852265735,https://api.github.com/repos/pydata/xarray/issues/5424,852265735,MDEyOklzc3VlQ29tbWVudDg1MjI2NTczNQ==,5635139,2021-06-01T16:33:09Z,2021-06-01T16:33:16Z,MEMBER,"Thanks @lusewell . Unfortunately — as you suggest — I don't think there's much we can do — but this does seem like a bad bug.
It might be worth checking out numbagg — https://github.com/numbagg/numbagg — which we use for fast operations that bottleneck doesn't include. Disclaimer that it comes from @shoyer , and I've recently given it a spring cleaning. To the extent this isn't fixed in bottleneck, we could offer an option to use numbagg, though it would probably require a contribution.
If you need this working for now, you could probably write a workaround for yourself using numbagg fairly quickly; e.g.
```python
In [6]: numbagg.nanmax(xarr.values)
Out[6]: 0.0
# or, more generally:
In [12]: xr.apply_ufunc(numbagg.nanmax, xarr, input_core_dims=(('A','B','C'),))
Out[12]:
array(0.)
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,908464731