home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

28 rows where issue = 398041758 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 5

  • jbusecke 16
  • spencerkclark 5
  • dcherian 4
  • jhamman 2
  • pep8speaks 1

author_association 3

  • CONTRIBUTOR 16
  • MEMBER 11
  • NONE 1

issue 1

  • enable internal plotting with cftime datetime · 28 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
461895394 https://github.com/pydata/xarray/pull/2665#issuecomment-461895394 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MTg5NTM5NA== jhamman 2443309 2019-02-08T18:15:26Z 2019-02-08T18:15:26Z MEMBER

Thanks for this @jbusecke! Really excited to have this feature in Xarray now.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
461643876 https://github.com/pydata/xarray/pull/2665#issuecomment-461643876 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MTY0Mzg3Ng== dcherian 2448579 2019-02-08T00:11:19Z 2019-02-08T00:11:19Z MEMBER

thanks @jbusecke

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
461631993 https://github.com/pydata/xarray/pull/2665#issuecomment-461631993 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MTYzMTk5Mw== jbusecke 14314623 2019-02-07T23:18:24Z 2019-02-07T23:18:24Z CONTRIBUTOR

Is there anything else that I need to do at this point? Sorry for the xarray noob question...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
461414910 https://github.com/pydata/xarray/pull/2665#issuecomment-461414910 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MTQxNDkxMA== jbusecke 14314623 2019-02-07T13:18:07Z 2019-02-07T13:18:07Z CONTRIBUTOR

Awesome. Just added the line. Let me know if you think it is appropriate.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
457765661 https://github.com/pydata/xarray/pull/2665#issuecomment-457765661 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1Nzc2NTY2MQ== pep8speaks 24736507 2019-01-25T23:07:06Z 2019-02-07T13:16:55Z NONE

Hello @jbusecke! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. :beers:

Comment last updated on February 07, 2019 at 13:16 Hours UTC
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
461066722 https://github.com/pydata/xarray/pull/2665#issuecomment-461066722 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MTA2NjcyMg== jbusecke 14314623 2019-02-06T15:33:36Z 2019-02-06T15:33:36Z CONTRIBUTOR

Thanks. I updated the PR accordingly.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
460902688 https://github.com/pydata/xarray/pull/2665#issuecomment-460902688 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MDkwMjY4OA== jbusecke 14314623 2019-02-06T05:08:09Z 2019-02-06T05:08:09Z CONTRIBUTOR

Seems like the travis builds all pass, wohoo. Please let me know if anything else is needed.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
460803180 https://github.com/pydata/xarray/pull/2665#issuecomment-460803180 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MDgwMzE4MA== jbusecke 14314623 2019-02-05T21:05:17Z 2019-02-05T21:05:17Z CONTRIBUTOR

I think I have addressed all the above remarks (Many thanks for the thorough review and tips). Waiting for the CI again.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
460781687 https://github.com/pydata/xarray/pull/2665#issuecomment-460781687 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MDc4MTY4Nw== dcherian 2448579 2019-02-05T19:59:13Z 2019-02-05T19:59:13Z MEMBER

Can you also add line somewhere at the top of plotting.rst saying that cftime plotting is supported once nc-time-axis is installed?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
460777924 https://github.com/pydata/xarray/pull/2665#issuecomment-460777924 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MDc3NzkyNA== jbusecke 14314623 2019-02-05T19:47:56Z 2019-02-05T19:47:56Z CONTRIBUTOR

I am smh getting these errors in the backend part of the tests:

``` ======================================================== FAILURES ========================================================= _____ TestNetCDF3ViaNetCDF4Data.test_encoding_same_dtype ______

self = <xarray.tests.test_backends.TestNetCDF3ViaNetCDF4Data object at 0xd238d9a20>

def test_encoding_same_dtype(self):
    ds = Dataset({'x': ('y', np.arange(10.0, dtype='f4'))})
    kwargs = dict(encoding={'x': {'dtype': 'f4'}})
    with self.roundtrip(ds, save_kwargs=kwargs) as actual:
      assert actual.x.encoding['dtype'] == 'f4'

E AssertionError: assert dtype('>f4') == 'f4'

xarray/tests/test_backends.py:853: AssertionError _______ TestGenericNetCDFData.test_encoding_same_dtype ________

self = <xarray.tests.test_backends.TestGenericNetCDFData object at 0xd238e0588>

def test_encoding_same_dtype(self):
    ds = Dataset({'x': ('y', np.arange(10.0, dtype='f4'))})
    kwargs = dict(encoding={'x': {'dtype': 'f4'}})
    with self.roundtrip(ds, save_kwargs=kwargs) as actual:
      assert actual.x.encoding['dtype'] == 'f4'

E AssertionError: assert dtype('>f4') == 'f4'

xarray/tests/test_backends.py:853: AssertionError ``` They do not always show up...not sure what to make of it, but could be an issue with my local environment. Lets see if the CI shows this aswell.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
460774550 https://github.com/pydata/xarray/pull/2665#issuecomment-460774550 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MDc3NDU1MA== dcherian 2448579 2019-02-05T19:38:14Z 2019-02-05T19:38:14Z MEMBER

@jbusecke Can you also add nc_time_axis to print_versions() if it is installed?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
460744700 https://github.com/pydata/xarray/pull/2665#issuecomment-460744700 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ2MDc0NDcwMA== jbusecke 14314623 2019-02-05T18:14:42Z 2019-02-05T18:14:42Z CONTRIBUTOR

Ok I think I have most of the things covered. All test pass for me locally. What should I add to the whats-new.rst. I thought of something like this under Enhancements (or would this be considered a bug fix?): Internal plotting now supports cftime.datetime objects as time axis (@spencerkclark, @jbusecke)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
457792344 https://github.com/pydata/xarray/pull/2665#issuecomment-457792344 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1Nzc5MjM0NA== spencerkclark 6628425 2019-01-26T02:16:58Z 2019-01-26T02:16:58Z MEMBER

I think it would make sense to follow this example, but use cftime.datetime objects instead. You might want to add a test for a 2D plot just to be sure. https://github.com/pydata/xarray/blob/2e99c7dde32e396dd2c5fc6261a2d06217621e10/xarray/tests/test_plot.py#L1797-L1813 Note you'll also need to add nc-time-axis to some CI environments so that things run in some Travis/AppVeyor builds, probably best in: - ci/requirements-py37.yml - ci/requirements-py37-windows.yml

and add some decorators to skip the tests if the needed packages (cftime and nc-time-axis) are not installed. @requires_cftime already exists, but I think you'll have to write your own @requires_nc_time_axis decorator, which you can do, e.g., here: https://github.com/pydata/xarray/blob/2e99c7dde32e396dd2c5fc6261a2d06217621e10/xarray/tests/init.py#L65 Maybe by leaving nc-time-axis out of the py36 test environment (which has cftime) you can use it to test the error message if nc-time-axis is not installed?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
457785427 https://github.com/pydata/xarray/pull/2665#issuecomment-457785427 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1Nzc4NTQyNw== jbusecke 14314623 2019-01-26T01:02:47Z 2019-01-26T01:03:13Z CONTRIBUTOR

Great idea to simplify @spencerkclark. Thanks. Regarding the tests. I have removed the following:

``` @requires_cftime def test_plot_cftime_coordinate_error(): cftime = _import_cftime() time = cftime.num2date(np.arange(5), units='days since 0001-01-01', calendar='noleap') data = DataArray(np.arange(5), coords=[time], dims=['time']) with raises_regex(TypeError, 'requires coordinates to be numeric or dates'): data.plot()

@requires_cftime def test_plot_cftime_data_error(): cftime = _import_cftime() data = cftime.num2date(np.arange(5), units='days since 0001-01-01', calendar='noleap') data = DataArray(data, coords=[np.arange(5)], dims=['x']) with raises_regex(NotImplementedError, 'cftime.datetime'): data.plot() ``` And the test suite passes locally.

But I assume Ill have to add another test dataset with a cftime.datetime time-axis, which then gets dragged through all the plotting tests? Where would I have to put that in?

Many thanks for all the help

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
457768114 https://github.com/pydata/xarray/pull/2665#issuecomment-457768114 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1Nzc2ODExNA== jbusecke 14314623 2019-01-25T23:18:16Z 2019-01-25T23:21:13Z CONTRIBUTOR

I have quickly looked into the testing and found an oddity that might be important if nc-time-axis is not installed.

So in the definition of plot in plot.py I have changed

if contains_cftime_datetimes(darray): to if any([contains_cftime_datetimes(darray[dim]) for dim in darray.dims]): Because if I understand correctly, the previous statement only checks the dtype of the actual data, not the dimensions. Is this appropriate or am I misunderstanding the syntax? In my example above it doesnt matter, because this only spits out an error message when nc-time-axis is not available.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
457766633 https://github.com/pydata/xarray/pull/2665#issuecomment-457766633 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1Nzc2NjYzMw== jbusecke 14314623 2019-01-25T23:10:48Z 2019-01-25T23:10:48Z CONTRIBUTOR

Ok so the plotting works now with both timeseries and 2d data as follows

``` import xarray as xr import numpy as np %matplotlib inline

Create a simple line dataarray with cftime

time = xr.cftime_range(start='2000', periods=4, freq='1H', calendar='noleap') data = np.random.rand(len(time)) da = xr.DataArray(data, coords=[('time', time)]) da.plot() ![download](https://user-images.githubusercontent.com/14314623/51777752-6d427580-20cc-11e9-9c3d-a91d31b10312.png)

Check with 2d data

time = xr.cftime_range(start='2000', periods=6, freq='2MS', calendar='noleap') data2 = np.random.rand(len(time), 4) da2 = xr.DataArray(data2, coords=[('time', time), ('other', range(4))]) da2.plot() ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
457723510 https://github.com/pydata/xarray/pull/2665#issuecomment-457723510 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1NzcyMzUxMA== jbusecke 14314623 2019-01-25T20:51:30Z 2019-01-25T20:51:30Z CONTRIBUTOR

Cool. Ill give it a shot right now.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
457592632 https://github.com/pydata/xarray/pull/2665#issuecomment-457592632 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1NzU5MjYzMg== spencerkclark 6628425 2019-01-25T14:38:35Z 2019-01-25T14:38:35Z MEMBER

@jbusecke SciTools/nc-time-axis#42 has been merged, and a new release has been made (it's already available on conda-forge)! It would be great if you could update this PR to use this latest version of nc-time-axis -- you should no longer need to convert dates to CalendarDateTime objects.

Thanks again @lbdreyer for your help.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
457196788 https://github.com/pydata/xarray/pull/2665#issuecomment-457196788 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1NzE5Njc4OA== jbusecke 14314623 2019-01-24T13:30:24Z 2019-01-24T13:30:24Z CONTRIBUTOR

Sounds good to me.

Best

Julius On Jan 23, 2019, 12:56 PM -0500, Spencer Clark notifications@github.com, wrote:

I agree @dcherian; I just pinged the PR again, but if there is no activity there by this time next week, I think we should probably move forward here. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
456902372 https://github.com/pydata/xarray/pull/2665#issuecomment-456902372 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1NjkwMjM3Mg== spencerkclark 6628425 2019-01-23T17:55:52Z 2019-01-23T17:55:52Z MEMBER

I agree @dcherian; I just pinged the PR again, but if there is no activity there by this time next week, I think we should probably move forward here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
456894173 https://github.com/pydata/xarray/pull/2665#issuecomment-456894173 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1Njg5NDE3Mw== dcherian 2448579 2019-01-23T17:32:41Z 2019-01-23T17:32:41Z MEMBER

Looks like upstream hasn't moved. Maybe @jhamman and @spencerkclark can re-ping for a review there?

I am +0.5 on moving forward with an xarray workaround. It seems easy to remove once upstream makes all the required changes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
456883187 https://github.com/pydata/xarray/pull/2665#issuecomment-456883187 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1Njg4MzE4Nw== jbusecke 14314623 2019-01-23T17:02:14Z 2019-01-23T17:02:14Z CONTRIBUTOR

Is there still interest in this PR? Or did the upstream changes move ahead? I am finding myself explaining workarounds for this too students in the department, so maybe my time would be better invested getting this fix to the full community?

But obviously if things are going to be fixed upstream soon, I would devote time to other projects. Thoughts?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
453314045 https://github.com/pydata/xarray/pull/2665#issuecomment-453314045 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1MzMxNDA0NQ== spencerkclark 6628425 2019-01-11T00:16:49Z 2019-01-11T00:38:44Z MEMBER

I pinged the met-office folks about your PR. Hopefully that get's merged.

I appreciate it @jhamman; we'll see what happens there.

Oh shoot, I now remember seeing this. If this will be implemented soon I guess the PR can be discarded.

Or this PR could be amended :). We'd still need to make some changes to xarray along the lines of what you've started on here for the optional import of nc-time-axis, addition of cftime.datetime as a plottable type, and updates to the error messages.

Any chance you would have a quick solution for the pcolormesh plot error (second example in the PR)

CalendarDateTime objects are limited in the operations they support, e.g. >= is not supported, which is used in _infer_interval_breaks, which by default is called in xarray's pcolormesh. So this is one place in xarray where being able to use true cftime.datetime objects would really help. Otherwise you'd need to either wait to convert to CalendarDateTime until just before you passed data to a matplotlib function in xarray, or hack _infer_interval_breaks to make it compatible with input arrays of CalendarDateTime objects by converting to them cftime.datetime and back.

If you're in pinch I think things would work here if you passed infer_intervals=False as an argument to plot: python da2.plot(infer_intervals=False) though in general infer_intervals is used for a reason (see https://github.com/pydata/xarray/issues/781#issuecomment-191546524).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
453298775 https://github.com/pydata/xarray/pull/2665#issuecomment-453298775 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1MzI5ODc3NQ== jbusecke 14314623 2019-01-10T23:24:52Z 2019-01-10T23:24:52Z CONTRIBUTOR

Oh shoot, I now remember seeing this. If this will be implemented soon I guess the PR can be discarded. Any chance you would have a quick solution for the pcolormesh plot error (second example in the PR) @spencerkclark?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
453296921 https://github.com/pydata/xarray/pull/2665#issuecomment-453296921 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1MzI5NjkyMQ== jhamman 2443309 2019-01-10T23:19:42Z 2019-01-10T23:19:42Z MEMBER

@spencerkclark - I pinged the met-office folks about your PR. Hopefully that get's merged.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
453293382 https://github.com/pydata/xarray/pull/2665#issuecomment-453293382 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1MzI5MzM4Mg== spencerkclark 6628425 2019-01-10T23:09:10Z 2019-01-10T23:09:10Z MEMBER

Note I have a PR open in nc-time-axis, which enables plotting of cftime.datetime objects directly (without having to convert to CalendarDateTime objects). This would make this easier in xarray and elsewhere.

That said, I'm not sure if/when it will be merged, so it probably makes sense to go forward with this approach for now.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
453282855 https://github.com/pydata/xarray/pull/2665#issuecomment-453282855 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1MzI4Mjg1NQ== jbusecke 14314623 2019-01-10T22:38:47Z 2019-01-10T22:38:47Z CONTRIBUTOR

One of the more general questions I had was if we should expose the conversion using nc-time-axis in the public API. That way users could easily plot the data in matplotlib, e.g.: da_new = da.convert_cftime() plt.plot(da_new.time, da_new) Just an idea...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758
453280699 https://github.com/pydata/xarray/pull/2665#issuecomment-453280699 https://api.github.com/repos/pydata/xarray/issues/2665 MDEyOklzc3VlQ29tbWVudDQ1MzI4MDY5OQ== jbusecke 14314623 2019-01-10T22:31:48Z 2019-01-10T22:32:16Z CONTRIBUTOR

I have been along the lines of a short example. This works for timeseries data.

``` import xarray as xr import numpy as np %matplotlib inline

Create a simple line dataarray with cftime

time = xr.cftime_range(start='2000', periods=6, freq='2MS', calendar='noleap') data = np.random.rand(len(time)) da = xr.DataArray(data, coords=[('time', time)]) da.plot() ```

For pcolormesh plots this still fails.

```

Create a simple line dataarray with cftime

time = xr.cftime_range(start='2000', periods=6, freq='2MS', calendar='noleap') data2 = np.random.rand(len(time), 4) da2 = xr.DataArray(data2, coords=[('time', time), ('other', range(4))]) da2.plot() ```

--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-2-645c66b57bde> in <module> 3 data2 = np.random.rand(len(time), 4) 4 da2 = xr.DataArray(data2, coords=[('time', time), ('other', range(4))]) ----> 5 da2.plot() ~/Work/CODE/PYTHON/xarray/xarray/plot/plot.py in __call__(self, **kwargs) 585 586 def __call__(self, **kwargs): --> 587 return plot(self._da, **kwargs) 588 589 @functools.wraps(hist) ~/Work/CODE/PYTHON/xarray/xarray/plot/plot.py in plot(darray, row, col, col_wrap, ax, hue, rtol, subplot_kws, **kwargs) 220 kwargs['ax'] = ax 221 --> 222 return plotfunc(darray, **kwargs) 223 224 ~/Work/CODE/PYTHON/xarray/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) 887 vmax=cmap_params['vmax'], 888 norm=cmap_params['norm'], --> 889 **kwargs) 890 891 # Label the plot with metadata ~/Work/CODE/PYTHON/xarray/xarray/plot/plot.py in pcolormesh(x, y, z, ax, infer_intervals, **kwargs) 1135 (np.shape(y)[0] == np.shape(z)[0])): 1136 if len(y.shape) == 1: -> 1137 y = _infer_interval_breaks(y, check_monotonic=True) 1138 else: 1139 # we have to infer the intervals on both axes ~/Work/CODE/PYTHON/xarray/xarray/plot/plot.py in _infer_interval_breaks(coord, axis, check_monotonic) 1085 coord = np.asarray(coord) 1086 -> 1087 if check_monotonic and not _is_monotonic(coord, axis=axis): 1088 raise ValueError("The input coordinate is not sorted in increasing " 1089 "order along axis %d. This can lead to unexpected " ~/Work/CODE/PYTHON/xarray/xarray/plot/plot.py in _is_monotonic(coord, axis) 1069 n = coord.shape[axis] 1070 delta_pos = (coord.take(np.arange(1, n), axis=axis) >= -> 1071 coord.take(np.arange(0, n - 1), axis=axis)) 1072 delta_neg = (coord.take(np.arange(1, n), axis=axis) <= 1073 coord.take(np.arange(0, n - 1), axis=axis)) TypeError: '>=' not supported between instances of 'CalendarDateTime' and 'CalendarDateTime'

Perhaps @spencerkclark has an idea how to deal with differencing cftime.datetime objects?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  enable internal plotting with cftime datetime 398041758

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 11.451ms · About: xarray-datasette