issue_comments
6 rows where issue = 530062582 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- New accessor for a biomechanics open source library · 6 ✖
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
``` Let's say I define another ```python @xr.register_dataarray_accessor("foo") class DataArrayAccessor(object): def init(self, xarray_obj: xr.DataArray): self._obj = xarray_obj
``` My ultimate goal is to have this kind of API:
|
{ "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 | |
559847335 | https://github.com/pydata/xarray/issues/3582#issuecomment-559847335 | https://api.github.com/repos/pydata/xarray/issues/3582 | MDEyOklzc3VlQ29tbWVudDU1OTg0NzMzNQ== | crusaderky 6213168 | 2019-11-29T17:10:40Z | 2019-11-29T17:10:40Z | MEMBER | +1 to shoyer - encapsulation is by far the easiest approach.
```python @xarray.register_dataset_accessor('foo') class FooAccessor: def init(self, xarray_obj): self.obj = xarray_obj # <insert whatever health checks on xarray_obj> self.x = something(xarray_obj)
``` The accessor Note, however, that it is not recommended to put expensive calculations in it, because the object will possibly be destroyed and reinitialised every time the array is transformed - or in other words, anything that is not a read-only method/property or a cell update. I emphasized possibly because some transforms may not destroy and recreate your accessor instance, thus potentially causing it to be in a state that is incoherent with the attached xarray object. Every time you invoke a method, you should verify that whatever assumptions you relied upon to generate the state are still valid. |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
New accessor for a biomechanics open source library 530062582 | |
559663153 | https://github.com/pydata/xarray/issues/3582#issuecomment-559663153 | https://api.github.com/repos/pydata/xarray/issues/3582 | MDEyOklzc3VlQ29tbWVudDU1OTY2MzE1Mw== | shoyer 1217238 | 2019-11-29T05:22:29Z | 2019-11-29T05:22:29Z | MEMBER | What about simply wrapping xarray objects internally in your classes, along with utilities for converting to/from xarray objects? When users want to do domain specific stuff they can use your objects, and when they want to do something generic with xarray they can convert by calling a method like |
{ "total_count": 2, "+1": 2, "-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 |
Yes, I need to test some properties when creating the
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 | |
559606839 | https://github.com/pydata/xarray/issues/3582#issuecomment-559606839 | https://api.github.com/repos/pydata/xarray/issues/3582 | MDEyOklzc3VlQ29tbWVudDU1OTYwNjgzOQ== | crusaderky 6213168 | 2019-11-28T21:36:39Z | 2019-11-28T21:36:39Z | MEMBER | Give a careful read to #3268 if statefulness (beyond what can be stored in xarray variables) is important for you. |
{ "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 | |
559606279 | https://github.com/pydata/xarray/issues/3582#issuecomment-559606279 | https://api.github.com/repos/pydata/xarray/issues/3582 | MDEyOklzc3VlQ29tbWVudDU1OTYwNjI3OQ== | crusaderky 6213168 | 2019-11-28T21:32:23Z | 2019-11-28T21:32:23Z | MEMBER | I would not advise subclassing. In most cases it should work but it's thoroughly untested and I would be unsurprised if you were to find a use case that accidentally reverts your subclass to the base class. I don't think I fully understand your problem with accessors. Is it because you would need a hook that is triggered by |
{ "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
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 3