issue_comments
49 rows where author_association = "MEMBER" and issue = 320275317 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- implement interp() · 49 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
395621709 | https://github.com/pydata/xarray/pull/2104#issuecomment-395621709 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NTYyMTcwOQ== | rabernat 1197350 | 2018-06-08T02:00:11Z | 2018-06-08T02:00:11Z | MEMBER | Congratulations on this great new feature! |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
395608335 | https://github.com/pydata/xarray/pull/2104#issuecomment-395608335 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NTYwODMzNQ== | fujiisoup 6815844 | 2018-06-08T00:33:56Z | 2018-06-08T00:33:56Z | MEMBER | Merged! Thanks, @shoyer, @fmaussion, @jhamman, for the detailed review. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
395596744 | https://github.com/pydata/xarray/pull/2104#issuecomment-395596744 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NTU5Njc0NA== | shoyer 1217238 | 2018-06-07T23:24:58Z | 2018-06-07T23:24:58Z | MEMBER | OK, let's merge this when CI passes. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
395595931 | https://github.com/pydata/xarray/pull/2104#issuecomment-395595931 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NTU5NTkzMQ== | fujiisoup 6815844 | 2018-06-07T23:20:35Z | 2018-06-07T23:20:35Z | MEMBER | Thanks, @shoyer.
Done! (I thought I reverted this change already...) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
395243708 | https://github.com/pydata/xarray/pull/2104#issuecomment-395243708 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NTI0MzcwOA== | fujiisoup 6815844 | 2018-06-06T23:18:25Z | 2018-06-06T23:18:25Z | MEMBER |
|
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
395169022 | https://github.com/pydata/xarray/pull/2104#issuecomment-395169022 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NTE2OTAyMg== | shoyer 1217238 | 2018-06-06T18:30:42Z | 2018-06-06T18:30:42Z | MEMBER | Do you want to add |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
394939096 | https://github.com/pydata/xarray/pull/2104#issuecomment-394939096 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NDkzOTA5Ng== | shoyer 1217238 | 2018-06-06T04:49:22Z | 2018-06-06T04:49:22Z | MEMBER | Hmm. I guess numeric_only may currently only be an argument for the reduce method. We probably should add it for methods like mean, too. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
394932923 | https://github.com/pydata/xarray/pull/2104#issuecomment-394932923 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NDkzMjkyMw== | fujiisoup 6815844 | 2018-06-06T04:00:18Z | 2018-06-06T04:00:18Z | MEMBER | Thanks, @shoyer
Thanks. I have not been surprised when Maybe this PR is ready, then. BTW, I noticed that our |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
394754176 | https://github.com/pydata/xarray/pull/2104#issuecomment-394754176 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NDc1NDE3Ng== | shoyer 1217238 | 2018-06-05T15:30:23Z | 2018-06-05T15:30:23Z | MEMBER |
We do the same thing for aggregations like We could add a |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
394532951 | https://github.com/pydata/xarray/pull/2104#issuecomment-394532951 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5NDUzMjk1MQ== | fujiisoup 6815844 | 2018-06-04T23:33:42Z | 2018-06-05T00:56:41Z | MEMBER | Done! But, I am slightly worrying if silently dropping non-numeric array is surprising. Do we have other methods that behave similarly? Or maybe we can raise a warning? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
393770344 | https://github.com/pydata/xarray/pull/2104#issuecomment-393770344 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5Mzc3MDM0NA== | shoyer 1217238 | 2018-06-01T06:05:07Z | 2018-06-01T06:05:07Z | MEMBER | I would wait before trying to do interpolation with datetime types. There might be use cases for this but I can't think of them offhand. On the other hand, it could indeed be interesting to extend |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
393761310 | https://github.com/pydata/xarray/pull/2104#issuecomment-393761310 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5Mzc2MTMxMA== | fujiisoup 6815844 | 2018-06-01T05:20:59Z | 2018-06-01T05:20:59Z | MEMBER |
Agreed.
Also agreed. In theory, datetime dtype could be safely interpolated. Maybe we can support this if there is a demand. It might be necessary to consider the same design issue also for |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
393757211 | https://github.com/pydata/xarray/pull/2104#issuecomment-393757211 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5Mzc1NzIxMQ== | shoyer 1217238 | 2018-06-01T04:51:39Z | 2018-06-01T04:51:39Z | MEMBER | My opinions:
1. I suppose it probably does make sense to interpolate numeric coordinates, too. So this probably doesn't need to change.
2. I do think we should drop non-numeric variables. There just isn't any way to meaningfully interpolate them (especially strings). This means we will probably need to add a check in |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
393756834 | https://github.com/pydata/xarray/pull/2104#issuecomment-393756834 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5Mzc1NjgzNA== | shoyer 1217238 | 2018-06-01T04:48:33Z | 2018-06-01T04:48:33Z | MEMBER | This is very elegant and I think very close to being ready to merge. There are two design issues that I would like to discuss first:
1. Should we interpolate both The current behavior of this PR is:
1. Interpolate all variables, both It might make sense to copy the behavior from |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
393032031 | https://github.com/pydata/xarray/pull/2104#issuecomment-393032031 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5MzAzMjAzMQ== | fujiisoup 6815844 | 2018-05-30T05:08:12Z | 2018-05-30T05:08:12Z | MEMBER | Thanks for the careful review. All done. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
391402735 | https://github.com/pydata/xarray/pull/2104#issuecomment-391402735 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5MTQwMjczNQ== | shoyer 1217238 | 2018-05-23T16:03:06Z | 2018-05-23T16:03:06Z | MEMBER | Sorry, I still need to find time to finish reviewing this — hopefully very soon! On Wed, May 23, 2018 at 8:57 AM Joe Hamman notifications@github.com wrote:
|
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
391400628 | https://github.com/pydata/xarray/pull/2104#issuecomment-391400628 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM5MTQwMDYyOA== | jhamman 2443309 | 2018-05-23T15:56:57Z | 2018-05-23T15:56:57Z | MEMBER | Is there more to do here or is this ready to go in? Seems to me its ready to go. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
389680743 | https://github.com/pydata/xarray/pull/2104#issuecomment-389680743 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4OTY4MDc0Mw== | shoyer 1217238 | 2018-05-16T22:05:14Z | 2018-05-16T22:05:14Z | MEMBER |
Yes, our intent is to eventually extend this same interface to handle these cases, but not in this initial PR. |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
388602254 | https://github.com/pydata/xarray/pull/2104#issuecomment-388602254 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4ODYwMjI1NA== | fujiisoup 6815844 | 2018-05-13T05:15:53Z | 2018-05-13T05:15:53Z | MEMBER | I think this is ready for final review |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
388219645 | https://github.com/pydata/xarray/pull/2104#issuecomment-388219645 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4ODIxOTY0NQ== | dcherian 2448579 | 2018-05-10T23:53:32Z | 2018-05-10T23:53:32Z | MEMBER | @fujiisoup That illustration is great. Thanks for all this great work. Yes, adding more information to that would work well. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
388217237 | https://github.com/pydata/xarray/pull/2104#issuecomment-388217237 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4ODIxNzIzNw== | fujiisoup 6815844 | 2018-05-10T23:37:26Z | 2018-05-10T23:37:26Z | MEMBER |
Agreed. Thanks for the nice suggestion :+1: We have discussed a cheat sheet #1552 previously, but no work has been done yet. I added a simple illustration presenting the difference between advanced- |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
388215681 | https://github.com/pydata/xarray/pull/2104#issuecomment-388215681 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4ODIxNTY4MQ== | dcherian 2448579 | 2018-05-10T23:27:27Z | 2018-05-10T23:27:27Z | MEMBER | I think it would be useful to have a table in the docs showing the differences between / when to use |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
388052465 | https://github.com/pydata/xarray/pull/2104#issuecomment-388052465 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4ODA1MjQ2NQ== | fujiisoup 6815844 | 2018-05-10T13:26:06Z | 2018-05-10T13:26:06Z | MEMBER | @fmaussion , thanks for the example! It's a nicely simple but descriptive example. Updated docs. After your suggestion about attrs, I found a bug in |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
388009361 | https://github.com/pydata/xarray/pull/2104#issuecomment-388009361 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4ODAwOTM2MQ== | fmaussion 10050469 | 2018-05-10T09:57:26Z | 2018-05-10T09:57:26Z | MEMBER |
In my opinion it should be the default, yes. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
388009096 | https://github.com/pydata/xarray/pull/2104#issuecomment-388009096 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4ODAwOTA5Ng== | fmaussion 10050469 | 2018-05-10T09:56:15Z | 2018-05-10T09:56:15Z | MEMBER |
A quick shot would be to use the existing sample dataset: ```python import matplotlib.pyplot as plt import xarray as xr import numpy as np Raw datads = xr.tutorial.load_dataset('air_temperature') ds.air.isel(time=0).plot() plt.title('Raw data') Interpolated datanew_lon = np.linspace(ds.lon[0], ds.lon[-1], ds.dims['lon'] * 4) new_lat = np.linspace(ds.lat[0], ds.lat[-1], ds.dims['lat'] * 4) dsi = ds.interp(lon=new_lon, lat=new_lat) dsi.air.isel(time=0).plot() plt.title('Interpolated data') ``` Which produces the plots:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
388005058 | https://github.com/pydata/xarray/pull/2104#issuecomment-388005058 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4ODAwNTA1OA== | fujiisoup 6815844 | 2018-05-10T09:37:34Z | 2018-05-10T09:37:34Z | MEMBER | Thank you for the double checking :+1:
Agreed.
Is there any problem if we always keep attrs in the interpolation?
BTW, do you have any idea about an example for the new interp feature? It would be nice if we have a good-looking example on the doc. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387993706 | https://github.com/pydata/xarray/pull/2104#issuecomment-387993706 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Nzk5MzcwNg== | fmaussion 10050469 | 2018-05-10T08:48:12Z | 2018-05-10T08:48:12Z | MEMBER |
Right. Another feature of geospatial grids is that they are regularly spaced, which is not always the case here. Forget about my idea for now. I tested your updated branch and we now come to the same results with my test data! I took the liberty to edit your comment because in your current implementation Another wish (sorry! ;): it would be great to implement the |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387914727 | https://github.com/pydata/xarray/pull/2104#issuecomment-387914727 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzkxNDcyNw== | fujiisoup 6815844 | 2018-05-10T00:29:12Z | 2018-05-10T08:45:30Z | MEMBER | Thanks, @fmaussion I didn't realize that scipy.interpolate.interpn does not sort the original coordinates (interp1d does). Thanks for pointing this out!
As the interpolation routine can also be used for non-uniform gridded data, I don't think passing np.arange(NN) to scipy is a good idea (it will change the result if higher order method such as 'cubic' is used).
Instead, I would like to call The new API I would propose is
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387848141 | https://github.com/pydata/xarray/pull/2104#issuecomment-387848141 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Nzg0ODE0MQ== | fmaussion 10050469 | 2018-05-09T19:24:27Z | 2018-05-09T19:24:27Z | MEMBER | @fujiisoup I gave a go at your branch this evening, trying a few things on real data cases. First of all: this is great! Really looking forward to see this in xarray. I noticed a small issue: currently this doesn't work with decreasing coordinates:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-87-98b53090c21d> in <module>()
----> 1 da.interp(lon=[1.1, 2.2, 3.3], lat=[2.3, 1.2])
~/tmp/xarray-fuji/xarray/core/dataarray.py in interp(self, method, kwargs, **coords)
912 """
913 ds = self._to_temp_dataset().interp(
--> 914 method=method, kwargs=kwargs, **coords)
915 return self._from_temp_dataset(ds)
916
~/tmp/xarray-fuji/xarray/core/dataset.py in interp(self, method, kwargs, **coords)
1824 if name not in [k for k, v in indexers_list]:
1825 variables[name] = missing.interp(
-> 1826 var, var_indexers, method, **kwargs)
1827
1828 coord_names = set(variables).intersection(self._coord_names)
~/tmp/xarray-fuji/xarray/core/missing.py in interp(obj, indexes_coords, method, **kwargs)
441 kwargs={'x': x, 'new_x': destination, 'method': method,
442 'kwargs': kwargs},
--> 443 keep_attrs=True)
444
445 if all(x1.dims == new_x1.dims for x1, new_x1 in zip(x, new_x)):
~/tmp/xarray-fuji/xarray/core/computation.py in apply_ufunc(func, *args, **kwargs)
934 keep_attrs=keep_attrs)
935 elif any(isinstance(a, Variable) for a in args):
--> 936 return variables_ufunc(*args)
937 else:
938 return apply_array_ufunc(func, *args, dask=dask)
~/tmp/xarray-fuji/xarray/core/computation.py in apply_variable_ufunc(func, *args, **kwargs)
563 raise ValueError('unknown setting for dask array handling in '
564 'apply_ufunc: {}'.format(dask))
--> 565 result_data = func(*input_data)
566
567 if signature.num_outputs > 1:
~/tmp/xarray-fuji/xarray/core/missing.py in interp_func(obj, x, new_x, method, kwargs)
499
500 func, kwargs = _get_interpolator_nd(method, **kwargs)
--> 501 return _interpnd(obj, x, new_x, func, kwargs)
502
503
~/tmp/xarray-fuji/xarray/core/missing.py in _interpnd(obj, x, new_x, func, kwargs)
518 # stack new_x to 1 vector, with reshape
519 xi = np.stack([x1.values.ravel() for x1 in new_x], axis=-1)
--> 520 rslt = func(x, obj, xi, **kwargs)
521 # move back the interpolation axes to the last position
522 rslt = rslt.transpose(range(-rslt.ndim + 1, 1))
~/.pyvirtualenvs/py3/lib/python3.5/site-packages/scipy/interpolate/interpolate.py in interpn(points, values, xi, method, bounds_error, fill_value)
2589 if not np.all(np.diff(p) > 0.):
2590 raise ValueError("The points in dimension %d must be strictly "
-> 2591 "ascending" % i)
2592 if not np.asarray(p).ndim == 1:
2593 raise ValueError("The points in dimension %d must be "
ValueError: The points in dimension 0 must be strictly ascending
Decreasing coordinates are really frequent in climate data (latitudes are often decreasing, don't ask me why), so I wondered how I implemented this in salem, which brings me to the second point: I think we need an The way salem works is that it uses the concept of geospatial grid where the points to interpolate are defined in a local coordinate system which is always positive and increasing. That is, if I want to use xarray's interpolation routines, I'd like to be able to tell xarray that I'd like to interpolate at "indices [1.1, 2.1, 3.1]" for example, where these can really be understood as indexes in the way I don't know if we really need a Thoughts? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387634881 | https://github.com/pydata/xarray/pull/2104#issuecomment-387634881 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzYzNDg4MQ== | fmaussion 10050469 | 2018-05-09T06:33:26Z | 2018-05-09T06:33:26Z | MEMBER |
Agreed. Users can turn their 1D non dimension coordinates into dimension coordinates if they want to. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387583395 | https://github.com/pydata/xarray/pull/2104#issuecomment-387583395 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzU4MzM5NQ== | fujiisoup 6815844 | 2018-05-09T00:29:36Z | 2018-05-09T00:29:36Z | MEMBER |
I agreed that it would be better to concentrate on structured interpolation only in this PR. I concerned about the interpolation along 1-dimensional but non-dimensional coordinate, which @fmaussion suggested in a review comment. It is actually the structured interpolation, but currently, I do not support this just because of the analogy to |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387580695 | https://github.com/pydata/xarray/pull/2104#issuecomment-387580695 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzU4MDY5NQ== | shoyer 1217238 | 2018-05-09T00:12:14Z | 2018-05-09T00:12:14Z | MEMBER |
As I think I've mentioned before, I think we should save interpolation of unstructured grids for later -- if only to keep the complexity of this PR to the minimum. Interpolation on unstructured grids needs some of auxiliary data structure to be done efficiently, so it might make sense to wait until after we support flexible index types such as a KDTree index saved on xarray objects. That said, we could also add it now (immediately after this PR), and add support for caching KDTrees later. I think the API for unstructured grid interpolation is pretty straightforward and could even reuse the same
I agree, by default we should switch to |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387576123 | https://github.com/pydata/xarray/pull/2104#issuecomment-387576123 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzU3NjEyMw== | fujiisoup 6815844 | 2018-05-08T23:43:29Z | 2018-05-08T23:46:17Z | MEMBER | Thanks, @fmaussion The current design question is
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387388988 | https://github.com/pydata/xarray/pull/2104#issuecomment-387388988 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzM4ODk4OA== | fujiisoup 6815844 | 2018-05-08T12:41:29Z | 2018-05-08T12:41:57Z | MEMBER | Thanks, @fmaussion. I think it is almost ready. The remaining things are + I am looking for a good-looking example for our docs on rtd. + Just before the merge, I'm going to rename missing.py to interp.py so that the filename is more descriptive. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387387039 | https://github.com/pydata/xarray/pull/2104#issuecomment-387387039 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzM4NzAzOQ== | fmaussion 10050469 | 2018-05-08T12:33:36Z | 2018-05-08T12:33:36Z | MEMBER | Let us know when this is ready for review! I'm happy to have a look at it. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387386033 | https://github.com/pydata/xarray/pull/2104#issuecomment-387386033 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzM4NjAzMw== | fmaussion 10050469 | 2018-05-08T12:29:53Z | 2018-05-08T12:29:53Z | MEMBER |
I don't think it's that bad. It makes it clear that the arguments are passed over to the underlying function, and that xarray is not doing all the magic by itself. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
387295942 | https://github.com/pydata/xarray/pull/2104#issuecomment-387295942 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NzI5NTk0Mg== | fujiisoup 6815844 | 2018-05-08T06:13:49Z | 2018-05-08T06:13:49Z | MEMBER |
I agreed. I updated some of this PR. The proposed API is
Honestly, I am not very happy with |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386938847 | https://github.com/pydata/xarray/pull/2104#issuecomment-386938847 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NjkzODg0Nw== | shoyer 1217238 | 2018-05-07T02:14:11Z | 2018-05-07T02:14:11Z | MEMBER | My inclination would be to limit this method to interpolation on regular grids, i.e., the methods supported by scipy.interpolate.interpn or interp1d. I think a |
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386876701 | https://github.com/pydata/xarray/pull/2104#issuecomment-386876701 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Njg3NjcwMQ== | fujiisoup 6815844 | 2018-05-06T12:41:07Z | 2018-05-06T12:41:07Z | MEMBER | Yes, I am thinking this for multidimensional interpolation of nan-including arrays. (For 1-dimensional interpolation, we can interpolate them row by row) Although this should be another work (PR), I am wondering what the best API is. Is |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386876126 | https://github.com/pydata/xarray/pull/2104#issuecomment-386876126 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Njg3NjEyNg== | fmaussion 10050469 | 2018-05-06T12:31:27Z | 2018-05-06T12:31:27Z | MEMBER |
Do you mean you want to use unstructured data interpolation routines? (https://docs.scipy.org/doc/scipy/reference/interpolate.html#multivariate-interpolation) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386874264 | https://github.com/pydata/xarray/pull/2104#issuecomment-386874264 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Njg3NDI2NA== | fujiisoup 6815844 | 2018-05-06T12:00:33Z | 2018-05-06T12:00:33Z | MEMBER |
I did not certainly realize how RegularGridInterpolator works, but it seems to work with nan including array too as you pointed out.
But higher order interpolations (RegularGridInterpolator is
It is the original behavior of I think the addition of the linear interpolation is still nice, but it would be nicer if we could also implement nan-skipping interpolations, which will enable us to use higher order interpolation with nan-including arrays. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386869104 | https://github.com/pydata/xarray/pull/2104#issuecomment-386869104 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Njg2OTEwNA== | fmaussion 10050469 | 2018-05-06T10:24:00Z | 2018-05-06T10:24:00Z | MEMBER |
Why don't leave the NaN handling part to the actual function doing the interpolation? RegularGridInterpolator handles NaNs pretty much the same way @shoyer describes it. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386854560 | https://github.com/pydata/xarray/pull/2104#issuecomment-386854560 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Njg1NDU2MA== | fujiisoup 6815844 | 2018-05-06T05:13:09Z | 2018-05-06T05:13:09Z | MEMBER | @shoyer ,
Yes, In [2]: # 'linear' works as expected ...: interp1d(x, y, kind='linear')([0.5, 1.5]) ...: Out[2]: array([0.5, nan]) In [3]: # 'cubic' returns an all nan array ...: interp1d(x, y, kind='cubic')([0.5, 1.5]) ...: Out[3]: array([nan, nan]) ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386834171 | https://github.com/pydata/xarray/pull/2104#issuecomment-386834171 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NjgzNDE3MQ== | shoyer 1217238 | 2018-05-05T20:52:57Z | 2018-05-05T20:52:57Z | MEMBER | I still need to look at the code here, but I don't think we need separate code paths for NaN vs no-NaNs. For example, suppose we have a DataArray with a coordinate |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386796193 | https://github.com/pydata/xarray/pull/2104#issuecomment-386796193 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Njc5NjE5Mw== | fujiisoup 6815844 | 2018-05-05T10:37:12Z | 2018-05-05T10:37:12Z | MEMBER | Maybe the possible API would be
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386744768 | https://github.com/pydata/xarray/pull/2104#issuecomment-386744768 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4Njc0NDc2OA== | fujiisoup 6815844 | 2018-05-04T21:53:05Z | 2018-05-04T21:53:05Z | MEMBER | @jhamman,
Agreed. I will try to generalize your interpolator-adaptor more. @shoyer
Agreed.
I meant 1.
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386658665 | https://github.com/pydata/xarray/pull/2104#issuecomment-386658665 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NjY1ODY2NQ== | shoyer 1217238 | 2018-05-04T16:40:03Z | 2018-05-04T16:40:03Z | MEMBER | First of all, this is awesome! One question: since I think this new interpolation method will be used quite frequently (more often than We should also consider adding
Yes, I agree. Interpolation should be vectorized similarly to In particular, in the long term I think we should aim to make
I think this is fine to start (we can always add more later).
Which NaN are you referring to?
Case (1) should definitely be supported. Especially if data is stored in dask arrays, we cannot necessarily check if there are NaNs. Cases (2) and (3) are not important, because there are relatively few use-cases for NaN in coordinate arrays.
Currently we don't support this for
I think the new coordinates should take priority, and the dimension coordinates on the new coordinate should be dropped. This is similar to what we do for ``` In [10]: da = xr.DataArray([0, 0.1, 0.2, 0.1], dims='x', coords={'x': [0, 1, 2, 3]}) ...: In [11]: da.sel(x=xr.DataArray([1, 2], dims=['x'], coords={'x': [1, 3]})) ...: Out[11]: <xarray.DataArray (x: 2)> array([0.1, 0.2]) Coordinates: * x (x) int64 1 2 ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386624429 | https://github.com/pydata/xarray/pull/2104#issuecomment-386624429 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NjYyNDQyOQ== | jhamman 2443309 | 2018-05-04T14:46:11Z | 2018-05-04T14:46:11Z | MEMBER | @fujiisoup - This is great. I wonder if we can draw more from the interpolator adapters I built in I just gave your implementation a quick skim and I think there is currently some duplication of efforts so maybe we look there to see what can be combined. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 | |
386606569 | https://github.com/pydata/xarray/pull/2104#issuecomment-386606569 | https://api.github.com/repos/pydata/xarray/issues/2104 | MDEyOklzc3VlQ29tbWVudDM4NjYwNjU2OQ== | fmaussion 10050469 | 2018-05-04T13:47:15Z | 2018-05-04T13:47:15Z | MEMBER | @fujiisoup this is awesome! So glad you are looking into this. To point 1: I think that your implementation is a very good first step. From the geosciences point of view I think that Spline interpolation would be a very good candidate too, but it only works in the 2-dimensional case which makes it a no-go for the general case... |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
implement interp() 320275317 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [issue] INTEGER REFERENCES [issues]([id]) ); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 6