home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where issue = 654150730 and user = 35968931 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: reactions, updated_at (date)

user 1

  • TomNicholas · 7 ✖

issue 1

  • Xarray combine_by_coords return the monotonic global index error · 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
1453076251 https://github.com/pydata/xarray/issues/4213#issuecomment-1453076251 https://api.github.com/repos/pydata/xarray/issues/4213 IC_kwDOAMm_X85WnC8b TomNicholas 35968931 2023-03-03T07:07:31Z 2023-03-03T07:07:31Z MEMBER

Closing this as having answered the original question. If anyone wants to discuss mosaicing rasters in more detail we can raise another issue for that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray combine_by_coords return the monotonic global index error 654150730
811180312 https://github.com/pydata/xarray/issues/4213#issuecomment-811180312 https://api.github.com/repos/pydata/xarray/issues/4213 MDEyOklzc3VlQ29tbWVudDgxMTE4MDMxMg== TomNicholas 35968931 2021-03-31T16:00:02Z 2021-03-31T16:00:02Z MEMBER

@pl-marasco I've just been pointed to this issue on pangeo-data, which looks like a better place to discuss this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray combine_by_coords return the monotonic global index error 654150730
811135190 https://github.com/pydata/xarray/issues/4213#issuecomment-811135190 https://api.github.com/repos/pydata/xarray/issues/4213 MDEyOklzc3VlQ29tbWVudDgxMTEzNTE5MA== TomNicholas 35968931 2021-03-31T14:59:17Z 2021-03-31T14:59:17Z MEMBER

Hi @pl-marasco, thanks for your comment.

So what you're suggesting is to alter combine_by_coords and combine_nested to be able to optionally handle overlapping data, presumably with an additional keyword argument to specify the rule it uses?

I think that this could be done within the combine functions, but it's not trivial... At the moment if you pass data with big gaps in it to combine_by_coords it can fill it with NaNs, so that's at least sort of the inverse of what you're suggesting.

Internally the combine functions currently work by creating an intermediate representation of the arrangement of tiles, before combining that along 1D repeatedly until done. What I'm wondering is whether any treatment of overlapping values would need to happen before this 1D combining step? If I have 4 tiles which all overlap at a corner, and you want me to take the (max/min/average) value of all 4 in that quadruple overlap region, I could either do this by identifying that region and taking the max (complicated) or by simply updating the max value every time I combine along 1D (simple, but more wasteful). Separately, a treatment based on the order of the input passed (your first/last) would I think need to store extra information about that order, which would be more complicated.

Do these raster problems always use the same sized tiles?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray combine_by_coords return the monotonic global index error 654150730
657206070 https://github.com/pydata/xarray/issues/4213#issuecomment-657206070 https://api.github.com/repos/pydata/xarray/issues/4213 MDEyOklzc3VlQ29tbWVudDY1NzIwNjA3MA== TomNicholas 35968931 2020-07-12T10:56:36Z 2020-07-12T10:56:36Z MEMBER

Thanks. The problem is I don't really know where the common coordinates are. However, since I know the extent of each tile, with some preprocessing I should be able to find/trim them.

Great. Let me know if you still have problems (on here, SO - I just answered your original question there, or on the xarray mailing list).

What really happened was I had a large area, then I used xarray to clip it into smaller tiles to make calculations more feasible.

I wonder if you could have avoided having to do this by applying your analysis in chunks using dask? That might be complicated if your analysis is a complicated algorithm though.

It would be great if mosaicing dataset with common coordinate was added to the xarray (like mosacing rasters). ... having it as part of xarray definitely helps many geospatial applications where, for many reasons, we deal with tiles of data with common coordinates.

This sounds like something that might be useful for lots of geoscientists, so it would be good to discuss this further. However, I don't really know exactly what you mean by "mosaicing rasters" (I don't work in geoscience). Briefly reading about it here it seems that there isn't one universal way to do it... What would be really great is if you could give me a more precise specification of the behaviour you're imagining, and how it would be used in practice (either here on in a new issue). Then we can see if it's (a) feasible, (b) commonly-useful, and (c) should live in xarray or another package. Another good place to ask about the best way to approach this problem in general would be the pangeo discourse.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray combine_by_coords return the monotonic global index error 654150730
656385456 https://github.com/pydata/xarray/issues/4213#issuecomment-656385456 https://api.github.com/repos/pydata/xarray/issues/4213 MDEyOklzc3VlQ29tbWVudDY1NjM4NTQ1Ng== TomNicholas 35968931 2020-07-09T22:40:50Z 2020-07-09T22:40:50Z MEMBER

What I meant is that .isel doesn't find common coordinates, it just selects points based on index. Selecting based on coordinate is done with .sel. And if you want to interrogate the values of the coordinates first you will need to do some kind of comparison or logical selection.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray combine_by_coords return the monotonic global index error 654150730
656384840 https://github.com/pydata/xarray/issues/4213#issuecomment-656384840 https://api.github.com/repos/pydata/xarray/issues/4213 MDEyOklzc3VlQ29tbWVudDY1NjM4NDg0MA== TomNicholas 35968931 2020-07-09T22:39:00Z 2020-07-09T22:39:00Z MEMBER

Thanks @TomNicholas for a thorough explanation. Now it makes sense.

No problem, thanks for flagging it.

Yes, it would be great if you can add an example on how to find and trim overlapping coordinates. I don't really know how to find common coordinates in spatial datasets using isel.

Do you already know which data points overlap? You know they are NaNs, so do you know how many NaNs there are at the edge of your tiles? If you do then it's just like .isel(lat=slice(2, None)) for example, but if you don't then it might be a more complicated pre-processing to do.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray combine_by_coords return the monotonic global index error 654150730
656353542 https://github.com/pydata/xarray/issues/4213#issuecomment-656353542 https://api.github.com/repos/pydata/xarray/issues/4213 MDEyOklzc3VlQ29tbWVudDY1NjM1MzU0Mg== TomNicholas 35968931 2020-07-09T21:11:31Z 2020-07-09T22:06:32Z MEMBER

Hi @hamiddashti , based on your description then this isn't a bug, it's throwing the error it should be throwing given your input. However I can now see how the documentation doesn't make it very clear as to why this is happening!

combine_by_coords and combine_nested do two things: they concatenate (using xr.concat), and they merge (using xr.merge). The concatenate step is never supposed to handle partially overlapping coordinates, and the combine functions therefore have the same restriction.

That error is an explicit rejection of the input you gave it: "you gave me overlapping coordinates, I don't know how to concatenate those, so I'll reject them." Normally this makes sense - when the overlapping coordinates aren't NaNs then it's ambiguous as to which values to choose.

In your case then you are asking it to perform a well-defined operation, and the discussion in the docs about merging overlapping coordinates here implies that compat='no_conflicts' would handle this situation. Unfortunately that's only for xr.merge, not xr.concat, and so it doesn't apply for combine_by_coords either. merge deals with variables of the same size, concat joins variables of different sizes onto the ends of one another. This is definitely confusing.

It might be possible to generalise the combine functions to handle the scenario you're describing (where the overlapping parts of the coordinates are specified entirely by the non-NaN values), but I don't really think it's a good idea for complexity reasons.

(Issue #3150 was about something else, an actual bug in the handling of "coordinate dimensions which do not vary between each dataset".)

Instead, what you need to do is trim off the overlap first. That shouldn't be hard - presumably you know (or can determine) how big your overlap is, and all your NaNs are on one dataset. You just need to use the .isel() method with a slice. Once you've got rid of the overlapping NaNs then you should be able to combine it fine (and you shouldn't need to specify compat either). If you're using combine_by_coords as part of opening many files with open_mfdataset then it might be easier to write a trimming function which you apply first using the preprocess argument to open_mfdataset.

Would it be clearer if I added an example to the documentation where some overlapping data had to be trimmed first?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Xarray combine_by_coords return the monotonic global index error 654150730

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