issue_comments
6 rows where author_association = "MEMBER" and issue = 367763373 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- Recommended way to extend xarray Datasets using accessors? · 6 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
434627405 | https://github.com/pydata/xarray/issues/2473#issuecomment-434627405 | https://api.github.com/repos/pydata/xarray/issues/2473 | MDEyOklzc3VlQ29tbWVudDQzNDYyNzQwNQ== | TomNicholas 35968931 | 2018-10-31T09:58:05Z | 2018-10-31T09:58:05Z | MEMBER | 2482 has now been merged which means that I can get the behaviour I want by using globally-permanent attrs to store arbitrary objects, and using accessors to attach methods to datasets. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Recommended way to extend xarray Datasets using accessors? 367763373 | |
429429134 | https://github.com/pydata/xarray/issues/2473#issuecomment-429429134 | https://api.github.com/repos/pydata/xarray/issues/2473 | MDEyOklzc3VlQ29tbWVudDQyOTQyOTEzNA== | TomNicholas 35968931 | 2018-10-12T19:05:24Z | 2018-10-12T19:05:59Z | MEMBER | I realised I'm massively overcomplicating this, I think all I need is the existing accessor functionality, and for attrs to always be preserved in order to get the behaviour I want. Therefore once #2482 is merged then I should be able to close this. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Recommended way to extend xarray Datasets using accessors? 367763373 | |
428179704 | https://github.com/pydata/xarray/issues/2473#issuecomment-428179704 | https://api.github.com/repos/pydata/xarray/issues/2473 | MDEyOklzc3VlQ29tbWVudDQyODE3OTcwNA== | TomNicholas 35968931 | 2018-10-09T12:52:30Z | 2018-10-09T14:53:30Z | MEMBER | Sorry for the triple comment, but I could also do this: If I do this: ```python @xr.register_dataset_accessor('bout') class BoutAccessor(object): def init(self, ds_object): self._data = ds_object
@register_dataset_accessor('storm') class StormAccessor(BoutAccessor): def init(self, ds_object): super().init(ds_object)
``` then I can have BOUT-specific attributes and methods stored via the bout accessor, all of which are inherited by the more-specific storm accessor ```python ds = collect_data(path) options_obj = get_options(path) ds.storm.set_options(options_obj) # access inherited methods from the bout accessor to store arbitrary extra data ds.storm.special_storm_plot() # use data from the bout accessor when calling more-specific methods form the storm accessor ``` However then my attached objects don't survive the calling of xarray methods:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Recommended way to extend xarray Datasets using accessors? 367763373 | |
428170843 | https://github.com/pydata/xarray/issues/2473#issuecomment-428170843 | https://api.github.com/repos/pydata/xarray/issues/2473 | MDEyOklzc3VlQ29tbWVudDQyODE3MDg0Mw== | TomNicholas 35968931 | 2018-10-09T12:21:53Z | 2018-10-09T12:21:53Z | MEMBER | Or alternatively I suppose I could just store my options as an attribute on the accessor: ```python ds = collect_data(path) ds.bout.options = options_obj Now I have an object which stores all the data I wantprint(ds.bout.options) ``` That seems to be what I should have tried first. In that case would it be possible to have multiple accessors, one for the core bout functionality and others for extensions for even-more-specific users? i.e an accessor for a code called Storm which is based on BOUT++: ```python print(ds) # xarray dataset print(ds.bout.options) # BOUT-specific extra information print(ds.storm.special_storm_plot()) # storm-user-group-specific method ``` Can an accessor inherit from another accessor class? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Recommended way to extend xarray Datasets using accessors? 367763373 | |
428152588 | https://github.com/pydata/xarray/issues/2473#issuecomment-428152588 | https://api.github.com/repos/pydata/xarray/issues/2473 | MDEyOklzc3VlQ29tbWVudDQyODE1MjU4OA== | TomNicholas 35968931 | 2018-10-09T11:10:46Z | 2018-10-09T11:10:46Z | MEMBER |
Ah - I misunderstood how they work, if I do this: ```python @xr.register_dataset_accessor('bout') class BoutDataset(object): def init(self, ds_object): self.data = ds_object
ds.bout.plot_tokamak() print(ds.bout.data) ``` Thanks!
My Also the philosophy of the BOUT framework encourages each group of users to add their own functionality depending on what exactly they are solving. Some kind of base (Sorry if this is too far off the topic of xarray, feel free to close it if you think this is not going to be relevant to any of the rest of the community.) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Recommended way to extend xarray Datasets using accessors? 367763373 | |
427927907 | https://github.com/pydata/xarray/issues/2473#issuecomment-427927907 | https://api.github.com/repos/pydata/xarray/issues/2473 | MDEyOklzc3VlQ29tbWVudDQyNzkyNzkwNw== | shoyer 1217238 | 2018-10-08T18:06:23Z | 2018-10-08T18:06:23Z | MEMBER | Your use of an xarray accessor class looks a little funny to me. Accessors should only accept one argument, which is an xarray.Dataset. If you want to make your own objects, that's fine, but I don't think there's any point in making them an accessor. What does your |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Recommended way to extend xarray Datasets using accessors? 367763373 |
Advanced export
JSON shape: default, array, newline-delimited, object
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]);
user 2