issue_comments: 413732471
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/988#issuecomment-413732471 | https://api.github.com/repos/pydata/xarray/issues/988 | 413732471 | MDEyOklzc3VlQ29tbWVudDQxMzczMjQ3MQ== | 1217238 | 2018-08-17T01:39:30Z | 2018-08-17T01:39:30Z | MEMBER |
Yep, this is pretty much what I was thinking of.
The virtue of this approach vs setting an global "attribute handler" (as suggested here) is that everything is controlled locally. For example, suppose people want to plug in two separate unit systems into xarray (e.g., pint and unyt). If the unit handling is determined by the specific arrays, then libraries relying on both approaches internally can happily co-exist and even call each other. In principle, this could be done safely with global handlers if you always know exactly when to switch back and forth, but that requires explicitly switching on handlers for even basic arithmetic. I doubt most users are going to bother, which is going to make using multiple tools that make use of this feature really hard. The other big advantage is that you only have to write the bulk of the unit system once, e.g., to define operations on NumPy arrays.
Rather than struggling to keep We could still do some work on the xarray side to make this easy to use. Specifically:
- The |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
173612265 |