home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

4 rows where comments = 4, repo = 13221727 and "updated_at" is on date 2022-04-18 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: author_association, created_at (date), updated_at (date), closed_at (date)

type 2

  • issue 3
  • pull 1

state 2

  • closed 3
  • open 1

repo 1

  • xarray · 4 ✖
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
1207399616 PR_kwDOAMm_X842YT9J 6501 HTML repr fix for Furo Sphinx theme kmpaul 11411331 closed 0     4 2022-04-18T20:03:01Z 2022-04-18T21:05:43Z 2022-04-18T20:53:43Z CONTRIBUTOR   0 pydata/xarray/pulls/6501
  • [x] Closes #6500
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6501/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
630573329 MDU6SXNzdWU2MzA1NzMzMjk= 4121 decode_cf doesn't work for ancillary_variables in attributes zxdawn 30388627 closed 0     4 2020-06-04T07:18:34Z 2022-04-18T15:56:22Z 2022-04-18T15:56:22Z NONE      

Sometimes we have one attribute called ancillary_variables which is a list containing several strings. It would be useful to decode them.

MCVE Code Sample

```python import numpy as np import xarray as xr import pandas as pd

temp = 15 + 8 * np.random.randn(2, 2, 3) precip = 10 * np.random.rand(2, 2, 3)

temp = xr.DataArray(temp, dims=['x', 'y', 'time']) precip = xr.DataArray(precip, dims=['x', 'y', 'time'])

lon = [[-99.83, -99.32], [-99.79, -99.23]] lat = [[42.25, 42.21], [42.63, 42.59]]

temp.attrs['ancillary_variables'] = ['precip'] precip.attrs['ancillary_variables'] = ['temp']

ds = xr.Dataset({'temperature': temp, 'precipitation': precip}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'time': pd.date_range('2014-09-06', periods=3), 'reference_time': pd.Timestamp('2014-09-05')})

ds.to_netcdf('test_ancillary_variables.nc', engine='netcdf4')

ds_new = xr.open_dataset('test_ancillary_variables.nc', decode_cf=True) print(ds_new['temperature']) ```

Expected Output

...... Attributes: ancillary_variables: [<xarray.DataArray (x: 2, y: 2, time: 3)> ......... ]

Versions

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: None python: 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 23:03:20) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.9.0-8-amd64 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: en_US.utf8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.1 pandas: 1.0.4 numpy: 1.18.4 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: 2.4.0 cftime: 1.1.3 nc_time_axis: None PseudoNetCDF: None rasterio: 1.1.5 cfgrib: None iris: None bottleneck: None dask: 2.14.0 distributed: 2.17.0 matplotlib: 3.2.1 cartopy: 0.18.0 seaborn: None numbagg: None setuptools: 47.1.1.post20200529 pip: 20.1.1 conda: None pytest: None IPython: None sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4121/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
474463902 MDU6SXNzdWU0NzQ0NjM5MDI= 3169 Plotting inconsistencies with Cartopy andreas-h 358378 closed 0     4 2019-07-30T09:06:15Z 2022-04-18T15:49:12Z 2022-04-18T15:49:12Z CONTRIBUTOR      

I'm on xarray 0.11.3, and currently do not have the possibility to test on master. However, the commit history suggests that this issue still exists. Please accept my apologies if I missed something.

I'm following the plotting documentation at https://xarray.pydata.org/en/stable/plotting.html#maps

When plotting two maps in the same call (exactly as written in the documentation),

p = air.isel(time=[0, 1]).plot(transform=ccrs.PlateCarree(), col='time',
                               subplot_kws={'projection': ccrs.Orthographic(-80, 35)})

for ax in p.axes.flat:
    ax.coastlines()
    ax.gridlines()

everything works fine.

However, when I only want to plot one map,

p = air.isel(time=[0]).plot(transform=ccrs.PlateCarree(),
                            subplot_kws={'projection': ccrs.Orthographic(-80, 35)})

for ax in p.axes.flat:
    ax.coastlines()
    ax.gridlines()

I get the following error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-63-2c5a2a533878> in <module>
      1 p = air.isel(time=[0]).plot(transform=ccrs.PlateCarree(),
----> 2                             subplot_kws={'projection': ccrs.Orthographic(-80, 35)})
      3 
      4 for ax in p.axes.flat:
      5     ax.coastlines()

/home/jupyterhub/conda/envs/prod/lib/python3.6/site-packages/xarray/plot/plot.py in __call__(self, **kwargs)
    550 
    551     def __call__(self, **kwargs):
--> 552         return plot(self._da, **kwargs)
    553 
    554     @functools.wraps(hist)

/home/jupyterhub/conda/envs/prod/lib/python3.6/site-packages/xarray/plot/plot.py in plot(darray, row, col, col_wrap, ax, hue, rtol, subplot_kws, **kwargs)
    185     kwargs['ax'] = ax
    186 
--> 187     return plotfunc(darray, **kwargs)
    188 
    189

/home/jupyterhub/conda/envs/prod/lib/python3.6/site-packages/xarray/plot/plot.py in newplotfunc(darray, x, y, figsize, size, aspect, ax, row, col, col_wrap, xincrease, yincrease, add_colorbar, add_labels, vmin, vmax, cmap, center, robust, extend, levels, infer_intervals, colors, subplot_kws, cbar_ax, cbar_kwargs, xscale, yscale, xticks, yticks, xlim, ylim, norm, **kwargs)
    852                              vmax=cmap_params['vmax'],
    853                              norm=cmap_params['norm'],
--> 854                              **kwargs)
    855 
    856         # Label the plot with metadata

/home/jupyterhub/conda/envs/prod/lib/python3.6/site-packages/xarray/plot/plot.py in pcolormesh(x, y, z, ax, infer_intervals, **kwargs)
   1106             y = _infer_interval_breaks(y, axis=0)
   1107 
-> 1108     primitive = ax.pcolormesh(x, y, z, **kwargs)
   1109 
   1110     # by default, pcolormesh picks "round" values for bounds

/home/jupyterhub/conda/envs/prod/lib/python3.6/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
   1808                         "the Matplotlib list!)" % (label_namer, func.__name__),
   1809                         RuntimeWarning, stacklevel=2)
-> 1810             return func(ax, *args, **kwargs)
   1811 
   1812         inner.__doc__ = _add_data_doc(inner.__doc__,

/home/jupyterhub/conda/envs/prod/lib/python3.6/site-packages/matplotlib/axes/_axes.py in pcolormesh(self, alpha, norm, cmap, vmin, vmax, shading, antialiased, *args, **kwargs)
   6011         if (not isinstance(t, mtransforms.Transform) and
   6012             hasattr(t, '_as_mpl_transform')):
-> 6013             t = t._as_mpl_transform(self.axes)
   6014 
   6015         if t and any(t.contains_branch_seperately(self.transData)):

lib/cartopy/_crs.pyx in cartopy._crs.CRS._as_mpl_transform()

ValueError: Axes should be an instance of GeoAxes, got <class 'matplotlib.axes._subplots.AxesSubplot'>

It is not clear (from the user perspective) why one should work and the other should not.

Of course I can create the axes instance before using xarray's plot function, but it would be nicer if I wouldn't have to.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3169/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
309686915 MDU6SXNzdWUzMDk2ODY5MTU= 2027 square-bracket slice a Dataset with a DataArray crusaderky 6213168 open 0     4 2018-03-29T09:39:57Z 2022-04-18T03:51:25Z   MEMBER      

Given this: ``` ds = xarray.Dataset( data_vars={ 'vote': ('pupil', [5, 7, 8]), 'age': ('pupil', [15, 14, 16]) }, coords={ 'pupil': ['Alice', 'Bob', 'Charlie'] })

<xarray.Dataset> Dimensions: (pupil: 3) Coordinates: * pupil (pupil) <U7 'Alice' 'Bob' 'Charlie' Data variables: vote (pupil) int64 5 7 8 age (pupil) int64 15 14 16 ```

Why does this work: ``` ds.age[ds.vote >= 6]

<xarray.DataArray 'age' (pupil: 2)> array([14, 16]) Coordinates: * pupil (pupil) <U7 'Bob' 'Charlie' ```

But this doesn't? ``` ds[ds.vote >= 6]

KeyError: False `ds.vote >= 6`` is a DataArray with dims=('pupil', ) and dtype=bool, so I can't think of any ambiguity in what I want to achieve?

Workaround: ``` ds.sel(pupil=ds.vote >= 6)

<xarray.Dataset> Dimensions: (pupil: 2) Coordinates: * pupil (pupil) <U7 'Bob' 'Charlie' Data variables: vote (pupil) int64 7 8 age (pupil) int64 14 16 ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2027/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

CSV options:

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