home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 326548654

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/1514#issuecomment-326548654 https://api.github.com/repos/pydata/xarray/issues/1514 326548654 MDEyOklzc3VlQ29tbWVudDMyNjU0ODY1NA== 5700886 2017-09-01T10:35:41Z 2017-09-01T10:35:41Z CONTRIBUTOR

Thanks @shoyer!

I like the shorter example. It shows the essence of why pathlib is such a nice thing.

Is there anything more to do in this PR?

Am 31. August 2017 17:48:24 schrieb Stephan Hoyer notifications@github.com:

shoyer approved this pull request.

@@ -21,9 +21,38 @@ v0.9.7 (unreleased) Enhancements ~~~~~~~~~~~~

+- Support for pathlib.Path objects added to

I just pushed a commit to add this

  • .. ipython::
  • :verbatim:
  • In [1]: import xarray as xr +
  • In [2]: from pathlib import Path # In Python 2, use pathlib2! +
  • In [3]: data_dir = Path("data/") +
  • In [4]: one_file = data_dir / "dta_for_month_01.nc" +
  • In [5]: print(xr.open_dataset(one_file))
  • Out[5]:
  • <xarray.Dataset>
  • [...] +
  • In [6]: all_files = data_dir.glob("dta_for_month_*.nc")

I removed this example from What's New for two reason: 1. The section was getting a little longer than essential 2. It's actually a bit of an anti-pattern, since the order of paths matters to xarray but is arbtirary from glob. The right way to write this is sorted(data_dir.glob(...)).

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/pydata/xarray/pull/1514#pullrequestreview-59903100

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  251734482
Powered by Datasette · Queries took 83.795ms · About: xarray-datasette