home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "MEMBER" and issue = 993563624 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • max-sixty 7

issue 1

  • Unexpected behavior when using slice in a sel() statement · 7 ✖

author_association 1

  • MEMBER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
921988569 https://github.com/pydata/xarray/issues/5786#issuecomment-921988569 https://api.github.com/repos/pydata/xarray/issues/5786 IC_kwDOAMm_X8429G3Z max-sixty 5635139 2021-09-17T18:13:03Z 2021-09-17T18:13:03Z MEMBER

Hi @nickdoty — I'm less experienced in these than others, but the float conversion issue makes sense.

Generally I would use something like a tolerance for floats; relying on exact values is liable to hit these sorts of things at the moment.

I agree the current state isn't ideal. I think there are issues for float conversions on the tracker, and feel free to create a new one if there isn't.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unexpected behavior when using slice in a sel() statement 993563624
920287535 https://github.com/pydata/xarray/issues/5786#issuecomment-920287535 https://api.github.com/repos/pydata/xarray/issues/5786 IC_kwDOAMm_X8422nkv max-sixty 5635139 2021-09-15T18:45:06Z 2021-09-15T18:45:06Z MEMBER

Thanks for trying @nickdoty

Here's that slightly modified — does this help explain the 44.99 point?

```python

In [3]: import xarray as xr ...: ...: data = xr.open_dataset('https://podaac-opendap.jpl.nasa.gov/opendap/allData/ghrsst/data/GDS2/L4/GLOB/JPL/MUR/' ...: 'v4.1/2018/030/20180130090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc') ...: print(data['analysed_sst'].sel(lat=slice(None, 10.45), lon=-68.00).indexes['lat']) ...: print(data['analysed_sst'].sel(lat=slice(10.45, None), lon=-68.00).indexes['lat']) ...: Float64Index([-89.98999786376953, -89.9800033569336, -89.97000122070312, -89.95999908447266, -89.94999694824219, -89.94000244140625, -89.93000030517578, -89.91999816894531, -89.91000366210938, -89.9000015258789, ... 10.359999656677246, 10.369999885559082, 10.380000114440918, 10.390000343322754, 10.399999618530273, 10.40999984741211, 10.420000076293945, 10.430000305175781, 10.4399995803833, 10.449999809265137], dtype='float64', name='lat', length=10045) Float64Index([10.460000038146973, 10.470000267028809, 10.479999542236328, 10.489999771118164, 10.5, 10.510000228881836, 10.520000457763672, 10.529999732971191, 10.539999961853027, 10.550000190734863, ... 89.9000015258789, 89.91000366210938, 89.91999816894531, 89.93000030517578, 89.94000244140625, 89.94999694824219, 89.95999908447266, 89.97000122070312, 89.9800033569336, 89.98999786376953], dtype='float64', name='lat', length=7954) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unexpected behavior when using slice in a sel() statement 993563624
920264934 https://github.com/pydata/xarray/issues/5786#issuecomment-920264934 https://api.github.com/repos/pydata/xarray/issues/5786 IC_kwDOAMm_X8422iDm max-sixty 5635139 2021-09-15T18:16:42Z 2021-09-15T18:16:42Z MEMBER

@nickdoty please show the output where this is happening. The output showing in my response above shows a value (10.449999809265137) less than 10.45.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unexpected behavior when using slice in a sel() statement 993563624
918589726 https://github.com/pydata/xarray/issues/5786#issuecomment-918589726 https://api.github.com/repos/pydata/xarray/issues/5786 IC_kwDOAMm_X842wJEe max-sixty 5635139 2021-09-13T21:24:40Z 2021-09-13T21:24:40Z MEMBER

Oh and check out the tolerance keyword to sel

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unexpected behavior when using slice in a sel() statement 993563624
918578097 https://github.com/pydata/xarray/issues/5786#issuecomment-918578097 https://api.github.com/repos/pydata/xarray/issues/5786 IC_kwDOAMm_X842wGOx max-sixty 5635139 2021-09-13T21:08:32Z 2021-09-13T21:08:32Z MEMBER

Thanks for explaining @nickdoty . This does seem to support the idea that this is happening because the value is 10.449999809265137, and not 10.45.

If that's not the case, could you show a working example of selecting something with 10.45 failing to select a value that's equal or above 10.45. Probably the easiest way is to select the values along lat and show the result.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unexpected behavior when using slice in a sel() statement 993563624
918453939 https://github.com/pydata/xarray/issues/5786#issuecomment-918453939 https://api.github.com/repos/pydata/xarray/issues/5786 IC_kwDOAMm_X842vn6z max-sixty 5635139 2021-09-13T18:16:43Z 2021-09-13T18:16:43Z MEMBER

Sorry if I'm being slow in understanding. My question was whether this was caused by the 10.449999809265137 value being slightly below 10.45.

If not, could you show in the example both the values being selected and the values that it's selecting? Probably the easiest way is to select the values along lat and show the result.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unexpected behavior when using slice in a sel() statement 993563624
917694806 https://github.com/pydata/xarray/issues/5786#issuecomment-917694806 https://api.github.com/repos/pydata/xarray/issues/5786 IC_kwDOAMm_X842sulW max-sixty 5635139 2021-09-12T19:20:57Z 2021-09-12T19:20:57Z MEMBER

Thanks for the issue @nickdoty . Is it a rounding issue?

```python

In [5]: import xarray as xr ...: longitude = -68.0 ...: ...: data = xr.open_dataset('https://podaac-opendap.jpl.nasa.gov/opendap/allData/ghrsst/data/GDS2/L4/GLOB/JPL/MUR/' ...: 'v4.1/2018/030/20180130090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc') ...: ex_1 = data['analysed_sst'].sel(lat=slice(10.47, 10.52), lon=longitude).indexes['lat'] ...: ex_2 = data['analysed_sst'].sel(lat=slice(10.45, 10.52), lon=longitude).indexes['lat'] ...: ex_3 = data['analysed_sst'].sel(lat=slice(10.449, 10.52), lon=longitude).indexes['lat'] ...: ...: print(ex_1) ...: print(ex_2) ...: print(ex_3) Float64Index([10.470000267028809, 10.479999542236328, 10.489999771118164, 10.5, 10.510000228881836], dtype='float64', name='lat') Float64Index([10.460000038146973, 10.470000267028809, 10.479999542236328, 10.489999771118164, 10.5, 10.510000228881836], dtype='float64', name='lat') Float64Index([10.449999809265137, 10.460000038146973, 10.470000267028809, 10.479999542236328, 10.489999771118164, 10.5, 10.510000228881836], dtype='float64', name='lat') ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Unexpected behavior when using slice in a sel() statement 993563624

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