issue_comments: 1516494141
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/7721#issuecomment-1516494141 | https://api.github.com/repos/pydata/xarray/issues/7721 | 1516494141 | IC_kwDOAMm_X85aY909 | 98330 | 2023-04-20T15:04:17Z | 2023-04-20T15:04:17Z | NONE |
I was considering this question for SciPy (xref scipy#18286) this week, and I think I'm happy with this strategy:
1. Cast all "array-like" inputs like Python scalars, lists/sequences, and generators, to What that results in is an API that's backwards-compatible for numpy and array-like usage, and much stricter when using other array libraries. That strictness to me is a good thing, because:
- that's what CuPy, PyTorch & co themselves do, and it works well there
- it avoids the complexity raised by arbitrary mixing, which results in questions like the one raised in this issue.
- in case you do need to use a scalar from within a function inside your own library, just convert it explicitly to the desired array type with |
{
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
1655290694 |