issues
4 rows where comments = 1, state = "open" and user = 20629530 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
| id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at ▲ | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 991544027 | MDExOlB1bGxSZXF1ZXN0NzI5OTkzMTE0 | 5781 | Add encodings to save_mfdataset | aulemahal 20629530 | open | 0 | 1 | 2021-09-08T21:24:13Z | 2022-10-06T21:44:18Z | CONTRIBUTOR | 0 | pydata/xarray/pulls/5781 |
Simply add a |
{
"url": "https://api.github.com/repos/pydata/xarray/issues/5781/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
xarray 13221727 | pull | ||||||
| 906175200 | MDExOlB1bGxSZXF1ZXN0NjU3MjA1NTM2 | 5402 | `dt.to_pytimedelta` to allow arithmetic with cftime objects | aulemahal 20629530 | open | 0 | 1 | 2021-05-28T22:48:50Z | 2022-06-09T14:50:16Z | CONTRIBUTOR | 0 | pydata/xarray/pulls/5402 |
When playing with cftime objects a problem I encountered many times is that I can sub two arrays and them add it back to another. Subtracting to cftime datetime arrays result in an array of Example: ```python import xarray as xr da = xr.DataArray(xr.cftime_range('1900-01-01', freq='D', periods=10), dims=('time',)) An array of timedelta64[ns]dt = da - da[0] da[-1] + dt # Fails ``` However, if the two arrays were of 'O' dtype, then the subtraction would be made by This solution here adds a The user still has to check if the data is in cftime or numpy to adapt the operation (calling Also, this doesn't work with dask arrays because loading a dask array triggers the variable constructor and thus recasts the array of I realize I maybe should have opened an issue before, but I had this idea and it all rushed along. |
{
"url": "https://api.github.com/repos/pydata/xarray/issues/5402/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
xarray 13221727 | pull | ||||||
| 969079775 | MDU6SXNzdWU5NjkwNzk3NzU= | 5701 | Performance issues using map_blocks with cftime indexes. | aulemahal 20629530 | open | 0 | 1 | 2021-08-12T15:47:29Z | 2022-04-19T02:44:37Z | CONTRIBUTOR | What happened:
When using What you expected to happen: I would understand a performance difference since numpy/pandas objects are usually more optimized than cftime/xarray objects, but the difference is quite large here. Minimal Complete Verifiable Example: Here is a MCVE that I ran in a jupyter notebook. Performance is basically measured by execution time (wall time). I included the current workaround I have for my usecase. ```python import numpy as np import pandas as pd import xarray as xr import dask.array as da from dask.distributed import Client c = Client(n_workers=1, threads_per_worker=8) Test DataNt = 10_000 Nx = Ny = 100 chks = (Nt, 10, 10) A = xr.DataArray( da.zeros((Nt, Ny, Nx), chunks=chks), dims=('time', 'y', 'x'), coords={'time': pd.date_range('1900-01-01', freq='D', periods=Nt), 'x': np.arange(Nx), 'y': np.arange(Ny) }, name='data' ) Copy of a, but with a cftime coordinateB = A.copy() B['time'] = xr.cftime_range('1900-01-01', freq='D', periods=Nt, calendar='noleap') A dumb function to applydef func(data): return data + data Test 1 : numpy-backed time coordinate%time outA = A.map_blocks(func, template=A) # %time outA.load(); Res on my machine:CPU times: user 130 ms, sys: 6.87 ms, total: 136 msWall time: 127 msCPU times: user 3.01 s, sys: 8.09 s, total: 11.1 sWall time: 13.4 sTest 2 : cftime-backed time coordinate%time outB = B.map_blocks(func, template=B) %time outB.load(); Res on my machineCPU times: user 4.42 s, sys: 219 ms, total: 4.64 sWall time: 4.48 sCPU times: user 13.2 s, sys: 3.1 s, total: 16.3 sWall time: 26 sWorkaround in my codedef func_cf(data): data['time'] = xr.decode_cf(data.coords.to_dataset()).time return data + data def map_blocks_cf(func, data): data2 = data.copy() data2['time'] = xr.conventions.encode_cf_variable(data.time) return data2.map_blocks(func, template=data) Test 3 : cftime time coordinate with encoding-decoding%time outB2 = map_blocks_cf(func_cf, B) %time outB2.load(); ResCPU times: user 536 ms, sys: 10.5 ms, total: 546 msWall time: 528 msCPU times: user 9.57 s, sys: 2.23 s, total: 11.8 sWall time: 21.7 s``` Anything else we need to know?:
After exploration I found 2 culprits for this slowness. I used
My workaround is not the best, but it was easy to code without touching xarray. The encoding of the time coordinate changes it to an integer array, which is super fast to tokenize. And the speed up of the construction phase is because there is only one call to I do not know for sure how/why this tokenization works, but I guess the best improvment in xarray could be to:
- Look into the inputs of I have no idea if that would work, but if it does that would be the best speed-up I think. Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:39:48) [GCC 9.3.0] python-bits: 64 OS: Linux OS-release: 3.10.0-514.2.2.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_CA.UTF-8 LOCALE: ('en_CA', 'UTF-8') libhdf5: 1.10.6 libnetcdf: 4.7.4 xarray: 0.19.1.dev18+g4bb9d9c.d20210810 pandas: 1.3.1 numpy: 1.21.1 scipy: 1.7.0 netCDF4: 1.5.6 pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.8.3 cftime: 1.5.0 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2021.07.1 distributed: 2021.07.1 matplotlib: 3.4.2 cartopy: 0.19.0 seaborn: None numbagg: None pint: 0.17 setuptools: 49.6.0.post20210108 pip: 21.2.1 conda: None pytest: None IPython: 7.25.0 sphinx: None |
{
"url": "https://api.github.com/repos/pydata/xarray/issues/5701/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
xarray 13221727 | issue | ||||||||
| 1035607476 | I_kwDOAMm_X849uh20 | 5897 | ds.mean bugs with cftime objects | aulemahal 20629530 | open | 0 | 1 | 2021-10-25T21:55:12Z | 2021-10-27T14:51:07Z | CONTRIBUTOR | What happened:
Given a dataset that has a variable with cftime objects along dimension A, averaging (
What you expected to happen:
And I expected the average to work (not drop the var) in the case of the numpy backend.
Minimal Complete Verifiable Example: ```python Put your MCVE code hereimport xarray as xr ds = xr.Dataset({ 'var1': (('time',), xr.cftime_range('2021-10-31', periods=10, freq='D')), 'var2': (('x',), list(range(10))) }) var1 contains cftime objectsvar2 contains integersThey do not share dimsds.mean('time') # var1 has disappeared instead of being averaged ds.mean('x') # Everything ok dsc = ds.chunk({}) dsc.mean('time') # var1 has disappeared. I would expected this line to fail. dsc.mean('x') # Raises NotImplementedError. I would expect this line to run flawlessly. ``` Anything else we need to know?: A culprit is #5393, but maybe the bug is older? I think the change introduced there causes the issue (2) above. In Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: fdabf3bea5c750939a4a2ae60f80ed34a6aebd58 python: 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 5.14.12-arch1-1 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: fr_CA.utf8 LOCALE: ('fr_CA', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 0.19.1.dev89+gfdabf3be pandas: 1.3.4 numpy: 1.21.3 scipy: 1.7.1 netCDF4: 1.5.7 pydap: installed h5netcdf: 0.11.0 h5py: 3.4.0 Nio: None zarr: 2.10.1 cftime: 1.5.1 nc_time_axis: 1.4.0 PseudoNetCDF: installed rasterio: 1.2.10 cfgrib: 0.9.9.1 iris: 3.1.0 bottleneck: 1.3.2 dask: 2021.10.0 distributed: 2021.10.0 matplotlib: 3.4.3 cartopy: 0.20.1 seaborn: 0.11.2 numbagg: 0.2.1 fsspec: 2021.10.1 cupy: None pint: 0.17 sparse: 0.13.0 setuptools: 58.2.0 pip: 21.3.1 conda: None pytest: 6.2.5 IPython: 7.28.0 sphinx: None |
{
"url": "https://api.github.com/repos/pydata/xarray/issues/5897/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
xarray 13221727 | issue |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issues] (
[id] INTEGER PRIMARY KEY,
[node_id] TEXT,
[number] INTEGER,
[title] TEXT,
[user] INTEGER REFERENCES [users]([id]),
[state] TEXT,
[locked] INTEGER,
[assignee] INTEGER REFERENCES [users]([id]),
[milestone] INTEGER REFERENCES [milestones]([id]),
[comments] INTEGER,
[created_at] TEXT,
[updated_at] TEXT,
[closed_at] TEXT,
[author_association] TEXT,
[active_lock_reason] TEXT,
[draft] INTEGER,
[pull_request] TEXT,
[body] TEXT,
[reactions] TEXT,
[performed_via_github_app] TEXT,
[state_reason] TEXT,
[repo] INTEGER REFERENCES [repos]([id]),
[type] TEXT
);
CREATE INDEX [idx_issues_repo]
ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
ON [issues] ([user]);