home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where comments = 3, type = "issue" and user = 14371165 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
792639470 MDU6SXNzdWU3OTI2Mzk0NzA= 4839 Coordinate attributes are dropped when interpolating datasets Illviljan 14371165 closed 0     3 2021-01-23T20:05:33Z 2021-04-27T07:00:08Z 2021-04-27T07:00:08Z MEMBER      

What happened: When I was interpolating datasets I noticed that the coordinate variables disappeared.

What you expected to happen: Coordinate attributes should be retained just like variables are.

Minimal Complete Verifiable Example:

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

names = np.core.defchararray.add("long_variable_name", np.arange(0, 2).astype(str)) coords = dict(time=np.array([0, 1])) data_vars = dict() for v in names: data_vars[v] = xr.Variable( "time", np.array([0, 1], dtype=int), attrs=dict(unit="kg") ) ds1 = xr.Dataset(data_vars=data_vars, coords=coords) ds1.attrs = { k: 2 for k in np.core.defchararray.add("attr_", np.arange(0, 3).astype(str)) } ds1.time.attrs.update(unit="s")

Print time:

ds1.time Out[115]: <xarray.DataArray 'time' (time: 2)> array([0, 1]) Coordinates: * time (time) int32 0 1 Attributes: unit: s

Interpolate:

ds1 = ds1.interp( time=np.array([0, 0.5, 1, 2]), assume_sorted=True, method="linear", kwargs=dict(fill_value="extrapolate"), )

Print interpolated time, units are lost:

ds1.time Out[117]: <xarray.DataArray 'time' (time: 4)> array([0. , 0.5, 1. , 2. ]) Coordinates: * time (time) float64 0.0 0.5 1.0 2. ```

Anything else we need to know?:

Environment:

Output of <tt>xr.show_versions()</tt> xr.show_versions() INSTALLED VERSIONS ------------------ commit: None python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel byteorder: little libhdf5: 1.10.4 libnetcdf: None xarray: 0.16.2 pandas: 1.2.0 numpy: 1.17.5 scipy: 1.4.1 netCDF4: None pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2020.12.0 distributed: 2020.12.0 matplotlib: 3.3.2 cartopy: None seaborn: 0.11.1 numbagg: None pint: None setuptools: 51.1.2.post20210112 pip: 20.3.3 conda: 4.9.2 pytest: 6.2.1 IPython: 7.19.0 sphinx: 3.4.3
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4839/reactions",
    "total_count": 0,
    "+1": 0,
    "-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 42.766ms · About: xarray-datasette