home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where author_association = "CONTRIBUTOR", issue = 530062582 and user = 17710617 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

  • romainmartinez · 2 ✖

issue 1

  • New accessor for a biomechanics open source library · 2 ✖

author_association 1

  • CONTRIBUTOR · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
559860016 https://github.com/pydata/xarray/issues/3582#issuecomment-559860016 https://api.github.com/repos/pydata/xarray/issues/3582 MDEyOklzc3VlQ29tbWVudDU1OTg2MDAxNg== romainmartinez 17710617 2019-11-29T18:24:49Z 2019-11-29T18:24:49Z CONTRIBUTOR

Ok thanks for the recommandations.

I'm thinking of using this kind of class to handle object creation:

```python import xarray as xr import motion

class Analogs: def new(cls, ...): array = xr.DataArray(...) cls.verify(array) return array

@staticmethod
def verify(array):
    print("verification...")

@classmethod
def from_csv(cls, filename:str, ...):
    array = xr.DataArray(filename, ...)
    cls.verify(array)
    return array

```

Let's say I define another Markers class for another type of data. Is it possible that my accessor exposes different functions according to class e, g:

```python @xr.register_dataarray_accessor("foo") class DataArrayAccessor(object): def init(self, xarray_obj: xr.DataArray): self._obj = xarray_obj

def to_csv(self):
    """
    This function is exposed to all objects
    but behave differently if it is a Markers or an Analogs
    """

def marker_only_function(self):
    """
    This function is only exposed to 
    array created with the Marker class
    """

def analog_only_function(self):
    """
    This function is only exposed to
    array created with the Analog class
    """

```

My ultimate goal is to have this kind of API:

python analogs = ( Analogs.from_csv("filename.csv") .foo.center() # foo accessor generic method .foo.rectify() # foo accessor specific method for Analogs object .mean() # xarray method )

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  New accessor for a biomechanics open source library 530062582
559607756 https://github.com/pydata/xarray/issues/3582#issuecomment-559607756 https://api.github.com/repos/pydata/xarray/issues/3582 MDEyOklzc3VlQ29tbWVudDU1OTYwNzc1Ng== romainmartinez 17710617 2019-11-28T21:44:08Z 2019-11-28T21:44:08Z CONTRIBUTOR

Is it because you would need a hook that is triggered by DataArray. init

Yes, I need to test some properties when creating the DataArray such as shape and dimensions properties.

Why can't you initialise whatever you need to upon first access?

How do you do that?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  New accessor for a biomechanics open source library 530062582

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