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

Conversation

hamdanal
Copy link
Contributor

@hamdanal hamdanal commented Dec 9, 2023

Note that I intentionally left out deprecated parameters of the big API functions as they would require overloads with very long signatures.

random_seed: _Seed | None = None, # deprecated
) -> NDArray[Any]: ...
@overload
@deprecated("Parameter `random_seed` is deprecated in favor of `seed`")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -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.

@@ -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 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.

@@ -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.

This comment has been minimized.

@hamdanal
Copy link
Contributor Author

hamdanal commented Dec 9, 2023

Is the stubtest crash a known issue?

@AlexWaygood
Copy link
Member

Is the stubtest crash a known issue?

Yeah, it's fixed on mypy master, the fix should be included as part of mypy 1.8 :)

This comment has been minimized.

@AlexWaygood
Copy link
Member

@hamdanal
Copy link
Contributor Author

hamdanal commented Dec 9, 2023

See

Thank you. I just confirmed that the change passes on mypy's release-1.8 branch.

Copy link
Contributor

github-actions bot commented Dec 9, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks!

@srittau srittau merged commit 88193cd into python:main Dec 10, 2023
@hamdanal hamdanal deleted the seaborn-deprecations branch December 10, 2023 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants