home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

43 rows where author_association = "CONTRIBUTOR" and user = 20629530 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 26

  • Calendar utilities 8
  • Calendar utilities 4
  • Implementation of polyfit and polyval 3
  • map_blocks doesn't handle tranposed arrays 3
  • xr.infer_freq 2
  • Fix polyfit fail on deficient rank 2
  • Enable `flox` in `GroupBy` and `resample` 2
  • Implement polyfit? 1
  • Interpolating with a common chunked dim fails 1
  • Chunking causes unrelated non-dimension coordinate to become a dask array 1
  • General curve fitting method 1
  • maximum recursion with dask and pydap backend 1
  • allow using non-dimension coordinates in polyfit 1
  • Interpolation with multiple mutlidimensional arrays sharing dims fails 1
  • Unexpected chunking of 3d DataArray in `polyfit()` 1
  • cftime default's datetime breaks CFTimeIndex 1
  • DataArrays inside apply_ufunc with dask=parallelized 1
  • failing cftime plot tests 1
  • Fast-track unstack doesn't work with dask 1
  • `dt.to_pytimedelta` to allow arithmetic with cftime objects 1
  • cftime 1.5.0 changes behviour upon pickling : breaks get_clean_interp_index with a dask distributed scheduler. 1
  • Polyfit performance on large datasets - Suboptimal dask task graph 1
  • some private imports broken on main 1
  • reset_index not resetting levels of MultiIndex 1
  • COMPAT: Adjust CFTimeIndex.get_loc for pandas 2.0 deprecation enforcement 1
  • fix convert_calendar on static variables in Dataset 1

user 1

  • aulemahal · 43 ✖

author_association 1

  • CONTRIBUTOR · 43 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1362895889 https://github.com/pydata/xarray/pull/7399#issuecomment-1362895889 https://api.github.com/repos/pydata/xarray/issues/7399 IC_kwDOAMm_X85RPCQR aulemahal 20629530 2022-12-22T14:20:36Z 2022-12-22T14:20:36Z CONTRIBUTOR

This makes complete sense to me, thanks! I'm quite surprised I didn't get this issue before in my scripts, sorry about that!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  fix convert_calendar on static variables in Dataset 1507817863
1353551624 https://github.com/pydata/xarray/issues/4348#issuecomment-1353551624 https://api.github.com/repos/pydata/xarray/issues/4348 IC_kwDOAMm_X85QrY8I aulemahal 20629530 2022-12-15T18:47:38Z 2022-12-15T18:47:38Z CONTRIBUTOR

This is happenning to me too. For the record, I need to use engine='pydap' because it supports authentification to access private thredds data programmatically (by passing session), while netCDF4 does not.

I pointed to this issue in the related (but currently badly named and stale) issue upstream.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  maximum recursion with dask and pydap backend 681291824
1346807178 https://github.com/pydata/xarray/pull/7361#issuecomment-1346807178 https://api.github.com/repos/pydata/xarray/issues/7361 IC_kwDOAMm_X85QRqWK aulemahal 20629530 2022-12-12T16:11:29Z 2022-12-12T16:11:29Z CONTRIBUTOR

Hmm, I don't think so! Thanks for the heads up.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  COMPAT: Adjust CFTimeIndex.get_loc for pandas 2.0 deprecation enforcement 1477931237
1240904315 https://github.com/pydata/xarray/issues/6946#issuecomment-1240904315 https://api.github.com/repos/pydata/xarray/issues/6946 IC_kwDOAMm_X85J9rJ7 aulemahal 20629530 2022-09-08T15:51:15Z 2022-09-08T15:51:27Z CONTRIBUTOR

I found another problem that this issue causes : the dataset can't be written to netCDF and the error message suggests exactly what has already been done: ```python import xarray as xr ds = xr.tutorial.open_dataset('air_temperature')

ds = ds.stack(spatial=['lon', 'lat']) ds = ds.reset_index('spatial', drop=True)

ds.to_netcdf('test.nc') raises: NotImplementedError: variable 'lat' is a MultiIndex, which cannot yet be serialized to netCDF files (https://github.com/pydata/xarray/issues/1077). Use reset_index() to convert MultiIndex levels into coordinate variables instead. ```

@benbovy I'm guessing your PR will fix this, but I'm raising the issue to be sure.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  reset_index not resetting levels of MultiIndex 1347026292
1176645772 https://github.com/pydata/xarray/issues/4205#issuecomment-1176645772 https://api.github.com/repos/pydata/xarray/issues/4205 IC_kwDOAMm_X85GIjCM aulemahal 20629530 2022-07-06T20:00:09Z 2022-07-06T20:00:32Z CONTRIBUTOR

I have the same problem in xarray 2022.3.0. The issue is that this creates unnecessary dask tasks in the graph and some operations acting on the coordinates unexpectedly trigger dask computations. "Unexpected" because the coordinates at the beginning of the process where not chunked. So computation that was expected to happen in the main thread (or not happen at all) is now happenning in the dask workers.

An example: ```python3 import numpy as np import xarray as xr from dask.diagnostics import ProgressBar

A 2D variable

da = xr.DataArray( np.ones((12, 10)), dims=('x', 'y'), coords={'x': np.arange(12), 'y': np.arange(10)} )

A 1D variable sharing a dim with da

db = xr.DataArray( np.ones((12,)), dims=('x'), coords={'x': np.arange(12)} )

A non-dimension coordinate

cx = xr.DataArray(np.zeros((12,)), dims=('x',), coords={'x': np.arange(12)})

Assign it to da and db

da = da.assign_coords(cx=cx) db = db.assign_coords(cx=cx)

We need to chunk along y

da = da.chunk({'y': 1})

Notice how cx is now a dask array, even if it is a 1D coordinate and does not have 'Y' as a dimension.

print(da)

This triggers a dask computation

with ProgressBar(): da - db ``` The reason my example triggers dask is that xarray ensure the coordinates are aligned and equal (I think?). Anyway, I didn't expect it.

Personally, I think the chunk method shouldn't apply to the coordinates at all, no matter their dimensions. They're coordinate so we expect to be able to read them easily when aligning/comparing dataset. Dask is to be used with the "real" data only. Does this vision fit the one from the devs? I feel this "skip" could be easily implemented.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Chunking causes unrelated non-dimension coordinate to become a dask array 651945063
1171576721 https://github.com/pydata/xarray/issues/6741#issuecomment-1171576721 https://api.github.com/repos/pydata/xarray/issues/6741 IC_kwDOAMm_X85F1NeR aulemahal 20629530 2022-06-30T19:08:28Z 2022-06-30T19:08:28Z CONTRIBUTOR

To add details, I suspect this commit as the culprit: https://github.com/headtr1ck/xarray/commit/cd2f2b247cf6e1c68c7db6e92100898272fb0e1a

It removes a direct import of the core.resample submodule in core.dataarray and moves it to the "Type checking" imports. Thus, importing xarray (import xarray as xr), does not trigger an explicit import of resample anymore.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  some private imports broken on main 1290524064
1124203598 https://github.com/pydata/xarray/pull/5734#issuecomment-1124203598 https://api.github.com/repos/pydata/xarray/issues/5734 IC_kwDOAMm_X85DAfxO aulemahal 20629530 2022-05-11T19:24:56Z 2022-05-11T19:25:11Z CONTRIBUTOR

Presumably you haven't found any bugs?

Not for now,, but I haven't done much and it wasn't very complex.

You can pass method as .mean(..., method=...)

Yes! I saw that, but I did search a bit. In fact, my idea was triggered partly because I'm lazy. My suggestion was to do something alike what xarray does with keep_attrs : a global/context option that changes the default value of method, so it doesn't need to be explicitly added everywhere.

Note you can only blockwise if all members of a group are in a single block.

Oh! I didn't catch that. My test data was already appropriately chunked.

Right now, I'd just like this to get merged :)

Haha, I understand. My idea, if pertinent, could be done in another PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Enable `flox` in `GroupBy` and `resample` 978356586
1124142026 https://github.com/pydata/xarray/pull/5734#issuecomment-1124142026 https://api.github.com/repos/pydata/xarray/issues/5734 IC_kwDOAMm_X85DAQvK aulemahal 20629530 2022-05-11T18:18:17Z 2022-05-11T18:18:17Z CONTRIBUTOR

Hi @dcherian and @andersy005, thanks a lot for this PR and for flox. I'm currently trying this with our climate indices library (xclim) and it works well! I get a clear improvement in performance,

In xclim's indicators, all groupby operations are time resampling ops and the best performance is achieved with method='blockwise', by far. Is there a plan to let users control the default method through something like xr.set_options ?

Like, use_flox could accept False, True or any method name? (The default still being map-reduce) ? What do you think?

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Enable `flox` in `GroupBy` and `resample` 978356586
953076586 https://github.com/pydata/xarray/issues/5155#issuecomment-953076586 https://api.github.com/repos/pydata/xarray/issues/5155 IC_kwDOAMm_X844zstq aulemahal 20629530 2021-10-27T16:06:01Z 2021-10-27T16:06:15Z CONTRIBUTOR

I agree that it kinda crowds the xarray API. My first idea was to implement these calendar utilities in cf-xarray, but I was redirected here. Seems to me that if that move is made, it's the most logical place for all CF[time] related things.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 857947050
941292524 https://github.com/pydata/xarray/pull/5233#issuecomment-941292524 https://api.github.com/repos/pydata/xarray/issues/5233 IC_kwDOAMm_X844Gvvs aulemahal 20629530 2021-10-12T18:52:15Z 2021-10-12T18:52:15Z CONTRIBUTOR

Here we are! Also, I don't think the test failure comes from my changes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 870312451
931424397 https://github.com/pydata/xarray/pull/5233#issuecomment-931424397 https://api.github.com/repos/pydata/xarray/issues/5233 IC_kwDOAMm_X843hGiN aulemahal 20629530 2021-09-30T15:25:23Z 2021-09-30T15:25:23Z CONTRIBUTOR

@spencerkclark Done!

Note that we have this issue : Ouranosinc/xclim#841 open on our side. It's for a third method for converting 360_day calendars. Based on something used in the litterature, it randomizes the days to insert/drop when converting. My plan is to implement it in xclim soonish, then if it works I could bring it up here and open a new PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 870312451
909508817 https://github.com/pydata/xarray/pull/5233#issuecomment-909508817 https://api.github.com/repos/pydata/xarray/issues/5233 IC_kwDOAMm_X842NgDR aulemahal 20629530 2021-08-31T18:49:39Z 2021-08-31T18:49:39Z CONTRIBUTOR

@spencerkclark After more than 2 weeks, I had time to address your comments!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 870312451
909375096 https://github.com/pydata/xarray/pull/5233#issuecomment-909375096 https://api.github.com/repos/pydata/xarray/issues/5233 IC_kwDOAMm_X842M_Z4 aulemahal 20629530 2021-08-31T16:07:28Z 2021-08-31T16:07:28Z CONTRIBUTOR

@spencerkclark I came back to this today, merged upstream/main and now I can't commit the merge because xarray/core/_typed_ops.pyi is not passing the mypy pre-commit hook. Is this a problem on my side? Have you ever seen this? It's strange cause in setup.cfg only *.py files are supposed to be checked by mypy, but I guess pre-commit doesn't respect that? pre-commit run --all does work though...

May be @max-sixty has an idea, since he recently pushed a PR playing with this file and typing...

The errors :

``` xarray/core/_typed_ops.pyi:32: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:33: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:34: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:35: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:36: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:37: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:38: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:39: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:40: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:41: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:42: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:43: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:44: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:45: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:46: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:47: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:48: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:49: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:50: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:51: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:52: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:53: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:54: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:55: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:56: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:57: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:60: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:61: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:62: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:63: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:64: error: The erased type of self "xarray.core.dataset.Dataset" is not a supertype of its class "xarray.core._typed_ops.DatasetOpsMixin" [misc] xarray/core/_typed_ops.pyi:65: error: The erased type of self "xarray.core.dataset.Dataset" is not a supertype of its class "xarray.core._typed_ops.DatasetOpsMixin" [misc] xarray/core/_typed_ops.pyi:66: error: The erased type of self "xarray.core.dataset.Dataset" is not a supertype of its class "xarray.core._typed_ops.DatasetOpsMixin" [misc] xarray/core/_typed_ops.pyi:67: error: The erased type of self "xarray.core.dataset.Dataset" is not a supertype of its class "xarray.core._typed_ops.DatasetOpsMixin" [misc] xarray/core/_typed_ops.pyi:77: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:83: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:89: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:95: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:101: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:107: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:113: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:119: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:125: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:131: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:137: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:143: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:149: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:155: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:161: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:167: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:173: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:179: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:185: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:191: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:197: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:203: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:209: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:215: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:221: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:227: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:230: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:231: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:232: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:233: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:234: error: The erased type of self "xarray.core.dataarray.DataArray" is not a supertype of its class "xarray.core._typed_ops.DataArrayOpsMixin" [misc] xarray/core/_typed_ops.pyi:235: error: The erased type of self "xarray.core.dataarray.DataArray" is not a supertype of its class "xarray.core._typed_ops.DataArrayOpsMixin" [misc] xarray/core/_typed_ops.pyi:236: error: The erased type of self "xarray.core.dataarray.DataArray" is not a supertype of its class "xarray.core._typed_ops.DataArrayOpsMixin" [misc] xarray/core/_typed_ops.pyi:237: error: The erased type of self "xarray.core.dataarray.DataArray" is not a supertype of its class "xarray.core._typed_ops.DataArrayOpsMixin" [misc] xarray/core/_typed_ops.pyi:247: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:253: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:259: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:265: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:271: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:277: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:283: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:289: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:295: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:301: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:307: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:313: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:319: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:325: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:331: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:337: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:343: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:349: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:355: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:361: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:367: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:373: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:379: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:385: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:391: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:397: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:400: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:401: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:402: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:403: error: Self argument missing for a non-static method (or an invalid type for self) [misc] xarray/core/_typed_ops.pyi:404: error: The erased type of self "xarray.core.variable.Variable" is not a supertype of its class "xarray.core._typed_ops.VariableOpsMixin" [misc] xarray/core/_typed_ops.pyi:405: error: The erased type of self "xarray.core.variable.Variable" is not a supertype of its class "xarray.core._typed_ops.VariableOpsMixin" [misc] xarray/core/_typed_ops.pyi:406: error: The erased type of self "xarray.core.variable.Variable" is not a supertype of its class "xarray.core._typed_ops.VariableOpsMixin" [misc] xarray/core/_typed_ops.pyi:407: error: The erased type of self "xarray.core.variable.Variable" is not a supertype of its class "xarray.core._typed_ops.VariableOpsMixin" [misc] Found 102 errors in 1 file (checked 3 source files) ```
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 870312451
886905635 https://github.com/pydata/xarray/issues/5629#issuecomment-886905635 https://api.github.com/repos/pydata/xarray/issues/5629 IC_kwDOAMm_X8403Rsj aulemahal 20629530 2021-07-26T17:52:42Z 2021-07-26T17:52:42Z CONTRIBUTOR

@aulemahal what do you think about how easy it might be to change polyfit to use apply_ufunc?

Should be easy! The code was written without apply_ufunc for a few reasons, one being that using apply_ufunc+vectorize was slower than the apply_along_axis trick it currently uses. But, with the issue raised here, that might not be true...

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
  Polyfit performance on large datasets - Suboptimal dask task graph 950882492
870748510 https://github.com/pydata/xarray/issues/5551#issuecomment-870748510 https://api.github.com/repos/pydata/xarray/issues/5551 MDEyOklzc3VlQ29tbWVudDg3MDc0ODUxMA== aulemahal 20629530 2021-06-29T16:35:02Z 2021-06-29T16:39:59Z CONTRIBUTOR

EDIT: I hit enter a bit too soon... I think I found the very source of the problem, maybe this could be fixed in cftime:

```python import pickle

ds.time # same No-Leap coordinate as in the MWE above

Items are instances of cftime.DatetimeNoLeap

pickle.loads(pickle.dumps(ds.time))

Items are instances of cftime.datetime, calendar information is now only an attribute, get_clean_interp_index will fail

```

However, as xarray has the possiblity to contain cftime coordinates where the calendar is an attribute, I guess get_clean_interp_index needs to be fixed?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime 1.5.0 changes behviour upon pickling : breaks get_clean_interp_index with a dask distributed scheduler. 932898075
853900455 https://github.com/pydata/xarray/pull/5402#issuecomment-853900455 https://api.github.com/repos/pydata/xarray/issues/5402 MDEyOklzc3VlQ29tbWVudDg1MzkwMDQ1NQ== aulemahal 20629530 2021-06-03T14:11:16Z 2021-06-03T14:11:16Z CONTRIBUTOR

Agreed that this is limited and there's need for a more general solution!

However, this problem is quite tricky... The best I see is what I think you suggested in the other thread : special workaround with re-casting when the operation involves "<m8[ns]" and "O" (and that the "O" is cftime datetimes). That clears the instability problem of my solution. It loads a value, so dask-compat is not optimal, but that's already what dt does.

The encoding problem remains, but I made some tests and I realized numpy automatically casts timedeltas to the smallest unit, but accepts operations between timedeltas of different units. Could we accept timedelta64 arrays with another units than "ns"? Then, there could be a check when converting python timedeltas : if nanosecond information exist : go with [ns], if not, go with [ms]. This bumps the limit from 292 years to 292471. And, with this relaxation of the dtype strictness, would allow a user to use even coarser frequencies if need be.

Throwing ideas. There might be other issues that I did not see!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `dt.to_pytimedelta` to allow arithmetic with cftime objects 906175200
848897924 https://github.com/pydata/xarray/issues/5344#issuecomment-848897924 https://api.github.com/repos/pydata/xarray/issues/5344 MDEyOklzc3VlQ29tbWVudDg0ODg5NzkyNA== aulemahal 20629530 2021-05-26T16:00:28Z 2021-05-26T16:00:28Z CONTRIBUTOR

FYI, I opened SciTools/nc-time-axis#59 to update nc-time-axis. Waiting for maintainers to review.

{
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  failing cftime plot tests 895470157
844461920 https://github.com/pydata/xarray/issues/5346#issuecomment-844461920 https://api.github.com/repos/pydata/xarray/issues/5346 MDEyOklzc3VlQ29tbWVudDg0NDQ2MTkyMA== aulemahal 20629530 2021-05-19T20:49:28Z 2021-05-19T20:49:28Z CONTRIBUTOR

I'm not sure I understand the "dimensions" thing, isn't the MWE 1D? What is the case where it should work?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fast-track unstack doesn't work with dask 895842334
843208815 https://github.com/pydata/xarray/issues/5326#issuecomment-843208815 https://api.github.com/repos/pydata/xarray/issues/5326 MDEyOklzc3VlQ29tbWVudDg0MzIwODgxNQ== aulemahal 20629530 2021-05-18T14:14:37Z 2021-05-18T14:14:37Z CONTRIBUTOR

Thanks everyone. Just to be clear, I am using map_blocks in a rather complicated way (way more than this MWE) and at the moment of the map_blocks call, the code doesn't know the dimension order of the output, only the names. Moreover, in this code, the wrapped functions are too complex for map_blocks to infer the template. The idea is that all wrapped funcs reduce some dims or add some other (but with known sizes), thus I can construct a template, but the dim order is uncertain.

However, I understand that it is expected from map_blocks that the result fits the template, so my expectation was not correct. I'll leave the "workaround" in my code and close this issue. Thanks!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  map_blocks doesn't handle tranposed arrays 893692903
842678176 https://github.com/pydata/xarray/issues/5326#issuecomment-842678176 https://api.github.com/repos/pydata/xarray/issues/5326 MDEyOklzc3VlQ29tbWVudDg0MjY3ODE3Ng== aulemahal 20629530 2021-05-17T22:17:23Z 2021-05-17T22:17:23Z CONTRIBUTOR

Haha, sorry, I didn't explain this properly.

This MWE is just MWE. The use case I have of map_blocks is in a decorator. At the moment I write the map_blocks call, I do not know if func will transpose the result or not. In my case, the template is generated from a list of dimensions to reduce and new dimensions.

I realize this might be an edge case that is too narrow to merit a fix. I expected dimension order not to matter, as it is the case in most of xarray. Right now, my code wraps func in a another function that performs this tranpose when needed.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  map_blocks doesn't handle tranposed arrays 893692903
842668943 https://github.com/pydata/xarray/issues/5326#issuecomment-842668943 https://api.github.com/repos/pydata/xarray/issues/5326 MDEyOklzc3VlQ29tbWVudDg0MjY2ODk0Mw== aulemahal 20629530 2021-05-17T21:56:35Z 2021-05-17T21:56:35Z CONTRIBUTOR

Hi @max-sixty, just edited the top comment to include the traceback.

The MWE does work with return d.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  map_blocks doesn't handle tranposed arrays 893692903
842565341 https://github.com/pydata/xarray/pull/5233#issuecomment-842565341 https://api.github.com/repos/pydata/xarray/issues/5233 MDEyOklzc3VlQ29tbWVudDg0MjU2NTM0MQ== aulemahal 20629530 2021-05-17T19:10:39Z 2021-05-17T19:10:39Z CONTRIBUTOR

@spencerkclark Applied suggestions from the review, added Dataset.convert_calendar and Dataset.interp_calendar, and same on DataArray.

Wasn't sure what to do with the tests. They already done in test_calendar_ops.py...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 870312451
834564305 https://github.com/pydata/xarray/pull/5233#issuecomment-834564305 https://api.github.com/repos/pydata/xarray/issues/5233 MDEyOklzc3VlQ29tbWVudDgzNDU2NDMwNQ== aulemahal 20629530 2021-05-07T15:55:23Z 2021-05-07T15:55:23Z CONTRIBUTOR

Updated the code following first wave of suggestions!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 870312451
828789494 https://github.com/pydata/xarray/pull/5233#issuecomment-828789494 https://api.github.com/repos/pydata/xarray/issues/5233 MDEyOklzc3VlQ29tbWVudDgyODc4OTQ5NA== aulemahal 20629530 2021-04-28T21:23:40Z 2021-04-28T21:23:40Z CONTRIBUTOR

I see the strange errors here : https://github.com/aulemahal/xarray/actions. The failure triggered an email and this is why I didn't look here. Well, if it's something in the configuration of my fork, then we don't care!

Will fix the doc errors...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 870312451
828784054 https://github.com/pydata/xarray/pull/5233#issuecomment-828784054 https://api.github.com/repos/pydata/xarray/issues/5233 MDEyOklzc3VlQ29tbWVudDgyODc4NDA1NA== aulemahal 20629530 2021-04-28T21:13:25Z 2021-04-28T21:13:25Z CONTRIBUTOR

I am excessively confused at the errors in the builds... They are triggered by tests not touching my work and also it says the installed version of xarray is 0.11???

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 870312451
824379535 https://github.com/pydata/xarray/issues/5155#issuecomment-824379535 https://api.github.com/repos/pydata/xarray/issues/5155 MDEyOklzc3VlQ29tbWVudDgyNDM3OTUzNQ== aulemahal 20629530 2021-04-21T21:46:42Z 2021-04-21T21:46:42Z CONTRIBUTOR

Edited the comment above as I realized that numpy /pandas / xarray use nanoseconds by default, so the earliest date possible is 1677-09-21 00:12:43.145225. Thus, I suggest we return "standard" as the calendar of numpy-backed datetime indexes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 857947050
824373780 https://github.com/pydata/xarray/issues/5155#issuecomment-824373780 https://api.github.com/repos/pydata/xarray/issues/5155 MDEyOklzc3VlQ29tbWVudDgyNDM3Mzc4MA== aulemahal 20629530 2021-04-21T21:37:59Z 2021-04-21T21:44:58Z CONTRIBUTOR

Cool! I started a branch, will push a PR soon.

I understand the "default" issue and using use_cftime=None makes sense to me!

~For dt.calendar and date_range, there remains the question on how we name numpy's calendar: Python uses what CF conventions call proleptic_gregorian, but the default and most common calendar we see and use is CF's "standard". May be users would expect "standard"? A solution would be to check if the earliest value in the array is before 1582-10-15. If yes, return "proleptic_gregorian", if not, return "standard".~

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 857947050
822566735 https://github.com/pydata/xarray/issues/4554#issuecomment-822566735 https://api.github.com/repos/pydata/xarray/issues/4554 MDEyOklzc3VlQ29tbWVudDgyMjU2NjczNQ== aulemahal 20629530 2021-04-19T15:37:30Z 2021-04-19T15:37:30Z CONTRIBUTOR

Took a look and it seems to originate from the stacking part and someting in dask.

In polyfit, we rearrange the DataArrays to 2D arrays, so we can run the least squares with np/dsa.apply_along_axis. But I checked and the chunking problem seems to appear before any call of the sort. MWE:

```python3 import xarray as xr import dask.array as dsa nz, ny, nx = (10, 20, 30) data = dsa.ones((nz, ny, nx), chunks=(1, 5, nx)) da = xr.DataArray(data, dims=['z', 'y', 'x']) da.chunks

((1, 1, 1, 1, 1, 1, 1, 1, 1, 1), (5, 5, 5, 5), (30,))

stk = da.stack(zy=['z', 'y']) print(stk.dims, stk.chunks)

('x', 'zy') ((30,), (20, 20, 20, 20, 20, 20, 20, 20, 20, 20))

Merged chunks!

```

And then I went down the rabbit hole (ok it's not that deep) and is all goes down here: https://github.com/pydata/xarray/blob/e0358e586079c12525ce60c4a51b591dc280713b/xarray/core/variable.py#L1507

In Variable._stack_one the stacking is performed and Variable.data.reshape is called. Dask itself is rechunking the output, merging the chunks. There is a merge_chunks kwarg for reshape, but I think it has a bug:

```python

Let's stack as xarray does: x, z, y -> x, zy

data_t = data.transpose(2, 0, 1) # Dask array with shape (30, 10, 20), the same as reordered in Variable._stack_once.

new_data = data_t.reshape((30, -1), merge_chunks=True) # True is the default, this is the same call as in xarray new_data.chunks

((30,), (20, 20, 20, 20, 20, 20, 20, 20, 20, 20))

new_data = data_t.reshape((30, -1), merge_chunks=False) new_data.shape # I'm printing shape because chunks is too large, but see the bug:

(30, 6000) # instead of (30, 200)!!!

Doesn't happen when we do not transpose. So let's reshape data as z, y, x -> zy, x

new_data = data.reshape((-1, 30), merge_chunks=True) new_data.chunks

((5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5), (30,))

Chunks were not merged? But this is the output expected by paigem.

new_data = data.reshape((-1, 30), merge_chunks=False) new_data.chunks

((5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5), (30,))

That's what I expected with merge_chunks=False.

```

For polyfit itself, the apply_along_axis call could be changed to a apply_ufunc with vectorize=True, I think this would avoid the problem and behave the same on the user's side. Would need some refactoring.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unexpected chunking of 3d DataArray in `polyfit()` 732910109
819570900 https://github.com/pydata/xarray/issues/5155#issuecomment-819570900 https://api.github.com/repos/pydata/xarray/issues/5155 MDEyOklzc3VlQ29tbWVudDgxOTU3MDkwMA== aulemahal 20629530 2021-04-14T14:40:14Z 2021-04-14T14:40:14Z CONTRIBUTOR

@aaronspring Oh, I didn't think of that trick for 1, thanks! But again, this fails with numpy-backed time coordinates. With the definition of a "default" calendar, there could be a more general way.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Calendar utilities 857947050
793057577 https://github.com/pydata/xarray/issues/5010#issuecomment-793057577 https://api.github.com/repos/pydata/xarray/issues/5010 MDEyOklzc3VlQ29tbWVudDc5MzA1NzU3Nw== aulemahal 20629530 2021-03-08T20:35:01Z 2021-03-08T20:35:01Z CONTRIBUTOR

Dang. How did I miss that?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArrays inside apply_ufunc with dask=parallelized 824917345
771120951 https://github.com/pydata/xarray/issues/4853#issuecomment-771120951 https://api.github.com/repos/pydata/xarray/issues/4853 MDEyOklzc3VlQ29tbWVudDc3MTEyMDk1MQ== aulemahal 20629530 2021-02-01T20:03:04Z 2021-02-01T20:03:04Z CONTRIBUTOR

Woups, the bug seems more important than I first thought. It happens when reading files: MWE: ```python import xarray as xr

da = xr.DataArray( [0, 1, 2], dims=('time',), coords={'time': xr.cftime_range('2000-01-01', freq='D', periods=3, calendar='noleap')}, name='test' ) da.to_netcdf('test.nc')

da2 = xr.open_dataset('test.nc') da2.indexes['time'] Fails with an error similar to the example above. Also failing on :python da2.sel(time='2000') ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  cftime default's datetime breaks CFTimeIndex 798592803
700076657 https://github.com/pydata/xarray/issues/4463#issuecomment-700076657 https://api.github.com/repos/pydata/xarray/issues/4463 MDEyOklzc3VlQ29tbWVudDcwMDA3NjY1Nw== aulemahal 20629530 2020-09-28T15:22:23Z 2020-09-28T15:22:23Z CONTRIBUTOR

Oh! I should have thought of this. The error message is indeed unclear... I'll close the issue as the problem is solved, but I'll note that: python3 da.sel(y=dy, x=dx, method='nearest') does work, without the need to explicitly pass the shared dimension t. This is why I expected that interp would work the same.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Interpolation with multiple mutlidimensional arrays sharing dims fails 709272776
698462962 https://github.com/pydata/xarray/issues/4058#issuecomment-698462962 https://api.github.com/repos/pydata/xarray/issues/4058 MDEyOklzc3VlQ29tbWVudDY5ODQ2Mjk2Mg== aulemahal 20629530 2020-09-24T16:50:10Z 2020-09-24T16:50:10Z CONTRIBUTOR

It doesn't work with 0.16.0, but does with later versions (just tried with the current master). Thanks!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Interpolating with a common chunked dim fails 617704483
696845767 https://github.com/pydata/xarray/issues/4375#issuecomment-696845767 https://api.github.com/repos/pydata/xarray/issues/4375 MDEyOklzc3VlQ29tbWVudDY5Njg0NTc2Nw== aulemahal 20629530 2020-09-22T16:50:26Z 2020-09-22T16:50:26Z CONTRIBUTOR

I did encounter this when writing up polyfit! I decided to discard that for the time being, but I believe changing get_clean_interp_index would the best way to fix this. One would also need to modify polyfit sligthly, though. Here: https://github.com/pydata/xarray/blob/9c85dd5f792805bea319f01f08ee51b83bde0f3b/xarray/core/dataset.py#L6064-L6075 When the non-fitted dimensions are stacked together, dim should be renamed to the real dimension of the variable. I will not have time to make a PR, but it should be quite simple, if anyone has time!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  allow using non-dimension coordinates in polyfit 685739084
675046525 https://github.com/pydata/xarray/pull/4193#issuecomment-675046525 https://api.github.com/repos/pydata/xarray/issues/4193 MDEyOklzc3VlQ29tbWVudDY3NTA0NjUyNQ== aulemahal 20629530 2020-08-17T18:42:51Z 2020-08-17T18:42:51Z CONTRIBUTOR

@mathause Fixed the tests to catch the warning and added a case for the specific of the issue : too many nans causing a rank deficiency.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix polyfit fail on deficient rank 650044968
674153884 https://github.com/pydata/xarray/pull/4193#issuecomment-674153884 https://api.github.com/repos/pydata/xarray/issues/4193 MDEyOklzc3VlQ29tbWVudDY3NDE1Mzg4NA== aulemahal 20629530 2020-08-14T16:23:12Z 2020-08-14T16:23:35Z CONTRIBUTOR

So while adding tests, I realized there were more bugs concerning deficient rank matrices and full=True output. I believe I fixed all I could find. However, I was not able to reduce the number of warnings for the case using dask : the computation occurs outside of the catch_warnings() context... Also, there is a bug in the dask.array.linalg.lstsq output (see issue dask/dask#6516), so if full=True we must use skipna=True with dask. Same when rank != order (deficient rank), dask.array.linalg.lstsq will fail, so we work around by using our (slower) nan-skipping method.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix polyfit fail on deficient rank 650044968
668264540 https://github.com/pydata/xarray/issues/4300#issuecomment-668264540 https://api.github.com/repos/pydata/xarray/issues/4300 MDEyOklzc3VlQ29tbWVudDY2ODI2NDU0MA== aulemahal 20629530 2020-08-03T22:05:25Z 2020-08-03T22:05:25Z CONTRIBUTOR

My comments Q.1 : For now xr.apply_ufunc does not accept core dimensions to be chunked along, which would be kinda a sad for curve fitting. However, dask's least square method does, which is part of the reason why I used it in polyfit. On the other hand, scipy's least-squares procedure is not simple. Curve fitting is quite complex and rewriting all the code to use dask might be a project too ambitious, and surely out-of-scope for xarray...

Q.3 : For simple directly declared function, inspect does a good job, but it can get tricky with wrapped functions, which might arise in more complex workflows. Could we have a params arg that takes in a list of names?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  General curve fitting method 671609109
634215961 https://github.com/pydata/xarray/pull/4033#issuecomment-634215961 https://api.github.com/repos/pydata/xarray/issues/4033 MDEyOklzc3VlQ29tbWVudDYzNDIxNTk2MQ== aulemahal 20629530 2020-05-26T19:01:36Z 2020-05-26T19:01:36Z CONTRIBUTOR

@spencerkclark Here you go! Tests added for all cases you mentioned.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.infer_freq 612846594
628857894 https://github.com/pydata/xarray/pull/4033#issuecomment-628857894 https://api.github.com/repos/pydata/xarray/issues/4033 MDEyOklzc3VlQ29tbWVudDYyODg1Nzg5NA== aulemahal 20629530 2020-05-14T20:02:34Z 2020-05-14T20:02:34Z CONTRIBUTOR

@spencerkclark Thanks for the feedback!

I rewrote the _CFTimeFrequencyInferer class independently of pandas private objects. I removed outputs that wouldn't match offsets defined in xarray: weekly frequencies, week-of-month (WOM) and all business-related anchors. It wouldn't be difficult to add them later on if need be and if cftime_offsets.py defines them. Note that infer_freq is quite independent of the rest of xarray, this choice was purely so that the behavior matches the rest of xr. I did leave the sub-seconds frequencies (L for ms and U for µs).

I expect the performance of xr.infer_freq to be slightly worst than pandas' since they use optimized and compiled code whereas I only used common numpy and xarray stuff. However, I assume that this part of the workflow is far from being the bottleneck of most xarray usecases...

Will write up some docs soon.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xr.infer_freq 612846594
603976716 https://github.com/pydata/xarray/pull/3733#issuecomment-603976716 https://api.github.com/repos/pydata/xarray/issues/3733 MDEyOklzc3VlQ29tbWVudDYwMzk3NjcxNg== aulemahal 20629530 2020-03-25T17:26:59Z 2020-03-25T17:26:59Z CONTRIBUTOR

Yay! Many thanks, this will greatly improve our projects.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 1,
    "eyes": 0
}
  Implementation of polyfit and polyval 557627188
603901324 https://github.com/pydata/xarray/pull/3733#issuecomment-603901324 https://api.github.com/repos/pydata/xarray/issues/3733 MDEyOklzc3VlQ29tbWVudDYwMzkwMTMyNA== aulemahal 20629530 2020-03-25T15:19:53Z 2020-03-25T15:19:53Z CONTRIBUTOR

Ping. It be green.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implementation of polyfit and polyval 557627188
581584469 https://github.com/pydata/xarray/issues/3349#issuecomment-581584469 https://api.github.com/repos/pydata/xarray/issues/3349 MDEyOklzc3VlQ29tbWVudDU4MTU4NDQ2OQ== aulemahal 20629530 2020-02-03T19:43:53Z 2020-02-03T19:43:53Z CONTRIBUTOR

I pushed a new PR trying to implement polyfit in xarray, #3733. It is still work in progress, but I would like the opinion on those who participated in this thread.

Considering all options discussed in the thread, I chose an implementation that seemed to give the best performance and generality (skipping NaN values), but it duplicates a lot of code from numpy.polyfit.

Main question:

  • Should xarray's implementation really replicate the behaviour of numpy's?

A lot of extra code could be removed if we'd say we only want to compute and return the residuals and the coefficients. All the other variables are a few lines of code away for the user that really wants them, and they don't need the power of xarray and dask anyway.

I'm guessing @huard @dcherian @rabernat and @shoyer might have comments.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implement polyfit? 499477363
580369935 https://github.com/pydata/xarray/pull/3733#issuecomment-580369935 https://api.github.com/repos/pydata/xarray/issues/3733 MDEyOklzc3VlQ29tbWVudDU4MDM2OTkzNQ== aulemahal 20629530 2020-01-30T17:39:54Z 2020-01-30T22:23:31Z CONTRIBUTOR

Oh dask="allowed", that's true! For the coeficients and residuals, I can easily do this stacking and unstacking and return only one variable. So, apply_ufunc could be used. However, it would not be very useful right now, considering they way I implemented the least-squares fit directly. Meaning: the left hand side computation and scaling and the not-fitted-dimensions stacking would be done on each call of numpy.polyfit if I did call it directly. Right now, we save some of this overhead by doing it once before iterating on 1d axes (which is anyway needed with skipna=True).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Implementation of polyfit and polyval 557627188

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 28.738ms · About: xarray-datasette