home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

13 rows where user = 4414299 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 7

  • Incorrect y-coordinates for non-georeferenced data from open_rasterio 3
  • Rasterio tags are not accessible through open_rasterio 2
  • Parsing wavelength info from rasterio tags 2
  • Remove netCDF dependency from rasterio backend tests 2
  • Allow passing of positional arguments in `apply` for Groupby objects 2
  • Add names for test failures 1
  • Use rasterio's transform instead of homemade coordinates 1

user 1

  • maaleske · 13 ✖

author_association 1

  • CONTRIBUTOR 13
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
421936966 https://github.com/pydata/xarray/pull/2413#issuecomment-421936966 https://api.github.com/repos/pydata/xarray/issues/2413 MDEyOklzc3VlQ29tbWVudDQyMTkzNjk2Ng== maaleske 4414299 2018-09-17T09:08:07Z 2018-09-17T09:08:07Z CONTRIBUTOR

Thanks @spencerkclark, I had almost the exact same code already written but couldn't figure out the return value resample.apply needs from func to work. I added the tests to test_dataarray and test_dataset, since there doesn't appear to be a separate file for resample (as there is for groupby).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow passing of positional arguments in `apply` for Groupby objects 359449421
421821689 https://github.com/pydata/xarray/pull/2413#issuecomment-421821689 https://api.github.com/repos/pydata/xarray/issues/2413 MDEyOklzc3VlQ29tbWVudDQyMTgyMTY4OQ== maaleske 4414299 2018-09-16T19:51:44Z 2018-09-16T19:51:44Z CONTRIBUTOR

I added tests for groupby. I haven't used resampling so I'm struggling a bit to make a sensible dataset/array for a similar test of the resample method.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow passing of positional arguments in `apply` for Groupby objects 359449421
352397809 https://github.com/pydata/xarray/pull/1712#issuecomment-352397809 https://api.github.com/repos/pydata/xarray/issues/1712 MDEyOklzc3VlQ29tbWVudDM1MjM5NzgwOQ== maaleske 4414299 2017-12-18T11:17:33Z 2017-12-18T11:17:33Z CONTRIBUTOR

@fmaussion Seems okay to me. The rasterio version check is a bit iffy but I can't think of a way to do it better.

I do agree with @snowman2 though, having the coordinate generation separately exposed would be nice (and easier to write unit tests for). Something like ```python def xy_pixel_coordinates(nx, ny, transform=None) transform = Affine.identity if not transform else transform

# xarray coordinates are pixel centered
x, _ = (np.arange(nx)+0.5, np.zeros(nx)+0.5) * transform
_, y = (np.zeros(ny)+0.5, np.arange(ny)+0.5) * transform
return x,y

``` would probably suffice, though I don't know which module this would fall under. I'd imagine it might be useful for backends besides rasterio, though.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Use rasterio's transform instead of homemade coordinates  273268690
343766018 https://github.com/pydata/xarray/issues/1686#issuecomment-343766018 https://api.github.com/repos/pydata/xarray/issues/1686 MDEyOklzc3VlQ29tbWVudDM0Mzc2NjAxOA== maaleske 4414299 2017-11-12T20:42:13Z 2017-11-12T20:42:13Z CONTRIBUTOR

Just looking at the rasterio quickstart, it seems that it'd be easy to generate the coordinates using the Affine instance (though that is only available in Rasterio > 1.0a, with 0.36.0 you just have the tuple containing the multipliers). I think that might solve the problem though, since I would expect the sign of resand the transform to be synchronized to the same convention on the rasterio side, which might be breaking with the current code.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Incorrect y-coordinates for non-georeferenced data from open_rasterio 271000579
343601202 https://github.com/pydata/xarray/pull/1583#issuecomment-343601202 https://api.github.com/repos/pydata/xarray/issues/1583 MDEyOklzc3VlQ29tbWVudDM0MzYwMTIwMg== maaleske 4414299 2017-11-10T22:13:48Z 2017-11-10T22:13:48Z CONTRIBUTOR

@jhamman Any comments on the current implementation? I'm not sure how to handle possible collisions with the tag parsing and existing xarray attributes / coordinates with the same name.

Also, while writing the test for this, I found out that rasterio < 1.0a doesn't support saving the tags to the file, so I added a version check there.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Parsing wavelength info from rasterio tags 259058863
342155882 https://github.com/pydata/xarray/pull/1690#issuecomment-342155882 https://api.github.com/repos/pydata/xarray/issues/1690 MDEyOklzc3VlQ29tbWVudDM0MjE1NTg4Mg== maaleske 4414299 2017-11-06T13:58:12Z 2017-11-06T13:58:12Z CONTRIBUTOR

@shoyer I had to think a bit on your suggestion to figure out a way to make the name parameter work for the recursive cases, but now here's something to that effect. Also made me wonder how useful a test suite for testing test failures would be...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add names for test failures 271045071
341754146 https://github.com/pydata/xarray/issues/1686#issuecomment-341754146 https://api.github.com/repos/pydata/xarray/issues/1686 MDEyOklzc3VlQ29tbWVudDM0MTc1NDE0Ng== maaleske 4414299 2017-11-03T16:23:02Z 2017-11-03T16:23:02Z CONTRIBUTOR

@fmaussion Thanks! I get the feeling there's probably something odd with rasterio here. I played around a bit and found that rasterio doesn't seem to care about the signs in the transform if the given upper left is (0,0) . Giving any of from_origin(0, 0, i, j) for i, j = +-1 as the transform gives a warning about using the default geotransform and doesn't save it to the file.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Incorrect y-coordinates for non-georeferenced data from open_rasterio 271000579
341746553 https://github.com/pydata/xarray/issues/1686#issuecomment-341746553 https://api.github.com/repos/pydata/xarray/issues/1686 MDEyOklzc3VlQ29tbWVudDM0MTc0NjU1Mw== maaleske 4414299 2017-11-03T15:59:25Z 2017-11-03T15:59:25Z CONTRIBUTOR

@fmaussion I've tested with both rasterio 0.36.0 and the current master branch (1.0a11), both seem to have the same behaviour.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Incorrect y-coordinates for non-georeferenced data from open_rasterio 271000579
341743560 https://github.com/pydata/xarray/pull/1687#issuecomment-341743560 https://api.github.com/repos/pydata/xarray/issues/1687 MDEyOklzc3VlQ29tbWVudDM0MTc0MzU2MA== maaleske 4414299 2017-11-03T15:49:48Z 2017-11-03T15:49:48Z CONTRIBUTOR

@fmaussion Do you have an example of a rasterio object that would fail serialization?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Remove netCDF dependency from rasterio backend tests 271017521
341742401 https://github.com/pydata/xarray/pull/1687#issuecomment-341742401 https://api.github.com/repos/pydata/xarray/issues/1687 MDEyOklzc3VlQ29tbWVudDM0MTc0MjQwMQ== maaleske 4414299 2017-11-03T15:46:10Z 2017-11-03T15:46:10Z CONTRIBUTOR

@fmaussion Ah, didn't think of that. That should probably be a separate test though. You're right about the name change, I thought of it already but forgot to change them.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Remove netCDF dependency from rasterio backend tests 271017521
335827523 https://github.com/pydata/xarray/pull/1583#issuecomment-335827523 https://api.github.com/repos/pydata/xarray/issues/1583 MDEyOklzc3VlQ29tbWVudDMzNTgyNzUyMw== maaleske 4414299 2017-10-11T14:23:24Z 2017-10-11T14:23:24Z CONTRIBUTOR

I think I found a way to make the metadata parsing a bit more general and extendable. I implemented a more general parser for the ENVI case as a proof of concept.

Now if a recognized driver is detected, instead of parsing tags(band) for each band, it queries the metadata domain for the driver using riods.tags(ns=riods.driver) and then munges any known arrays into a numpy format. Later the resulting dictionary is slotted into either coordinates or attributes based on the values type. This should make it pretty easy to implement parsers for different file formats without caring about the partial parsing done by GDAL for the other tags() calls.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Parsing wavelength info from rasterio tags 259058863
334723412 https://github.com/pydata/xarray/issues/1582#issuecomment-334723412 https://api.github.com/repos/pydata/xarray/issues/1582 MDEyOklzc3VlQ29tbWVudDMzNDcyMzQxMg== maaleske 4414299 2017-10-06T10:55:27Z 2017-10-06T10:55:27Z CONTRIBUTOR

Had some more time to look at this. It seems rasterio just passes the the info returned by GDAL, since looking at the files using gdalinfo reveals exactly the same data (with only wavelengths parsed for each band, etc). Apparently gdalinfo can (since GDAL 1.11) also list the available metadata domains (namespaces) in the file, or output all the metadata given the domain 'all'. These don't seem yet to be implemented in rasterio.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rasterio tags are not accessible through open_rasterio 259057144
330979614 https://github.com/pydata/xarray/issues/1582#issuecomment-330979614 https://api.github.com/repos/pydata/xarray/issues/1582 MDEyOklzc3VlQ29tbWVudDMzMDk3OTYxNA== maaleske 4414299 2017-09-20T21:01:01Z 2017-09-20T21:15:41Z CONTRIBUTOR

@jhamman, I did some looking around. The rasterio documentation on tags does not reveal much and points to the only slightly less unhelpful GDAL data model documentation. There seem to be both namespaces containing file format specific data, and general namespaces which contain data parsed from the format specific namespaces. The format namespaces/domains are mentioned in the GDAL raster format documentation, but don't really tell much of the type of data stored.

For ENVI files, there seems to already be three different kinds of return values depending on the exact call:

  • tags() returns a dict full of strings created from the wavelength info in the header file: {'Band_1':'450 nm', 'Band_2':'452', ..., 'wavelength_units':'nm'}

  • tags(b) returns a dict containing the info for the band b in a slightly different format: {'wavelength':450.00, 'wavelength_units':'nm'}

  • tags(ns='ENVI') returns a dict of string values, containing all the fields in the header file in their original form: python {'Description':'file.dat', 'wavelength':'{450, 452, ...}', 'fwhm':'{3.0, 3.0, ...}', etc.}

  • Other namespaces I tried seemed to return only empty dicts (for the ENVI file).

It's a bit puzzling why only the wavelength information (and not even the corresponding FWHM info) is parsed to the default namespace, given that it's not listed as having any well defined semantics in the GDAL docs.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rasterio tags are not accessible through open_rasterio 259057144

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 638.889ms · About: xarray-datasette