id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 330918967,MDU6SXNzdWUzMzA5MTg5Njc=,2223,DataArray.interp() : poor performance,15956441,closed,0,,,6,2018-06-09T21:01:30Z,2020-05-25T20:02:37Z,2020-05-25T20:02:37Z,CONTRIBUTOR,,,,"#### Code Sample Hello, I performed a quick comparison of the newly introduced method ìnterp()` with an adapter (draft) to the sdf (scientific data format) library: https://gist.github.com/gwin-zegal/b955c3ef63f5ad51eec6329dd2e620be#file-array_sdf_interp-py Code for a micro comparison (2D array) in python (include the above gist first): ```python arr = xr.DataArray(np.sort(np.sort(np.random.RandomState(123).rand(30,4), axis=0), axis=1), coords=[('tension', np.arange(10, 40)), ('resistance', np.linspace(100, 500, 4))]) res = {'xarray': [], 'c_sdf' : []} x = np.logspace(1, 4, num=10, dtype=np.int16) for size in x: new_tension = arr.tension[0].data + np.random.random_sample(size=size) * (arr.tension[-1].data - arr.tension[0].data) new_resistance = arr.resistance[0].data + np.random.random_sample(size=size) * (arr.resistance[-1].data - arr.resistance[0].data) interp_xr = %timeit -qo arr.interp({'tension': new_tension, 'resistance': new_resistance}) res['xarray'].append(interp_xr) interp_c_sdf = %timeit -qo arr(new_tension, new_resistance) res['c_sdf'].append(interp_c_sdf) ``` #### Problem description The time spent for `array.interp()`is growing exponentially... over two 2min (xarray internal interp) on my old machine compared to 9ms (C-SDF wrapper) for 10_000 interpolations. The C-SDF code is slow (a copy of the array is performed and algorithms not so optimized), but xarray implementation is not usable in daily life on my machine! {'xarray': [, , , , , , , , , ], 'c_sdf': [, , , , , , , , , ]} Performance issue on my machine or is it confirmed by others? #### Output of ``xr.show_versions()``
INSTALLED VERSIONS ------------------ commit: None python: 3.6.5.final.0 python-bits: 64 OS: Darwin OS-release: 15.6.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: fr_FR.UTF-8 LOCALE: fr_FR.UTF-8 xarray: 0.10.7 pandas: 0.23.0 numpy: 1.14.3 scipy: 1.1.0 netCDF4: None h5netcdf: None h5py: 2.8.0 Nio: None zarr: None bottleneck: 1.2.1 cyordereddict: None dask: 0.17.5 distributed: 1.21.8 matplotlib: 2.2.2 cartopy: 0.16.0 seaborn: 0.8.1 setuptools: 39.2.0 pip: 10.0.1 conda: 4.5.4 pytest: 3.4.1 IPython: 6.4.0 sphinx: 1.7.5
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2223/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 549151234,MDExOlB1bGxSZXF1ZXN0MzYyMjk2NTA3,3692,Typo on DataSet/DataArray.to_dict documentation,15956441,closed,0,,,1,2020-01-13T20:04:14Z,2020-01-13T20:32:39Z,2020-01-13T20:32:18Z,CONTRIBUTOR,,0,pydata/xarray/pulls/3692,,"{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3692/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull