home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

41 rows where user = 81219 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: issue_url, reactions, created_at (date), updated_at (date)

issue 18

  • Implement polyfit? 6
  • Weighted quantile 6
  • read ncml files to create multifile datasets 5
  • Add support for CFTimeIndex in get_clean_interp_index 4
  • interp with long cftime coordinates raises an error 4
  • Add quantile method to GroupBy 2
  • interp and reindex should work for 1d -> nd indexing 2
  • DataArray.quantile does not honor `keep_attrs` 2
  • Adding resample functionality to CFTimeIndex 1
  • WIP: sketch of resample support for CFTimeIndex 1
  • Implement CFPeriodIndex 1
  • Add quantile method to groupby object 1
  • Assign attributes to DataArrays when creating dataset with PydapDataStore + subsetting 1
  • Make datetime_to_numeric more robust to overflow errors 1
  • Fix interp bug when indexer shares coordinates with array 1
  • Slicing bug with pandas 1.3 and CFTimeIndex 1
  • Add var and std to weighted computations 1
  • occasional segfaults on CI 1

user 1

  • huard · 41 ✖

author_association 1

  • CONTRIBUTOR 41
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1567319929 https://github.com/pydata/xarray/issues/7879#issuecomment-1567319929 https://api.github.com/repos/pydata/xarray/issues/7879 IC_kwDOAMm_X85da2d5 huard 81219 2023-05-29T16:15:49Z 2023-05-29T16:15:49Z CONTRIBUTOR

There are similar segfaults in an xncml PR: https://github.com/xarray-contrib/xncml/pull/48

Googling around suggest it is related to netCDF not being thread-safe and recent python-netcdf4 releasing the GIL.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  occasional segfaults on CI 1730451312
1326516874 https://github.com/pydata/xarray/issues/2697#issuecomment-1326516874 https://api.github.com/repos/pydata/xarray/issues/2697 IC_kwDOAMm_X85PEQqK huard 81219 2022-11-24T14:20:54Z 2022-11-24T14:20:54Z CONTRIBUTOR

That's right. I just did a quick 0.1 release of xncml, most likely rough around the edges. Give it a spin. PRs most welcome.

@rabernat If you're happy with it, this issue can probably be closed.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  read ncml files to create multifile datasets 401874795
1177518755 https://github.com/pydata/xarray/issues/2697#issuecomment-1177518755 https://api.github.com/repos/pydata/xarray/issues/2697 IC_kwDOAMm_X85GL4Kj huard 81219 2022-07-07T12:18:01Z 2022-07-07T12:18:01Z CONTRIBUTOR

@andersy005 Sounds good !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  read ncml files to create multifile datasets 401874795
1176862288 https://github.com/pydata/xarray/issues/2697#issuecomment-1176862288 https://api.github.com/repos/pydata/xarray/issues/2697 IC_kwDOAMm_X85GJX5Q huard 81219 2022-07-06T23:45:57Z 2022-07-06T23:46:14Z CONTRIBUTOR

Ok, another option would be to add that to xncml

@andersy005 What do you think ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  read ncml files to create multifile datasets 401874795
1176775280 https://github.com/pydata/xarray/issues/2697#issuecomment-1176775280 https://api.github.com/repos/pydata/xarray/issues/2697 IC_kwDOAMm_X85GJCpw huard 81219 2022-07-06T21:37:21Z 2022-07-06T21:37:21Z CONTRIBUTOR

I've got a first draft that parses an NcML document and spits out an xarray.Dataset. It does not cover all the NcML syntax, but the essential elements are there.

It uses xsdata to parse the XML, using a datamodel automatically generated from the NcML 2-2 schema. I've scrapped test files from the netcdf-java repo to create a test suite.

Wondering what's the best place to host the code, tests and test data so others may give it a spin ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  read ncml files to create multifile datasets 401874795
1047254700 https://github.com/pydata/xarray/pull/6059#issuecomment-1047254700 https://api.github.com/repos/pydata/xarray/issues/6059 IC_kwDOAMm_X84-a9as huard 81219 2022-02-21T21:59:22Z 2022-02-21T21:59:22Z CONTRIBUTOR

The alignment of data and weights is not done automatically. So I agree this would be ideal, but I'll need some guidance to make it happen without the align call.

This is the error I get python ValueError: operand to apply_ufunc has required core dimensions ['dim_0', 'dim_1'], but some of these dimensions are absent on an input variable: ['dim_1']

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Weighted quantile 1076265104
1043394963 https://github.com/pydata/xarray/pull/6059#issuecomment-1043394963 https://api.github.com/repos/pydata/xarray/issues/6059 IC_kwDOAMm_X84-MPGT huard 81219 2022-02-17T20:26:50Z 2022-02-17T20:26:50Z CONTRIBUTOR

@mathause I'm not 100% confident the methods other than linear work as expected, so I suggest we do not expose method until a robust test suite can confirm results are valid.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Weighted quantile 1076265104
1035083891 https://github.com/pydata/xarray/pull/6059#issuecomment-1035083891 https://api.github.com/repos/pydata/xarray/issues/6059 IC_kwDOAMm_X849siBz huard 81219 2022-02-10T15:52:34Z 2022-02-10T15:52:34Z CONTRIBUTOR

We have local changes that expose method in the public API, and compare results against numpy for the case with uniform weights to confirm results are identical.

Do you want us to push those changes here ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Weighted quantile 1076265104
1032858964 https://github.com/pydata/xarray/pull/6059#issuecomment-1032858964 https://api.github.com/repos/pydata/xarray/issues/6059 IC_kwDOAMm_X849kC1U huard 81219 2022-02-08T17:13:14Z 2022-02-08T17:13:14Z CONTRIBUTOR

Correct, it's not exposed yet because I don't have the bandwidth to create tests for all the different methods.

The equal weight case could be tested against numpy fairly easily though.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Weighted quantile 1076265104
1032829729 https://github.com/pydata/xarray/pull/6059#issuecomment-1032829729 https://api.github.com/repos/pydata/xarray/issues/6059 IC_kwDOAMm_X849j7sh huard 81219 2022-02-08T16:44:21Z 2022-02-08T16:44:21Z CONTRIBUTOR

@mathause Should this PR be amended to account for #6108 ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Weighted quantile 1076265104
1011450968 https://github.com/pydata/xarray/pull/6059#issuecomment-1011450968 https://api.github.com/repos/pydata/xarray/issues/6059 IC_kwDOAMm_X848SYRY huard 81219 2022-01-12T21:06:01Z 2022-01-12T21:06:01Z CONTRIBUTOR

I had the same interrogation. My guess is that the DataArray.quantile and DataArrayWeighted.quantile should have similar signatures.

The way I see it is that another PR would bring the DataArray.quantile signature up to date with numpy 1.22, which includes the 9 h types, and harmonize DataArrayWeighted.quantile with it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Weighted quantile 1076265104
951258747 https://github.com/pydata/xarray/pull/5870#issuecomment-951258747 https://api.github.com/repos/pydata/xarray/issues/5870 IC_kwDOAMm_X844sw57 huard 81219 2021-10-25T19:56:23Z 2021-10-25T19:56:23Z CONTRIBUTOR

Is there an appetite to add a weighted quantile method as well ?

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add var and std to weighted computations 1027640127
874234855 https://github.com/pydata/xarray/issues/5576#issuecomment-874234855 https://api.github.com/repos/pydata/xarray/issues/5576 MDEyOklzc3VlQ29tbWVudDg3NDIzNDg1NQ== huard 81219 2021-07-05T16:50:30Z 2021-07-05T16:50:30Z CONTRIBUTOR

Thanks, I'll just pin pandas and wait for the next xarray release. Sorry about the noise.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Slicing bug with pandas 1.3 and CFTimeIndex 937160239
686540299 https://github.com/pydata/xarray/issues/2697#issuecomment-686540299 https://api.github.com/repos/pydata/xarray/issues/2697 MDEyOklzc3VlQ29tbWVudDY4NjU0MDI5OQ== huard 81219 2020-09-03T14:42:19Z 2020-09-03T14:42:19Z CONTRIBUTOR

I'd like to revive this issue. We're increasingly using NcML aggregations within our THREDDS server to create "logical" datasets. This allows us to fix some non-CF-conforming metadata fields without changing files on disk (which would break syncing with ESGF nodes). More importantly, by aggregating multiple time periods, variables and realizations, we're able to create catalog entries for simulations instead of files, which we expect will greatly facilitate parsing catalog search results. We'd like to offer the same aggregation functionality outside of the THREDDS server. Ideally, this would be supported right from the netcdf-c library (see https://github.com/Unidata/netcdf-c/issues/1478), but an xarray NcML backend is the second best option. I also imagine that NcML files could be use as a clean mechanism to create Zarr/NCZarr objects ie: *.nc -> open_ncml -> xr.Dataset -> to_zarr -> Zarr store

@andersy005 In terms of API, I think the need is not so much to create or modify NcML files, but rather to return an xarray.Dataset from an NcML description. My understanding is that open_ncml would be a wrapper around open_mfdataset. My hope is that NcML-based xarray.Dataset objects would behave similarly whether they are created from files on disk through xarray.open_ncml('sim.ncml') or xarray.open_dataset('https://.../thredds/sim.ncml').

The THREDDS repo contains a number of unit tests that could be emulated to steer the Python implementation. My understanding is that getting this done could involve a fair amount of work, so I'd like to see who's interested in collaborating on this and maybe schedule a meeting to plan work for this year or the next.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  read ncml files to create multifile datasets 401874795
598253451 https://github.com/pydata/xarray/pull/3758#issuecomment-598253451 https://api.github.com/repos/pydata/xarray/issues/3758 MDEyOklzc3VlQ29tbWVudDU5ODI1MzQ1MQ== huard 81219 2020-03-12T15:32:04Z 2020-03-12T15:32:04Z CONTRIBUTOR

@max-sixty Thanks for taking the time. This PR and #3733 are needed for quantile mapping methods @aulemahal and I are working on.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix interp bug when indexer shares coordinates with array 561210241
583083189 https://github.com/pydata/xarray/issues/3252#issuecomment-583083189 https://api.github.com/repos/pydata/xarray/issues/3252 MDEyOklzc3VlQ29tbWVudDU4MzA4MzE4OQ== huard 81219 2020-02-06T19:59:29Z 2020-02-06T21:21:26Z CONTRIBUTOR

@shoyer I'm having trouble wrapping my head around this. The example above is essentially a 1D interpolation over y, a coordinate selection over x, and a broadcast over z. I don't think it should interpolate over x, right ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  interp and reindex should work for 1d -> nd indexing 484622545
582945608 https://github.com/pydata/xarray/issues/3252#issuecomment-582945608 https://api.github.com/repos/pydata/xarray/issues/3252 MDEyOklzc3VlQ29tbWVudDU4Mjk0NTYwOA== huard 81219 2020-02-06T15:00:57Z 2020-02-06T15:00:57Z CONTRIBUTOR

Just got bit by this as well. Computing monthly quantile correction factors, so I have an array with dimensions (month, quantile, lon, lat). I then want to apply these correction factors to a time series (time, lon, lat), so I compute the month and quantile of my time series, and want to interp into the quantile correction factors. This doesn't work because both the factors and the time series have (lat, lon) dimensions.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  interp and reindex should work for 1d -> nd indexing 484622545
578529854 https://github.com/pydata/xarray/pull/3631#issuecomment-578529854 https://api.github.com/repos/pydata/xarray/issues/3631 MDEyOklzc3VlQ29tbWVudDU3ODUyOTg1NA== huard 81219 2020-01-26T18:36:23Z 2020-01-26T18:36:23Z CONTRIBUTOR

Thanks @spencerkclark for shepherding this to completion.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add support for CFTimeIndex in get_clean_interp_index 538620718
578288582 https://github.com/pydata/xarray/pull/3631#issuecomment-578288582 https://api.github.com/repos/pydata/xarray/issues/3631 MDEyOklzc3VlQ29tbWVudDU3ODI4ODU4Mg== huard 81219 2020-01-24T20:27:59Z 2020-01-24T20:27:59Z CONTRIBUTOR

Ah ! No, I tried numpy.testing's version. Works now. Thanks !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add support for CFTimeIndex in get_clean_interp_index 538620718
578264526 https://github.com/pydata/xarray/pull/3631#issuecomment-578264526 https://api.github.com/repos/pydata/xarray/issues/3631 MDEyOklzc3VlQ29tbWVudDU3ODI2NDUyNg== huard 81219 2020-01-24T19:20:11Z 2020-01-24T19:20:11Z CONTRIBUTOR

It seems like assert_allclose doesn't like nans. Other suggestion ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add support for CFTimeIndex in get_clean_interp_index 538620718
578244381 https://github.com/pydata/xarray/pull/3631#issuecomment-578244381 https://api.github.com/repos/pydata/xarray/issues/3631 MDEyOklzc3VlQ29tbWVudDU3ODI0NDM4MQ== huard 81219 2020-01-24T18:23:46Z 2020-01-24T18:23:46Z CONTRIBUTOR

I think so. If there's a branch fixing the assert_allclose failures, I can merge it here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add support for CFTimeIndex in get_clean_interp_index 538620718
576401921 https://github.com/pydata/xarray/pull/3642#issuecomment-576401921 https://api.github.com/repos/pydata/xarray/issues/3642 MDEyOklzc3VlQ29tbWVudDU3NjQwMTkyMQ== huard 81219 2020-01-20T19:21:48Z 2020-01-20T19:21:48Z CONTRIBUTOR

Merged with #3631.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Make datetime_to_numeric more robust to overflow errors 539821504
567129939 https://github.com/pydata/xarray/issues/3641#issuecomment-567129939 https://api.github.com/repos/pydata/xarray/issues/3641 MDEyOklzc3VlQ29tbWVudDU2NzEyOTkzOQ== huard 81219 2019-12-18T17:22:55Z 2019-12-18T17:22:55Z CONTRIBUTOR

Note that at the moment, if we pass np.datetime64 objects that exceed the allowed time span, the function yields garbage without failing. Is this something we want to fix as well ?

One option is to convert array and offset to microseconds first, then compute the delta, but this may break people's code.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  interp with long cftime coordinates raises an error 539648897
567077543 https://github.com/pydata/xarray/issues/3641#issuecomment-567077543 https://api.github.com/repos/pydata/xarray/issues/3641 MDEyOklzc3VlQ29tbWVudDU2NzA3NzU0Mw== huard 81219 2019-12-18T15:22:07Z 2019-12-18T15:22:07Z CONTRIBUTOR

How about replacing array = np.asarray(pd.Series(array.ravel())).reshape(array.shape) by array = array.astype("timedelta64") ? with numpy 1.17 your example works and the test suite only fails on unrelated netcdf string errors.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  interp with long cftime coordinates raises an error 539648897
567022752 https://github.com/pydata/xarray/issues/3641#issuecomment-567022752 https://api.github.com/repos/pydata/xarray/issues/3641 MDEyOklzc3VlQ29tbWVudDU2NzAyMjc1Mg== huard 81219 2019-12-18T13:04:31Z 2019-12-18T13:04:31Z CONTRIBUTOR

Got it, thanks !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  interp with long cftime coordinates raises an error 539648897
567018062 https://github.com/pydata/xarray/issues/3641#issuecomment-567018062 https://api.github.com/repos/pydata/xarray/issues/3641 MDEyOklzc3VlQ29tbWVudDU2NzAxODA2Mg== huard 81219 2019-12-18T12:49:43Z 2019-12-18T12:49:43Z CONTRIBUTOR

Another issue with datetime_to_numeric happens with: import xarray as xr import cftime i = xr.CFTimeIndex(xr.cftime_range('2000-01-01', periods=2)) xr.core.duck_array_ops.datetime_to_numeric(i, cftime.DatetimeGregorian(2, 1, 1), datetime_unit='D')

```python

TypeError Traceback (most recent call last) pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.array_to_timedelta64()

pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.parse_timedelta_string()

TypeError: object of type 'datetime.timedelta' has no len()

During handling of the above exception, another exception occurred:

OverflowError Traceback (most recent call last) <ipython-input-50-b03d9c4f220d> in <module> ----> 1 xr.core.duck_array_ops.datetime_to_numeric(i, cftime.DatetimeGregorian(2, 1, 1), datetime_unit='D')

~/src/xarray/xarray/core/duck_array_ops.py in datetime_to_numeric(array, offset, datetime_unit, dtype) 395 else: 396 offset = min(array) --> 397 array = array - offset 398 399 if not hasattr(array, "dtype"): # scalar is converted to 0d-array

~/src/xarray/xarray/coding/cftimeindex.py in sub(self, other) 431 432 if isinstance(other, (CFTimeIndex, cftime.datetime)): --> 433 return pd.TimedeltaIndex(np.array(self) - np.array(other)) 434 elif isinstance(other, pd.TimedeltaIndex): 435 return CFTimeIndex(np.array(self) - other.to_pytimedelta())

~/.conda/envs/xclim3/lib/python3.6/site-packages/pandas/core/indexes/timedeltas.py in new(cls, data, unit, freq, start, end, periods, closed, dtype, copy, name, verify_integrity) 256 257 tdarr = TimedeltaArray._from_sequence( --> 258 data, freq=freq, unit=unit, dtype=dtype, copy=copy 259 ) 260 return cls._simple_new(tdarr._data, freq=tdarr.freq, name=name)

~/.conda/envs/xclim3/lib/python3.6/site-packages/pandas/core/arrays/timedeltas.py in _from_sequence(cls, data, dtype, copy, freq, unit) 270 freq, freq_infer = dtl.maybe_infer_freq(freq) 271 --> 272 data, inferred_freq = sequence_to_td64ns(data, copy=copy, unit=unit) 273 freq, freq_infer = dtl.validate_inferred_freq(freq, inferred_freq, freq_infer) 274

~/.conda/envs/xclim3/lib/python3.6/site-packages/pandas/core/arrays/timedeltas.py in sequence_to_td64ns(data, copy, unit, errors) 971 if is_object_dtype(data.dtype) or is_string_dtype(data.dtype): 972 # no need to make a copy, need to convert if string-dtyped --> 973 data = objects_to_td64ns(data, unit=unit, errors=errors) 974 copy = False 975

~/.conda/envs/xclim3/lib/python3.6/site-packages/pandas/core/arrays/timedeltas.py in objects_to_td64ns(data, unit, errors) 1096 values = np.array(data, dtype=np.object_, copy=False) 1097 -> 1098 result = array_to_timedelta64(values, unit=unit, errors=errors) 1099 return result.view("timedelta64[ns]") 1100

pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.array_to_timedelta64()

pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.convert_to_timedelta64()

pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.delta_to_nanoseconds()

OverflowError: Python int too large to convert to C long ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  interp with long cftime coordinates raises an error 539648897
566220633 https://github.com/pydata/xarray/issues/3349#issuecomment-566220633 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NjIyMDYzMw== huard 81219 2019-12-16T20:04:44Z 2019-12-16T20:04:44Z CONTRIBUTOR

@clyne Let me rephrase my question: how do you feel about xarray providing a polyfit/polyval implementation essentially duplicating GeoCat's implementation ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement polyfit? 499477363
566070483 https://github.com/pydata/xarray/issues/3349#issuecomment-566070483 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NjA3MDQ4Mw== huard 81219 2019-12-16T13:53:27Z 2019-12-16T13:53:27Z CONTRIBUTOR

@maboualidev Is your objective to integrate the GeoCat implementation into xarray or keep it standalone ?

On my end, I'll submit a PR to add support for non-standard calendars to xarray.core.missing.get_clean_interp, which you'd then be able to use to get x values from coordinates.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement polyfit? 499477363
565733023 https://github.com/pydata/xarray/issues/3349#issuecomment-565733023 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NTczMzAyMw== huard 81219 2019-12-14T16:43:14Z 2019-12-14T16:43:14Z CONTRIBUTOR

@maboualidev Nice ! I see you're storing the residuals in the DataArray attributes. From my perspective, it would be useful to have those directly as DataArrays. Thoughts ?

So it looks like there are multiple inspirations to draw from. Here is what I could gather.

  • xscale.signal.fitting.polyfit(obj, deg=1, dim=None, coord=None) supports chunking along the fitting dimension using dask.array.linalg.lstsq. No explicit missing data handling.
  • xyzpy.signal.xr_polyfit(obj, dim, ix=None, deg=0.5, poly='hermite') applies np.polynomial.polynomial.polyfit using xr.apply_ufunc along dim with the help of numba. Also supports other types of polynomial (legendre, chebyshev, ...). Missing values are masked out 1D wise.
  • geocat.comp.ndpolyfit(x: Iterable, y: Iterable, deg: int, axis: int = 0, **kwargs) -> (xr.DataArray, da.Array) reorders the array to apply np.polyfit along dim, returns the full outputs (residuals, rank, etc) as DataArray attributes. Missing values are masked out in bulk if possible, 1D-wise otherwise.

There does not seem to be matching polyval implementations for any of those nor support for indexing along a time dimension with a non-standard calendar.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement polyfit? 499477363
565608876 https://github.com/pydata/xarray/issues/3349#issuecomment-565608876 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NTYwODg3Ng== huard 81219 2019-12-13T21:07:39Z 2019-12-13T21:07:39Z CONTRIBUTOR

My current implementation is pretty naive. It's just calling numpy.polyfit using dask.array.apply_along_axis. Happy to put that in a PR as a starting point, but there are a couple of questions I had: * How to return the full output (residuals, rank, singular_values, rcond) ? A tuple of dataarrays or a dataset ? * Do we want to use the dask least square functionality to allow for chunking within the x dimension ? Then it's not just a simple wrapper around polyfit. * Should we use np.polyfit or np.polynomial.polynomial.polyfit ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement polyfit? 499477363
565504692 https://github.com/pydata/xarray/issues/3349#issuecomment-565504692 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NTUwNDY5Mg== huard 81219 2019-12-13T16:20:19Z 2019-12-13T16:20:19Z CONTRIBUTOR

Thanks, it seems to work !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement polyfit? 499477363
565452240 https://github.com/pydata/xarray/issues/3349#issuecomment-565452240 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU2NTQ1MjI0MA== huard 81219 2019-12-13T14:04:23Z 2019-12-13T14:04:23Z CONTRIBUTOR

Started to work on this and facing some issues with the x-coordinate when its a datetime. For standard calendars, I can use pd.to_numeric(da.time), but for non-standard calendars, it's not clear how to go ahead. If I use xr.coding.times.encode_cf_datetime(coord), the coefficients we'll find will only make sense in the polyval function if we use the same time encoding.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement polyfit? 499477363
530962306 https://github.com/pydata/xarray/issues/3304#issuecomment-530962306 https://api.github.com/repos/pydata/xarray/issues/3304 MDEyOklzc3VlQ29tbWVudDUzMDk2MjMwNg== huard 81219 2019-09-12T19:04:09Z 2019-09-12T19:04:09Z CONTRIBUTOR

Ok, I'll submit a PR shortly.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.quantile does not honor `keep_attrs` 492966281
530960436 https://github.com/pydata/xarray/issues/3304#issuecomment-530960436 https://api.github.com/repos/pydata/xarray/issues/3304 MDEyOklzc3VlQ29tbWVudDUzMDk2MDQzNg== huard 81219 2019-09-12T18:58:58Z 2019-09-12T18:58:58Z CONTRIBUTOR

Looking at the code, I'm confused. The DataArray.quantile method creates a temporary dataset, copies the variable over, calls the Variable.quantile method, then assigns the attributes from the dataset to this new variable. At no point however are attributes assigned to this temporary dataset. My understanding is that Variable.quantile should have a keep_attrs argument, correct ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.quantile does not honor `keep_attrs` 492966281
507685922 https://github.com/pydata/xarray/issues/3018#issuecomment-507685922 https://api.github.com/repos/pydata/xarray/issues/3018 MDEyOklzc3VlQ29tbWVudDUwNzY4NTkyMg== huard 81219 2019-07-02T13:50:27Z 2019-07-02T13:50:27Z CONTRIBUTOR

The PR only covered DataArrays, not Datasets, so yes, this is expected.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add quantile method to groupby object 455262061
506317326 https://github.com/pydata/xarray/issues/3047#issuecomment-506317326 https://api.github.com/repos/pydata/xarray/issues/3047 MDEyOklzc3VlQ29tbWVudDUwNjMxNzMyNg== huard 81219 2019-06-27T12:02:33Z 2019-06-27T12:02:33Z CONTRIBUTOR

Ok thanks, will submit to pydap.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Assign attributes to DataArrays when creating dataset with PydapDataStore + subsetting 461088361
475198404 https://github.com/pydata/xarray/pull/2828#issuecomment-475198404 https://api.github.com/repos/pydata/xarray/issues/2828 MDEyOklzc3VlQ29tbWVudDQ3NTE5ODQwNA== huard 81219 2019-03-21T11:44:32Z 2019-03-21T11:44:32Z CONTRIBUTOR

Made the change. I had to drop the quantile dimension for scalar q after the apply to maintain the same behavior as DataArray.quantile, but it got me wondering if keeping the quantile dimension even for scalar q should not be the default.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add quantile method to GroupBy 423405197
474998958 https://github.com/pydata/xarray/pull/2828#issuecomment-474998958 https://api.github.com/repos/pydata/xarray/issues/2828 MDEyOklzc3VlQ29tbWVudDQ3NDk5ODk1OA== huard 81219 2019-03-20T19:42:45Z 2019-03-20T19:42:45Z CONTRIBUTOR

I just realized that I could do da.groupby('time.month').apply(xr.DataArray.quantile, q=.5, dim='time') which seems to yield the same results.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add quantile method to GroupBy 423405197
429856032 https://github.com/pydata/xarray/issues/2481#issuecomment-429856032 https://api.github.com/repos/pydata/xarray/issues/2481 MDEyOklzc3VlQ29tbWVudDQyOTg1NjAzMg== huard 81219 2018-10-15T13:39:25Z 2018-10-15T13:39:25Z CONTRIBUTOR

Got it, thanks for the workaround !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement CFPeriodIndex 369639339
427006309 https://github.com/pydata/xarray/pull/2458#issuecomment-427006309 https://api.github.com/repos/pydata/xarray/issues/2458 MDEyOklzc3VlQ29tbWVudDQyNzAwNjMwOQ== huard 81219 2018-10-04T12:51:21Z 2018-10-04T12:51:21Z CONTRIBUTOR

Do you think there would be a benefit to implementing a TimeGrouper class based on panda's ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  WIP: sketch of resample support for CFTimeIndex 365961291
426035957 https://github.com/pydata/xarray/issues/2191#issuecomment-426035957 https://api.github.com/repos/pydata/xarray/issues/2191 MDEyOklzc3VlQ29tbWVudDQyNjAzNTk1Nw== huard 81219 2018-10-01T19:38:44Z 2018-10-01T19:38:44Z CONTRIBUTOR

I'm trying to wrap my head around what is needed to get the resample method to work but I must say I'm confused. Would it be possible/practical to create a branch with stubs in the code for the methods that need to be written (with a #2191 comment) so newbies can help fill-in the gaps?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Adding resample functionality to CFTimeIndex 327089588

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 35.985ms · About: xarray-datasette