home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

32 rows where issue = 1377128403 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: reactions, created_at (date), updated_at (date)

user 4

  • headtr1ck 19
  • Illviljan 9
  • max-sixty 3
  • mathause 1

author_association 2

  • COLLABORATOR 19
  • MEMBER 13

issue 1

  • Add typing to plot methods · 32 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1279931075 https://github.com/pydata/xarray/pull/7052#issuecomment-1279931075 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MSjLD Illviljan 14371165 2022-10-16T09:27:18Z 2022-10-16T09:27:18Z MEMBER

Thanks @headtr1ck ! :)

{
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 2,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1277951477 https://github.com/pydata/xarray/pull/7052#issuecomment-1277951477 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MK_31 Illviljan 14371165 2022-10-13T17:31:49Z 2022-10-13T18:26:23Z MEMBER

Yeah, I had some strange issues there. One was that the branch wasn't up to date and another one that I can't replicate anymore... Sorry for the noise,

Agreed on the labels, I haven't figured how to avoid that overlap yet. y should point to the top as it does in 2D plots, it makes it easy to orient yourself as you add dimensions: python ds = xr.tutorial.scatter_example_dataset(seed=42) fg = ds.plot.scatter(x="A", y="B", hue="y", row="x", col="w") fg = ds.plot.scatter(x="A", y="B", z="z", hue="y", row="x", col="w")

Not how it's done in plots2d (yet) though.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 1,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1278007157 https://github.com/pydata/xarray/pull/7052#issuecomment-1278007157 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MLNd1 Illviljan 14371165 2022-10-13T18:23:11Z 2022-10-13T18:23:11Z MEMBER

I use windows as well. :) I just had my plot in an interactive window that was maximized.

I can get it too look as bad as yours as well:

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 1,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1277990906 https://github.com/pydata/xarray/pull/7052#issuecomment-1277990906 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MLJf6 headtr1ck 43316012 2022-10-13T18:09:08Z 2022-10-13T18:09:08Z COLLABORATOR

I get much more overlap than you! Why is that? Windows again?

I don't necessarily agree about y-axis pointing upwards, I think that is confusing. But I let people who actually use this be the judge :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1277853940 https://github.com/pydata/xarray/pull/7052#issuecomment-1277853940 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MKoD0 Illviljan 14371165 2022-10-13T16:10:01Z 2022-10-13T17:27:46Z MEMBER

edit

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1277915523 https://github.com/pydata/xarray/pull/7052#issuecomment-1277915523 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MK3GD headtr1ck 43316012 2022-10-13T16:59:09Z 2022-10-13T17:00:48Z COLLABORATOR

For me this code works? Besides from too few distance between the subplots such that the z-labels are on top of the neighboring plot. And the y and z axis seem to be reversed, unless it is intentional that y points to the top?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1277813315 https://github.com/pydata/xarray/pull/7052#issuecomment-1277813315 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MKeJD Illviljan 14371165 2022-10-13T15:38:14Z 2022-10-13T15:38:14Z MEMBER

Anyway, you should use kwargs for x and y as well :)

Hah, unfortunately my random test scripts I copy/pasted from can't keep up with branches. :D

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1277796539 https://github.com/pydata/xarray/pull/7052#issuecomment-1277796539 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MKaC7 headtr1ck 43316012 2022-10-13T15:27:21Z 2022-10-13T15:27:21Z COLLABORATOR

Ok, good question. I have to look into it. Anyway, you should use kwargs for x and y as well :) Also, we should definitely test this haha

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 1,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1277793880 https://github.com/pydata/xarray/pull/7052#issuecomment-1277793880 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MKZZY Illviljan 14371165 2022-10-13T15:25:23Z 2022-10-13T15:25:23Z MEMBER

This crashes now. Maybe you'll find the bug faster than me. ```python import xarray as xr

ds = xr.tutorial.scatter_example_dataset(seed=42) fg = ds.plot.scatter("A", "B", z="z", hue="y", row="x", col="w")

Traceback (most recent call last):

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\spyder_kernels\py3compat.py", line 356, in compat_exec exec(code, globals, locals)

File "g:\program\dropbox\python\xarray_line_plot.py", line 122, in <module> fg = ds.plot.scatter("A", "B", z="z", hue="y", row="x", col="w")

File "C:\Users\J.W\Documents\GitHub\xarray\xarray\plot\accessor.py", line 975, in scatter return dataset_plot.scatter(self._ds, args, *kwargs)

File "C:\Users\J.W\Documents\GitHub\xarray\xarray\plot\dataset_plot.py", line 234, in newplotfunc return _easy_facetgrid(kind="dataset", allargs, kwargs)

File "C:\Users\J.W\Documents\GitHub\xarray\xarray\plot\facetgrid.py", line 770, in _easy_facetgrid return g.map_dataset(plotfunc, x, y, **kwargs)

File "C:\Users\J.W\Documents\GitHub\xarray\xarray\plot\facetgrid.py", line 370, in map_dataset maybe_mappable = func(

File "C:\Users\J.W\Documents\GitHub\xarray\xarray\plot\dataset_plot.py", line 262, in newplotfunc primitive = plotfunc(

File "C:\Users\J.W\Documents\GitHub\xarray\xarray\plot\dataset_plot.py", line 541, in scatter primitive = ax.scatter(

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\matplotlib__init__.py", line 1423, in inner return func(ax, map(sanitize_sequence, args), *kwargs)

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\matplotlib\axes_axes.py", line 4626, in scatter collection._internal_update(kwargs)

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\matplotlib\artist.py", line 1186, in _internal_update return self._update_props(

File "C:\Users\J.W\anaconda3\envs\xarray-tests\lib\site-packages\matplotlib\artist.py", line 1160, in _update_props raise AttributeError(

AttributeError: PathCollection.set() got an unexpected keyword argument 'z' ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1277699919 https://github.com/pydata/xarray/pull/7052#issuecomment-1277699919 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MKCdP headtr1ck 43316012 2022-10-13T14:25:10Z 2022-10-13T14:25:10Z COLLABORATOR

Next time I should split such a PR into smaller ones, haha. Anyone ready for a final review?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1276768300 https://github.com/pydata/xarray/pull/7052#issuecomment-1276768300 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85MGfAs headtr1ck 43316012 2022-10-12T21:44:49Z 2022-10-12T21:44:49Z COLLABORATOR

That was quite a merge, haha.... @Illviljan I had to undo some of your work, it just did not work well with static typing. Hopefully you are not too sad about it. :)

Is there a way to see the generated docs to check if my "hacks" worked?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1271779030 https://github.com/pydata/xarray/pull/7052#issuecomment-1271779030 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85Lzc7W Illviljan 14371165 2022-10-07T16:03:30Z 2022-10-07T16:03:30Z MEMBER

I've merged the PR. :) Have fun with the conflicts!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1267462812 https://github.com/pydata/xarray/pull/7052#issuecomment-1267462812 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85Li_Kc headtr1ck 43316012 2022-10-04T19:08:40Z 2022-10-04T19:08:40Z COLLABORATOR

Excellent! Should we hit the green button?

Don't know if @Illviljan wants to merge his PR first or prefers to solve the merge conflicts himself :P

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 1,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1267449828 https://github.com/pydata/xarray/pull/7052#issuecomment-1267449828 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85Li7_k max-sixty 5635139 2022-10-04T18:55:34Z 2022-10-04T18:55:34Z MEMBER

Excellent! Should we hit the green button?

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1266744003 https://github.com/pydata/xarray/pull/7052#issuecomment-1266744003 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85LgPrD headtr1ck 43316012 2022-10-04T10:33:53Z 2022-10-04T10:33:53Z COLLABORATOR

So finally I have decided to properly deprecate positional arguments since I think many users are still using them (even many tests where using them...)

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1266112842 https://github.com/pydata/xarray/pull/7052#issuecomment-1266112842 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85Ld1lK headtr1ck 43316012 2022-10-03T22:02:12Z 2022-10-04T10:13:00Z COLLABORATOR

wait.... did mypy 0.981 change the behavior of overloads with None and Hashable? I now get errors for ```python from typing import Hashable

@overload def x(a: Hashable) -> Hashable: ...

@overload def x(a: None = None) -> None: ...

def x(a: Hashable | None = None) -> Hashable | None: return a ``` but this works with 0.971. I cannot find anything on the changelog... Interesting that does not break other things in xarray since None is always treated differently! (In theory mypy is right, since None is actually hashable...)

Edit: see https://github.com/python/mypy/issues/13805, adding some type: ignore for this is the "solution"

{
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 2
}
  Add typing to plot methods 1377128403
1257271454 https://github.com/pydata/xarray/pull/7052#issuecomment-1257271454 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K8HCe headtr1ck 43316012 2022-09-25T20:19:16Z 2022-09-25T20:19:16Z COLLABORATOR

One point aside — when this is done, we may be able to turn on mypy's strict mode, at least for the tests path, so then tests always need annotations, and our annotations get tested.

(for context, a year ago or so we found some of them were wrong, but weren't being tested, because -> None wasn't in the tests)

I think there are still many untyped areas, especially internal stuff. But we can give it a try and see where it collapses :)

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 1,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1257270633 https://github.com/pydata/xarray/pull/7052#issuecomment-1257270633 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K8G1p max-sixty 5635139 2022-09-25T20:14:08Z 2022-09-25T20:14:08Z MEMBER

One point aside — when this is done, we may be able to turn on mypy's strict mode, at least for the tests path, so then tests always need annotations, and our annotations get tested.

(for context, a year ago or so we found some of them were wrong, but weren't being tested, because -> None wasn't in the tests)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1257224879 https://github.com/pydata/xarray/pull/7052#issuecomment-1257224879 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K77qv Illviljan 14371165 2022-09-25T16:05:46Z 2022-09-25T16:05:46Z MEMBER

I've merged the easy ones now. I'm not as confident on #6778 and could use another review on it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1257217585 https://github.com/pydata/xarray/pull/7052#issuecomment-1257217585 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K754x headtr1ck 43316012 2022-09-25T15:23:18Z 2022-09-25T15:25:13Z COLLABORATOR

Finally I am happy with the changes, the signatures are correct at runtime and static type checking time. I was finally: 1. renaming the xarray.plot.plot module to xarray.plot.dataarray_plot since it was shadowing the plot method (Is added to breaking changes in whats-new, hopefully not many people are importing from this module directly) 2. creating a new xarray.plot.accessor module (see https://github.com/pydata/xarray/pull/7052#issuecomment-1257029973 option-1)

@Illviljan I'm sorry if you have to change your plotting PRs if this gets merged first. If you prefer, we can merge your PRs first and I will fix the conflicts here :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1257210385 https://github.com/pydata/xarray/pull/7052#issuecomment-1257210385 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K74IR headtr1ck 43316012 2022-09-25T14:40:34Z 2022-09-25T14:40:34Z COLLABORATOR

I have tried to solve it with ParamSpec and writing a custom wraps decorator, but it did not work, presumably due to https://github.com/python/mypy/issues/13540

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1257178756 https://github.com/pydata/xarray/pull/7052#issuecomment-1257178756 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K7waE mathause 10194086 2022-09-25T11:57:02Z 2022-09-25T11:57:22Z MEMBER

I'd opt for (1) & a comment on why it needs a separate module.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1257029412 https://github.com/pydata/xarray/pull/7052#issuecomment-1257029412 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K7L8k headtr1ck 43316012 2022-09-24T17:51:02Z 2022-09-25T10:43:14Z COLLABORATOR

Maybe there's something to learn from how pandas does it: https://github.com/pandas-dev/pandas/tree/main/pandas/plotting ?

Just had a quick look and I think their typing of the accessor is wrong, haha. They claim to return a PlotAccessor instance when calling e.g. df.plot.line(). But I did not test it. Edit: turns out that it works, but I have no idea how or why, haha Edit2: only pyright can resolve the type of these function, mypy says Any...

I'm a little skeptical if all the arguments in scatter are necessary and maybe they can be hidden in kwargs? Should make the overloads a little shorter.

I've been working on moving all plots to the DataArray side starting with scatter in #6778. It should also remove the list[PathCollection] overloads.

I saw that, that's why I left the DataArray scatter untouched for now.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1257029973 https://github.com/pydata/xarray/pull/7052#issuecomment-1257029973 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K7MFV headtr1ck 43316012 2022-09-24T17:53:18Z 2022-09-24T17:54:24Z COLLABORATOR

For now I see two options:

  1. Move the accessor to its own module. For the user nothing should change since nobody should use the accessor directly anyway.
  2. Create a plot.pyi typing file (should hopefully also resolve the wrapping issue since the overload only lives there)

In principle also a combination of the two is possible :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1257014146 https://github.com/pydata/xarray/pull/7052#issuecomment-1257014146 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K7IOC Illviljan 14371165 2022-09-24T16:52:16Z 2022-09-24T16:52:16Z MEMBER

Maybe there's something to learn from how pandas does it: https://github.com/pandas-dev/pandas/tree/main/pandas/plotting ?

I'm a little skeptical if all the arguments in scatter are necessary and maybe they can be hidden in kwargs? Should make the overloads a little shorter.

I've been working on moving all plots to the DataArray side starting with scatter in #6778. It should also remove the list[PathCollection] overloads.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1256931771 https://github.com/pydata/xarray/pull/7052#issuecomment-1256931771 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K60G7 headtr1ck 43316012 2022-09-24T10:16:10Z 2022-09-24T10:21:05Z COLLABORATOR

Ok found another interesting problem: the e.g. functools.wraps(imshow) in the PlotAccessor works because in the moment it is called, there is no class method named "imshow", so it will use the module method, which is exactly what we want. However, as soon as one adds overloads, there indeed is a "imshow" class method (just the overload wrapper) and it tries to wrap this instead, which goes wrong (so the overload shadows the module method that we want)...

Does anyone know how we can force it to use the module imshow instead of the overload wrapper? The only thing I can think of is to move the Accessor to its own module, which might actually not be a bad idea?

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 1
}
  Add typing to plot methods 1377128403
1256702326 https://github.com/pydata/xarray/pull/7052#issuecomment-1256702326 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K58F2 headtr1ck 43316012 2022-09-23T21:39:10Z 2022-09-23T21:39:10Z COLLABORATOR

Wow, to fix the overloads I had to copy-paste the complete function signature for each overload and again for the accessor methods. This leads to a massive overhead which I assume the initial author wanted to prevent by using the decorators in the first place...

Are there any objections to leaving it like this? We could also deviate from the approach of adding typing inline and use stub files (.pyi like in typed_ops).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1255601287 https://github.com/pydata/xarray/pull/7052#issuecomment-1255601287 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85K1vSH headtr1ck 43316012 2022-09-22T22:03:05Z 2022-09-22T22:03:05Z COLLABORATOR

Finally it is a much larger PR than initially expected. Turns out that the col and row arguments have to be overloaded since they return a FacetGrid instead of a primitive.

I am now stuck in trying to resolve the broken test. Does anyone know how to use @overload decorators on a function that is wrapped with functools.wraps(...)? This does not seem to work and the signature is messed up?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1252966690 https://github.com/pydata/xarray/pull/7052#issuecomment-1252966690 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85KrsEi max-sixty 5635139 2022-09-20T22:09:27Z 2022-09-20T22:09:27Z MEMBER

Congrats for doing all these!! This must be (almost?) the last of untyped modules?

{
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 2,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1252924768 https://github.com/pydata/xarray/pull/7052#issuecomment-1252924768 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85Krh1g headtr1ck 43316012 2022-09-20T21:19:29Z 2022-09-20T21:19:29Z COLLABORATOR

The 2D plotfunctions have the correct annotions at runtime (plotfunc.__annotations__) but mypy thinks they are args, *kwargs. Same with the accessor methods.

Does anyone have an idea how to tell mypy that the type is actually the function signature of the "inside" newplotmethod function? Do we need to define a dummy method with the same signature or something?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1251884962 https://github.com/pydata/xarray/pull/7052#issuecomment-1251884962 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85Knj-i headtr1ck 43316012 2022-09-20T06:12:09Z 2022-09-20T06:12:09Z COLLABORATOR

I could add some return type annotations, but I doubt that mypy can work with the signature hacks and will always use args, *kwargs.

Any thoughts?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403
1250381535 https://github.com/pydata/xarray/pull/7052#issuecomment-1250381535 https://api.github.com/repos/pydata/xarray/issues/7052 IC_kwDOAMm_X85Kh07f headtr1ck 43316012 2022-09-18T20:30:28Z 2022-09-18T20:30:28Z COLLABORATOR

Puh, this stacking of decorators is quite a brainf*ck...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add typing to plot methods 1377128403

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 15.143ms · About: xarray-datasette