-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,28 @@ | ||
| from collections.abc import Callable | ||
| from typing import Any | ||
| from typing import Any, overload | ||
| from typing_extensions import deprecated | ||
|
|
||
| from numpy.typing import ArrayLike, NDArray | ||
|
|
||
| from .utils import _Seed | ||
|
|
||
| @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, | ||
| random_seed: _Seed | None = None, # deprecated | ||
| ) -> 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, | ||
| ) -> NDArray[Any]: ... | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -92,6 +92,7 @@ class _BaseGrid: | |
| **kwargs: Any, | ||
| ) -> Self: ... | ||
| @property | ||
| @deprecated("Attribute `fig` is deprecated in favor of `figure`") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| def fig(self) -> Figure: ... | ||
| @property | ||
| def figure(self) -> Figure: ... | ||
|
|
||
| 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 | ||
|
|
@@ -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") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
|
||
| 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 | ||
|
|
||
|
|
@@ -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`") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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]: ... | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/mwaskom/seaborn/blob/2bb945c01ad0c18f4c9faa516f0a75e7b89043ec/seaborn/algorithms.py#L45-L49