home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where assignee = 43316012 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue 1

state 1

  • closed 1

repo 1

  • xarray 1
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
1405752975 I_kwDOAMm_X85TyhaP 7156 Plotting empty DataArray oddly raises ImportError derhintze 25172489 closed 0 headtr1ck 43316012   7 2022-10-12T08:00:13Z 2022-10-28T16:44:32Z 2022-10-28T16:44:32Z NONE      

What happened?

When calling the xarray.DataArray.plot() method on empty DataArrays raises an ImportError about a required, but missing, nc-time-axis package. This is at least confusing.

What did you expect to happen?

Either a more appropriate exception (to the effect of "don't try to plot nothing plz"). Or just get an empty plot returned.

Minimal Complete Verifiable Example

```Python

import xarray as xr xr.DataArray([]) <xarray.DataArray (dim_0: 0)> array([], dtype=float64) Dimensions without coordinates: dim_0 xr.DataArray([]).plot() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "foo/env/lib/python3.9/site-packages/xarray/plot/plot.py", line 866, in call return plot(self._da, kwargs) File "foo/env/lib/python3.9/site-packages/xarray/plot/plot.py", line 332, in plot return plotfunc(darray, kwargs) File "foo/env/lib/python3.9/site-packages/xarray/plot/plot.py", line 438, in line _ensure_plottable(xplt_val, yplt_val) File "foo/env/lib/python3.9/site-packages/xarray/plot/utils.py", line 648, in _ensure_plottable raise ImportError( ImportError: Plotting of arrays of cftime.datetime objects or arrays indexed by cftime.datetime objects requires the optional nc-time-axis (v1.2.0 or later) package. ```

MVCE confirmation

  • [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [X] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [ ] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

INSTALLED VERSIONS ------------------ commit: None python: 3.9.10 (main, Mar 15 2022, 15:56:56) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 3.10.0-1160.49.1.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.0 libnetcdf: 4.7.4 xarray: 0.21.1 pandas: 1.4.0 numpy: 1.21.5 scipy: 1.8.1 netCDF4: 1.5.8 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.5.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: 3.5.1 cartopy: None seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None setuptools: 49.2.1 pip: 22.2.2 conda: None pytest: 7.1.2 IPython: 8.0.1 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7156/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 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 7216.101ms · About: xarray-datasette