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/4601#issuecomment-732361140,https://api.github.com/repos/pydata/xarray/issues/4601,732361140,MDEyOklzc3VlQ29tbWVudDczMjM2MTE0MA==,5635139,2020-11-23T19:00:30Z,2023-09-24T19:44:17Z,MEMBER,"Great observation @mathause . I think there are two parts of this: - Do we want other libraries which do `da.longitude` to raise a mypy error? That may be a tradeoff with raising the true error on `da.isel` - How do we design the type hierarchy? We could add methods to `DataWithCoords` or add some `Dataset_Or_DataArray`-like type Having methods like `isel` typed would be a win I think","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748684119 https://github.com/pydata/xarray/issues/4601#issuecomment-732472373,https://api.github.com/repos/pydata/xarray/issues/4601,732472373,MDEyOklzc3VlQ29tbWVudDczMjQ3MjM3Mw==,5635139,2020-11-23T22:51:38Z,2023-09-24T19:36:02Z,MEMBER,"Good point re accessors, I hadn't considered those. So sounds like raising an error on `da.isel` isn't possible regardless...","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748684119 https://github.com/pydata/xarray/issues/4601#issuecomment-735210680,https://api.github.com/repos/pydata/xarray/issues/4601,735210680,MDEyOklzc3VlQ29tbWVudDczNTIxMDY4MA==,10194086,2020-11-28T10:16:04Z,2020-11-28T10:16:04Z,MEMBER,"I can open a PR but is there a clean way to handle accessors? Do you prefer `ABC`s or `NotImplementedError` for the missing methods in `DataWithCoords`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748684119 https://github.com/pydata/xarray/issues/4601#issuecomment-735123039,https://api.github.com/repos/pydata/xarray/issues/4601,735123039,MDEyOklzc3VlQ29tbWVudDczNTEyMzAzOQ==,1217238,2020-11-28T08:40:07Z,2020-11-28T08:40:07Z,MEMBER,"I think we can probably safely add `@no_type_check` to `__getattr__` here, though it's true `DataWithCoords` was only intended as a mix-in. Looking up coordinates with attributes like `da.longitude` is a shortcut mostly intended for interactive use-cases. If you are type-checking your code for safely, you should likely prefer writing `da['longitude']` to remove ambiguity about whether `ds.longitude` is a method, accessor or DataArray object.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748684119 https://github.com/pydata/xarray/issues/4601#issuecomment-732440475,https://api.github.com/repos/pydata/xarray/issues/4601,732440475,MDEyOklzc3VlQ29tbWVudDczMjQ0MDQ3NQ==,10194086,2020-11-23T21:35:47Z,2020-11-23T21:35:47Z,MEMBER,"> Do we want other libraries which do da.longitude to raise a mypy error? That may be a tradeoff with raising the true error on da.jsel Good point. Given that the accessors are also going via `__getattr__` I would not remove the typing. Due to the accessors it also needs to be `-> Any`. In conclusion `DataWithCoords` only makes sense as a mixin. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748684119