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/2370#issuecomment-413779588,https://api.github.com/repos/pydata/xarray/issues/2370,413779588,MDEyOklzc3VlQ29tbWVudDQxMzc3OTU4OA==,6815844,2018-08-17T07:16:43Z,2018-08-17T07:16:43Z,MEMBER,"> Does it work to simply specify an explicit dtype in the sum?
Yes. If the original array is in np.float32 and we specify `dtype=np.float64`, then the calculation will be performed with `np.nansum`, so we can avoid using bottleneck.
But if we set `dtype=np.float32` (the same with the input dtype), then bottleneck will be used.
> But I do think it still probably offers a meaningful speedup in many cases....
How about making numpy function default and we use bottleneck only when it is specified explicitly?
It does not simplify our code though...","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,351000813
https://github.com/pydata/xarray/issues/2370#issuecomment-413774281,https://api.github.com/repos/pydata/xarray/issues/2370,413774281,MDEyOklzc3VlQ29tbWVudDQxMzc3NDI4MQ==,6815844,2018-08-17T06:48:54Z,2018-08-17T06:48:54Z,MEMBER,"> Right now bottleneck is automatically chosen if it is installed, which is rather annoying since the xarray recipe on conda-forge ships with bottleneck even though it should be an optional dependency.
I didn't notice that.
I also think that bottleneck should be an optional dependency.
@shoyer, can you check this?
Maybe [this file](https://github.com/conda-forge/xarray-feedstock/blob/master/recipe/meta.yaml) defines dependency?
> Perhaps we could make it possible to to set the ops engine (to either numpy or bottleneck) and dtype (float32, float64) via set_options()
I think this is a reasonable option.
Personally, I think we can consider to stop using bottleneck entirely or make it completely optional.
With dask backend, bottleneck is not being used and we use this konly in nan-aggregation methods for numpy backend and the rolling operation.
After #1837, our `rolling` with pure numpy is not terriblly slow compared with bottleneck.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,351000813
https://github.com/pydata/xarray/issues/2370#issuecomment-413398724,https://api.github.com/repos/pydata/xarray/issues/2370,413398724,MDEyOklzc3VlQ29tbWVudDQxMzM5ODcyNA==,6815844,2018-08-16T02:01:38Z,2018-08-16T02:02:29Z,MEMBER,"After #2236, `sum(skipna=False)` will use numpy function even if bottleneck is installed.
But in other cases, we still use bottleneck.
I am actually not sure that the automatically casting to float64 or switching to numpy function are the correct path.
Some people may want to use float32 for saving memory and some other people may want to use `bn.nansum` as it is more efficient than numpy's counterpart.
The best algorithm may depend on usecases.
My proposal is to make these method more explicit, e.g. supporting `engine='bottleneck'` keyword.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,351000813