8000 seaborn: mark simple deprecations with typing_extensions.deprecated by hamdanal · Pull Request #11130 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

seaborn: mark simple deprecations with typing_extensions.deprecated #11130

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
merged 3 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion stubs/seaborn/seaborn/algorithms.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@ from numpy.typing import ArrayLike, NDArray

from .utils import _Seed

# TODO: This crashes stubtest. Uncomment when mypy 1.8 is released with the fix https://github.com/python/mypy/pull/16457
# @overload
# def bootstrap(
# *args: ArrayLike,
# n_boot: int = 10000,
# func: str | Callable[..., Any] = "mean",
# axis: int | None = None,
# units: ArrayLike | None = None,
# seed: _Seed | None = None,
# ) -> NDArray[Any]: ...
# @overload
# @deprecated("Parameter `random_seed` is deprecated in favor of `seed`")
def bootstrap(
*args: ArrayLike,
n_boot: int = 10000,
func: str | Callable[..., Any] = "mean",
axis: int | None = None,
units: ArrayLike | None = None,
seed: _Seed | None = None,
random_seed: _Seed | None = None, # deprecated
random_seed: _Seed | None = None,
) -> NDArray[Any]: ...
3 changes: 2 additions & 1 deletion stubs/seaborn/seaborn/axisgrid.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import os
from _typeshed import Incomplete
from collections.abc import Callable, Generator, Iterable, Mapping
from typing import IO, Any, TypeVar
from typing_extensions import Concatenate, Literal, ParamSpec, Self, TypeAlias
from typing_extensions import Concatenate, Literal, ParamSpec, Self, TypeAlias, deprecated

import numpy as np
from matplotlib.artist import Artist
Expand Down Expand Up @@ -92,6 +92,7 @@ class _BaseGrid:
**kwargs: Any,
) -> Self: ...
@property
@deprecated("Attribute `fig` is deprecated in favor of `figure`")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

def fig(self) -> Figure: ...
@property
def figure(self) -> Figure: ...
Expand Down
5 changes: 3 additions & 2 deletions stubs/seaborn/seaborn/distributions.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import Incomplete
from collections.abc import Iterable
from typing import Any
from typing_extensions import Literal
from typing_extensions import Literal, deprecated

from matplotlib.axes import Axes
from matplotlib.colors import Colormap
Expand Down Expand Up @@ -139,7 +139,8 @@ def displot(
facet_kws: dict[str, Any] | None = None,
**kwargs: Any,
) -> FacetGrid: ...
def distplot( # deprecated
@deprecated("Function `distplot` is deprecated and will be removed in seaborn v0.14.0")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

def distplot(
a: Incomplete | None = None,
bins: Incomplete | None = None,
hist: bool = True,
Expand Down
16 changes: 11 additions & 5 deletions stubs/seaborn/seaborn/rcmod.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import Unused
from collections.abc import Callable, Sequence
from typing import Any, TypeVar
from typing_extensions import Literal
from typing_extensions import Literal, deprecated

from matplotlib.typing import ColorType

Expand Down Expand Up @@ -30,10 +30,16 @@ def set_theme(
color_codes: bool = True,
rc: dict[str, Any] | None = None,
) -> None: ...

# def set(*args, **kwargs) -> None: ... # deprecated alias for set_theme
set = set_theme

@deprecated("Function `set` is deprecated in favor of `set_theme`")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

def set(
context: Literal["paper", "notebook", "talk", "poster"] | dict[str, Any] = "notebook",
style: Literal["white", "dark", "whitegrid", "darkgrid", "ticks"] | dict[str, Any] = "darkgrid",
palette: str | Sequence[ColorType] | None = "deep",
font: str = "sans-serif",
font_scale: float = 1,
color_codes: bool = True,
rc: dict[str, Any] | None = None,
) -> None: ...
def reset_defaults() -> None: ...
def reset_orig() -> None: ...
def axes_style(
Expand Down
5 changes: 3 additions & 2 deletions stubs/seaborn/seaborn/utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import datetime as dt
from _typeshed import Incomplete, SupportsGetItem
from collections.abc import Callable, Iterable, Mapping, Sequence
from typing import Any, TypeVar, overload
from typing_extensions import Literal, SupportsIndex, TypeAlias
from typing_extensions import Literal, SupportsIndex, TypeAlias, deprecated

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -75,7 +75,8 @@ def saturate(color: ColorType) -> tuple[float, float, float]: ...
def set_hls_values(
color: ColorType, h: float | None = None, l: float | None = None, s: float | None = None
) -> tuple[float, float, float]: ...
def axlabel(xlabel: str, ylabel: str, **kwargs: Any) -> None: ... # deprecated
@deprecated("Function `axlabel` is deprecated and will be removed in a future version")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

def axlabel(xlabel: str, ylabel: str, **kwargs: Any) -> None: ...
def remove_na(vector: _VectorT) -> _VectorT: ...
def get_color_cycle() -> list[str]: ...

Expand Down
0