home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1122649316

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/issues/4628#issuecomment-1122649316 https://api.github.com/repos/pydata/xarray/issues/4628 1122649316 IC_kwDOAMm_X85C6kTk 1197350 2022-05-10T17:00:47Z 2022-05-10T17:02:34Z MEMBER

Any pointers regarding where to start / modules involved to implement this? I would like to have a try.

The starting point would be to look at the code in indexing.py and try to understand how lazy indexing works.

In particular, look at

https://github.com/pydata/xarray/blob/3920c48d61d1f213a849bae51faa473b9c471946/xarray/core/indexing.py#L465-L470

Then you may want to try writing a class that looks like

```python class LazilyConcatenatedArray: # have to decide what to inherit from

def __init__(self, *arrays: LazilyIndexedArray, concat_axis=0):
    # figure out what you need to keep track of

@property
def shape(self):
    # figure out how to determine the total shape

def __getitem__(self, indexer) -> LazilyIndexedArray:
    # figure out how to map an indexer to the right piece of data

```

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