Skip to content

TYP: annotate plotting._matplotlib.misc #36017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jbrockmendel
Copy link
Member

No description provided.

jbrockmendel and others added 30 commits August 20, 2020 21:19
@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Sep 1, 2020
@@ -130,7 +146,7 @@ def normalize(series):
if ax is None:
ax = plt.gca(xlim=[-1, 1], ylim=[-1, 1])

to_plot = {}
to_plot: Dict[Label, List[List[Any]]] = {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any? from matplotlib scatter, x, y : float or array-like, shape (n, )

vendoring https://github.com/predictive-analytics-lab/data-science-types/blob/master/matplotlib-stubs/axes.pyi might help.

maybe just Dict[Label, List[List]] while we don't enforce adding type parameters and we can revisit this later, rather than adding Any which maybe harder to track.

@@ -11,7 +11,7 @@


def _get_standard_colors(
num_colors=None, colormap=None, color_type="default", color=None
num_colors=None, colormap=None, color_type: str = "default", color=None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another potential use of Literal

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jbrockmendel lgtm except use of Any which maybe hard to track.

@simonjayhawkins simonjayhawkins added this to the 1.2 milestone Sep 1, 2020
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm merge on green

@simonjayhawkins simonjayhawkins merged commit 303e40b into pandas-dev:master Sep 1, 2020
@simonjayhawkins
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the annotate-plotting-misc branch September 1, 2020 16:43
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants