issues: 1347715262
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1347715262 | I_kwDOAMm_X85QVIC- | 6949 | Plot accessors miss static typing | 43316012 | closed | 0 | 0 | 2022-08-23T10:38:56Z | 2022-10-16T09:26:55Z | 2022-10-16T09:26:55Z | COLLABORATOR | What happened?The plot accessors i.e. The problem is that many plotting methods are added using hooks via decorators, something that mypy does not understand. What did you expect to happen?As a quick fix: type the plot accessors as Better to either restructure the accessor with static methods instead of hooks or figure out another way of telling static type checkers about these methods. Anyway: mypy should not complain. Minimal Complete Verifiable Example```Python import xarray as xr da = xr.DataArray([[1,2,3], [4,5,6]], dims=["x", "y"]) da.plot.contourf(x="x", y="y") mypy complains:error: "_PlotMethods" has no attribute "contourf"``` MVCE confirmation
Relevant log outputNo response Anything else we need to know?No response EnvironmentOn mobile, can edit it later if required. Newest xarray should have this problem, before the accessor was Any. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6949/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |