home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

7 rows where state = "closed" and user = 900941 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 2

  • issue 4
  • pull 3

state 1

  • closed · 7 ✖

repo 1

  • xarray 7
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
181534708 MDU6SXNzdWUxODE1MzQ3MDg= 1041 DataArray resample does not work if the time coordinate name is different from the corresponding dimension name. guziy 900941 closed 0     11 2016-10-06T21:49:47Z 2020-01-24T03:02:16Z 2020-01-24T03:02:16Z CONTRIBUTOR      

Please see the example below and the output it produces. And the exception is not really helpful...

``` python

from xarray import DataArray from datetime import datetime, timedelta

def main(): N = 48 data = range(N)

dates = [datetime(2001, 1, 1) + timedelta(hours=i) for i in range(N)]

# time variable is called the same as time dimension: works
scheme1 = {
    "dims": "t",
    "coords": {"t": {"dims": "t", "data": dates}},
    "data": data
}

# time variable is called differently from the time dimension: does not work
scheme2 = {
    "dims": "t",
    "coords": {"time": {"dims": "t", "data": dates}},
    "data": data
}

# Create DataArray objects using the above defined schemes a1 = DataArray.from_dict(scheme1) print(a1) print(a1.resample("D", "t")) print("=======================")

a2 = DataArray.from_dict(scheme2)
print(a2)
print(a2.resample("D", "t"))

if name == 'main': main() ```

Below is the output I get from running the script:

``` <xarray.DataArray (t: 48)> array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]) Coordinates: * t (t) datetime64[ns] 2001-01-01 2001-01-01T01:00:00 ... <xarray.DataArray (t: 2)> array([ 11.5, 35.5]) Coordinates: * t (t) datetime64[ns] 2001-01-01 2001-01-02 ======================= <xarray.DataArray (t: 48)> array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]) Coordinates: time (t) datetime64[ns] 2001-01-01 2001-01-01T01:00:00 ... * t (t) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... Traceback (most recent call last): File "/Users/huziy/skynet2/RESCUE/skynet3_rech1/huziy/Netbeans Projects/Python/RPN/src/demo/xarray/time_dim_and_ops.py", line 46, in <module> main() File "/Users/huziy/skynet2/RESCUE/skynet3_rech1/huziy/Netbeans Projects/Python/RPN/src/demo/xarray/time_dim_and_ops.py", line 38, in main print(a2.resample("D", "t")) File "/Users/huziy/virtualenvs/py3.4/lib/python3.4/site-packages/xarray/core/common.py", line 499, in resample gb = self.groupby_cls(self, group, grouper=time_grouper) File "/Users/huziy/virtualenvs/py3.4/lib/python3.4/site-packages/xarray/core/groupby.py", line 202, in init first_items = s.groupby(grouper).first() File "/Users/huziy/virtualenvs/py3.4/lib/python3.4/site-packages/pandas/core/generic.py", line 3974, in groupby kwargs) File "/Users/huziy/virtualenvs/py3.4/lib/python3.4/site-packages/pandas/core/groupby.py", line 1501, in groupby return klass(obj, by, kwds) File "/Users/huziy/virtualenvs/py3.4/lib/python3.4/site-packages/pandas/core/groupby.py", line 370, in init mutated=self.mutated) File "/Users/huziy/virtualenvs/py3.4/lib/python3.4/site-packages/pandas/core/groupby.py", line 2403, in _get_grouper binner, grouper, obj = key._get_grouper(obj) File "/Users/huziy/virtualenvs/py3.4/lib/python3.4/site-packages/pandas/tseries/resample.py", line 1061, in _get_grouper r = self._get_resampler(obj) File "/Users/huziy/virtualenvs/py3.4/lib/python3.4/site-packages/pandas/tseries/resample.py", line 1057, in _get_resampler "but got an instance of %r" % type(ax).name) TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Int64Index'

```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1041/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
206648586 MDU6SXNzdWUyMDY2NDg1ODY= 1258 selecting a point from an irregular grid? guziy 900941 closed 0     2 2017-02-09T22:26:06Z 2019-01-25T17:44:45Z 2019-01-25T17:44:45Z CONTRIBUTOR      

HI:

I was wondering if I have a dataarray based on 2d lon and lat fields is it possible to select values for selected lon and lat pairs?

Here is the schema of my DataArray:

python vardict = { "coords": { "t": {"dims": "t", "data": dates}, "lon": {"dims": ("x", "y"), "data": self.lons}, "lat": {"dims": ("x", "y"), "data": self.lats}, }, "dims": ("t", "x", "y"), "data": data_list, "name": varname_internal }

Is it possible to do smth like

python timeseries = da.sel(lon=-110, lat=65)

Cheers

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1258/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
272643261 MDU6SXNzdWUyNzI2NDMyNjE= 1706 Exception when using "python -OO .." guziy 900941 closed 0     1 2017-11-09T17:08:39Z 2017-11-12T04:51:14Z 2017-11-12T04:51:14Z CONTRIBUTOR      

Hi:

I've noticed that importing xarray fails when running a script using -OO option, as shown below.

``` $ python -OO test.py Traceback (most recent call last): File "test.py", line 2, in <module> import xarray File "/Users/huziy/anaconda/envs/py3.6/lib/python3.6/site-packages/xarray/init.py", line 10, in <module> from .core.extensions import (register_dataarray_accessor, File "/Users/huziy/anaconda/envs/py3.6/lib/python3.6/site-packages/xarray/core/extensions.py", line 7, in <module> from .dataarray import DataArray File "/Users/huziy/anaconda/envs/py3.6/lib/python3.6/site-packages/xarray/core/dataarray.py", line 10, in <module> from ..plot.plot import _PlotMethods File "/Users/huziy/anaconda/envs/py3.6/lib/python3.6/site-packages/xarray/plot/init.py", line 4, in <module> from .plot import (plot, line, contourf, contour, File "/Users/huziy/anaconda/envs/py3.6/lib/python3.6/site-packages/xarray/plot/plot.py", line 555, in <module> @_plot2d File "/Users/huziy/anaconda/envs/py3.6/lib/python3.6/site-packages/xarray/plot/plot.py", line 404, in _plot2d plotfunc.doc = '\n'.join((plotfunc.doc, commondoc)) TypeError: sequence item 0: expected str instance, NoneType found (py3.6) huziy at iMac-Sasha in ~/PythonProjects/xarray_playground

$ cat test.py

import xarray ```

# Paste the output here xr.show_versions() here In [2]: xr.__version__ Out[2]: '0.9.6' In [8]: sys.version Out[8]: '3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]'
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1706/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
264428281 MDExOlB1bGxSZXF1ZXN0MTQ1ODM3MTQ5 1623 Data vars in open mfdataset guziy 900941 closed 0     2 2017-10-11T01:24:04Z 2017-10-11T20:18:17Z 2017-10-11T20:18:11Z CONTRIBUTOR   0 pydata/xarray/pulls/1623
  • [x] Improves #1580
  • [x] Tests passed
  • [x] Passes git diff upstream/master | flake8 --diff
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1623/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
258884482 MDExOlB1bGxSZXF1ZXN0MTQxODk3MDQz 1580 data_vars option added to open_mfdataset guziy 900941 closed 0     7 2017-09-19T16:29:06Z 2017-10-10T22:33:50Z 2017-10-10T20:51:19Z CONTRIBUTOR   0 pydata/xarray/pulls/1580
  • [x] Closes #438
  • [x] Added tests (they are passing currently)
  • [x] Passes git diff upstream/master | flake8 --diff There were some long lines that in my opinion look better when not broken, but I complied with flake8 request to shorten them.

  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API (Do not think the change is big enough to be added to the files)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1580/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
260855459 MDExOlB1bGxSZXF1ZXN0MTQzMzA0NDgw 1595 remove the fontsize check in xarray.tests.test_plot.test_no_args, bec… guziy 900941 closed 0     1 2017-09-27T05:57:45Z 2017-09-27T23:13:40Z 2017-09-27T23:13:37Z CONTRIBUTOR   0 pydata/xarray/pulls/1595

…ause it can be greater than 12 for high-resolution screens

  • [x] Closes #1584
  • [ ] Tests passed Not sure why continuous integration checks are failing. Do not hink this is because of the change, since the master branch is also failing the continuous integration checks.
  • [x] Passes git diff upstream/master | flake8 --diff
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API Change is too small for whats-new.rst or api.rst.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1595/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
259606704 MDU6SXNzdWUyNTk2MDY3MDQ= 1584 Failing test, maybe it could be removed? guziy 900941 closed 0     3 2017-09-21T19:31:31Z 2017-09-27T23:13:37Z 2017-09-27T23:13:37Z CONTRIBUTOR      

Hi:

The test below is failing on my machine, but I am not sure what is its purpose. In my opinion, it could be removed. But maybe I am missing something.

``` xarray/tests/test_plot.py F xarray/tests/test_plot.py:1027 (TestFacetGrid.test_no_args) self = <xarray.tests.test_plot.TestFacetGrid testMethod=test_no_args>

@pytest.mark.slow
def test_no_args(self):
    self.g.map_dataarray(xplt.contourf, 'x', 'y')

    # Don't want colorbar labeled with 'None'
    alltxt = text_in_fig()
    self.assertNotIn('None', alltxt)

    for ax in self.g.axes.flat:
        self.assertTrue(ax.has_data())

        # default font size should be small
        fontsize = ax.title.get_size()
      self.assertLessEqual(fontsize, 12)

E AssertionError: 16.0 not less than or equal to 12

xarray/tests/test_plot.py:1041: AssertionError

```

Cheers

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1584/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 798.964ms · About: xarray-datasette