Skip to content
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

docs: Undoc deprecated functionality #3509

Merged
merged 4 commits into from
Jul 30, 2024
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
5 changes: 1 addition & 4 deletions altair/utils/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def save(
vegalite_version: str | None = None,
embed_options: dict | None = None,
json_kwds: dict | None = None,
webdriver: Literal["chrome", "firefox"] | None = None,
scale_factor: float = 1,
engine: Literal["vl-convert"] | None = None,
inline: bool = False,
Expand Down Expand Up @@ -119,8 +118,6 @@ def save(
json_kwds : dict (optional)
Additional keyword arguments are passed to the output method
associated with the specified format.
webdriver : string {'chrome' | 'firefox'} (optional)
This argument is deprecated as it's not relevant for the new vl-convert engine.
scale_factor : float (optional)
scale_factor to use to change size/resolution of png or svg output
engine: string {'vl-convert'}
Expand All @@ -134,7 +131,7 @@ def save(
**kwargs :
additional kwargs passed to spec_to_mimebundle.
"""
if webdriver is not None:
if _ := kwargs.pop("webdriver", None):
deprecated_warn(
"The webdriver argument is not relevant for the new vl-convert engine which replaced altair_saver. "
"The argument will be removed in a future release.",
Expand Down
61 changes: 8 additions & 53 deletions altair/vegalite/v5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,11 @@ def __init__(
self.param = param
self.param_type = param_type

@utils.deprecated(version="5.0.0", alternative="to_dict")
@utils.deprecated(
version="5.0.0",
alternative="to_dict",
message="No need to call '.ref()' anymore.",
)
def ref(self) -> dict:
"""'ref' is deprecated. No need to call '.ref()' anymore."""
return self.to_dict()
Expand Down Expand Up @@ -1332,24 +1336,7 @@ def _selection(type: Optional[SelectionType_T] = Undefined, **kwds) -> Parameter
message="These functions also include more helpful docstrings.",
)
def selection(type: Optional[SelectionType_T] = Undefined, **kwds) -> Parameter:
"""
Users are recommended to use either 'selection_point' or 'selection_interval' instead, depending on the type of parameter they want to create.

Create a selection parameter.

Parameters
----------
type : enum('point', 'interval') (required)
Determines the default event processing and data query for the
selection. Vega-Lite currently supports two selection types:
* "point" - to select multiple discrete data values; the first
value is selected on click and additional values toggled on
shift-click.
* "interval" - to select a continuous range of data values on
drag.
**kwds :
additional keywords to control the selection.
"""
"""'selection' is deprecated use 'selection_point' or 'selection_interval' instead, depending on the type of parameter you want to create."""
return _selection(type=type, **kwds)


Expand Down Expand Up @@ -1997,7 +1984,6 @@ def save(
vegaembed_version: str = VEGAEMBED_VERSION,
embed_options: dict | None = None,
json_kwds: dict | None = None,
webdriver: str | None = None,
engine: str | None = None,
inline=False,
**kwargs,
Expand Down Expand Up @@ -2037,8 +2023,6 @@ def save(
json_kwds : dict (optional)
Additional keyword arguments are passed to the output method
associated with the specified format.
webdriver : string {'chrome' | 'firefox'} (optional)
This argument is deprecated as it's not relevant for the new vl-convert engine.
engine: string {'vl-convert', 'altair_saver'}
the conversion engine to use for 'png', 'svg', and 'pdf' formats
inline: bool (optional)
Expand All @@ -2050,7 +2034,7 @@ def save(
**kwargs :
additional kwargs passed to spec_to_mimebundle.
"""
if webdriver is not None:
if _ := kwargs.pop("webdriver", None):
utils.deprecated_warn(
"The webdriver argument is not relevant for the new vl-convert engine which replaced altair_saver. "
"The argument will be removed in a future release.",
Expand Down Expand Up @@ -3461,36 +3445,7 @@ def serve(
http_server=None,
**kwargs,
):
"""
'serve' is deprecated. Use 'show' instead.

Open a browser window and display a rendering of the chart

Parameters
----------
html : string
HTML to serve
ip : string (default = '127.0.0.1')
ip address at which the HTML will be served.
port : int (default = 8888)
the port at which to serve the HTML
n_retries : int (default = 50)
the number of nearby ports to search if the specified port
is already in use.
files : dictionary (optional)
dictionary of extra content to serve
jupyter_warning : bool (optional)
if True (default), then print a warning if this is used
within the Jupyter notebook
open_browser : bool (optional)
if True (default), then open a web browser to the given HTML
http_server : class (optional)
optionally specify an HTTPServer class to use for showing the
figure. The default is Python's basic HTTPServer.
**kwargs :
additional keyword arguments passed to the save() method

"""
"""'serve' is deprecated. Use 'show' instead."""
from ...utils.server import serve

html = io.StringIO()
Expand Down
3 changes: 0 additions & 3 deletions doc/user_guide/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,8 @@ API Functions
layer
param
repeat
selection
selection_interval
selection_multi
selection_point
selection_single
sequence
sphere
topo_feature
Expand Down
2 changes: 2 additions & 0 deletions tools/generate_api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def iter_objects(
not (isinstance(obj, type) and issubclass(obj, restrict_to_subclass))
):
continue
if hasattr(obj, "__deprecated__"):
continue
yield name


Expand Down