Skip to content
Open
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
3 changes: 0 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ Configuration tools

.. automodsumm:: ultraplot.config
:toctree: api
:skip: inline_backend_fmt, RcConfigurator


Constructor functions
Expand All @@ -79,7 +78,6 @@ Constructor functions

.. automodsumm:: ultraplot.constructor
:toctree: api
:skip: Colors


Locators and formatters
Expand Down Expand Up @@ -110,7 +108,6 @@ Colormaps and normalizers

.. automodsumm:: ultraplot.colors
:toctree: api
:skip: ListedColormap, LinearSegmentedColormap, PerceptuallyUniformColormap, LinearSegmentedNorm


Projection classes
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,5 @@ classes and :ref:`constructor functions <why_constructor>`.
:ref:`modifying individual settings, changing settings in bulk, and
temporarily changing settings in context blocks <ug_rc>`.
It also introduces several :ref:`new setings <ug_config>`
and sets up the inline plotting backend with :func:`~ultraplot.config.inline_backend_fmt`
and sets up the inline plotting backend with :func:`~ultraplot.config.config_inline_backend`
so that your inline figures look the same as your saved figures.
6 changes: 0 additions & 6 deletions ultraplot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
from .colors import DiscreteColormap as DiscreteColormap
from .colors import DiscreteNorm as DiscreteNorm
from .colors import DivergingNorm as DivergingNorm
from .colors import LinearSegmentedColormap as LinearSegmentedColormap
from .colors import LinearSegmentedNorm as LinearSegmentedNorm
from .colors import ListedColormap as ListedColormap
from .colors import PerceptualColormap as PerceptualColormap
from .colors import PerceptuallyUniformColormap as PerceptuallyUniformColormap
from .colors import SegmentedNorm as SegmentedNorm
from .colors import _cmap_database as colormaps
from .config import config_inline_backend as config_inline_backend
Expand Down Expand Up @@ -138,14 +134,12 @@
from .utils import edges as edges
from .utils import edges2d as edges2d
from .utils import get_colors as get_colors
from .utils import saturate as saturate
from .utils import scale_luminance as scale_luminance
from .utils import scale_saturation as scale_saturation
from .utils import set_alpha as set_alpha
from .utils import set_hue as set_hue
from .utils import set_luminance as set_luminance
from .utils import set_saturation as set_saturation
from .utils import shade as shade
from .utils import shift_hue as shift_hue
from .utils import to_hex as to_hex
from .utils import to_rgb as to_rgb
Expand Down
5 changes: 0 additions & 5 deletions ultraplot/axes/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4063,7 +4063,6 @@ def _scatter_c_is_scalar_data(
return False
return values.shape[0] == point_count

@warnings._rename_kwargs("0.6.0", centers="values")
def _parse_cmap(
self,
*args,
Expand Down Expand Up @@ -7703,9 +7702,5 @@ def _iter_arg_cols(self, *args, label=None, labels=None, values=None, **kwargs):
# Related parsing functions for warnings
_level_parsers = (_parse_level_vals, _parse_level_num, _parse_level_lim)

# Rename the shorthands
boxes = warnings._rename_objs("0.8.0", boxes=box)
violins = warnings._rename_objs("0.8.0", violins=violin)


# mock commit
45 changes: 0 additions & 45 deletions ultraplot/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ def _cycle_handler(value):
"SegmentedNorm",
"ColorDatabase",
"ColormapDatabase",
"ListedColormap", # deprecated
"LinearSegmentedColormap", # deprecated
"PerceptuallyUniformColormap", # deprecated
"LinearSegmentedNorm", # deprecated
]

# Default colormap properties
Expand Down Expand Up @@ -1689,16 +1685,6 @@ def from_list(cls, *args, **kwargs):
cdict[key] = _make_segment_data(values, coords, ratios)
return cls(name, cdict, **kwargs)

# Deprecated
to_listed = warnings._rename_objs("0.8.0", to_listed=to_discrete)
concatenate, punched, truncated, updated = warnings._rename_objs(
"0.6.0",
concatenate=append,
punched=cut,
truncated=truncate,
updated=copy,
)


class DiscreteColormap(mcolors.ListedColormap, _Colormap):
r"""
Expand Down Expand Up @@ -1987,14 +1973,6 @@ def from_file(cls, path, *, warn_on_failure=False):
"""
return cls._from_file(path, warn_on_failure=warn_on_failure)

# Rename methods
concatenate, truncated, updated = warnings._rename_objs(
"0.6.0",
concatenate=append,
truncated=truncate,
updated=copy,
)


class PerceptualColormap(ContinuousColormap):
"""
Expand Down Expand Up @@ -2224,7 +2202,6 @@ def to_continuous(self, name=None, **kwargs):

@classmethod
@docstring._snippet_manager
@warnings._rename_kwargs("0.7.0", fade="saturation", shade="luminance")
def from_color(cls, *args, **kwargs):
"""
Return a simple monochromatic "sequential" colormap that blends from white
Expand Down Expand Up @@ -2420,11 +2397,6 @@ def from_list(cls, *args, adjust_grays=True, **kwargs):

return cls(name, cdict, **kwargs)

# Deprecated
to_linear_segmented = warnings._rename_objs(
"0.8.0", to_linear_segmented=to_continuous
)


def _interpolate_scalar(x, x0, x1, y0, y1):
"""
Expand Down Expand Up @@ -2490,9 +2462,6 @@ class DiscreteNorm(mcolors.BoundaryNorm):
# WARNING: Must be child of BoundaryNorm. Many methods in ColorBarBase
# test for class membership, crucially including _process_values(), which
# if it doesn't detect BoundaryNorm will try to use DiscreteNorm.inverse().
@warnings._rename_kwargs(
"0.7.0", extend="unique", descending="DiscreteNorm(descending_levels)"
)
def __init__(
self,
levels,
Expand Down Expand Up @@ -3325,17 +3294,3 @@ def register_lazy(self, name, path, type, is_default=False):
# Initialize databases
_cmap_database = _init_cmap_database()
_color_database = _init_color_database()

# Deprecated
(
ListedColormap,
LinearSegmentedColormap,
PerceptuallyUniformColormap,
LinearSegmentedNorm,
) = warnings._rename_objs( # noqa: E501
"0.8.0",
ListedColormap=DiscreteColormap,
LinearSegmentedColormap=ContinuousColormap,
PerceptuallyUniformColormap=PerceptualColormap,
LinearSegmentedNorm=SegmentedNorm,
)
14 changes: 0 additions & 14 deletions ultraplot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
"register_cycles",
"register_colors",
"register_fonts",
"RcConfigurator", # deprecated
"inline_backend_fmt", # deprecated
]

# Constants
Expand Down Expand Up @@ -1888,9 +1886,6 @@ def changed(self):
rcdict.pop("axes.prop_cycle", None)
return _filter_style_dict(rcdict, warn=False)

# Renamed methods
load_file = warnings._rename_objs("0.8.0", load_file=load)


# Initialize locations
_init_user_folders()
Expand All @@ -1907,12 +1902,3 @@ def changed(self):
#: Instance of `Configurator`. This controls both `rc_matplotlib` and `rc_ultraplot`
#: settings. See the :ref:`configuration guide <ug_config>` for details.
rc = Configurator()

# Deprecated
RcConfigurator = warnings._rename_objs(
"0.8.0",
RcConfigurator=Configurator,
)
inline_backend_fmt = warnings._rename_objs(
"0.6.0", inline_backend_fmt=config_inline_backend
)
17 changes: 1 addition & 16 deletions ultraplot/constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
ic, # noqa: F401
warnings,
)
from .utils import get_colors, to_hex, to_rgba
from .utils import to_hex, to_rgba

try:
from mpl_toolkits.basemap import Basemap
Expand All @@ -62,7 +62,6 @@
"Colormap",
"Norm",
"Cycle",
"Colors", # deprecated
]

# Color cycle constants
Expand Down Expand Up @@ -482,9 +481,6 @@ def _modify_colormap(cmap, *, cut, left, right, reverse, shift, alpha, samples):
return cmap


@warnings._rename_kwargs(
"0.8.0", fade="saturation", shade="luminance", to_listed="discrete"
)
def Colormap(
*args,
name=None,
Expand Down Expand Up @@ -711,13 +707,6 @@ def _pop_modification(key):
"Colormap() requires either positional arguments or "
"'hue', 'chroma', 'saturation', and/or 'luminance' keywords."
)
deprecated = {"listed": "discrete", "linear": "continuous"}
if listmode in deprecated:
oldmode, listmode = listmode, deprecated[listmode]
warnings._warn_ultraplot(
f"Please use listmode={listmode!r} instead of listmode={oldmode!r}."
"Option was renamed in v0.8 and will be removed in a future relase."
)
options = {"discrete", "continuous", "perceptual"}
for key, mode in zip(("listmode", "filemode"), (listmode, filemode)):
if mode not in options:
Expand Down Expand Up @@ -1792,7 +1781,3 @@ def Proj(

proj._proj_backend = backend
return proj


# Deprecated
Colors = warnings._rename_objs("0.8.0", Colors=get_colors)
1 change: 0 additions & 1 deletion ultraplot/demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ def show_colorspaces(*, luminance=None, saturation=None, hue=None, refwidth=2):
return fig, axs


@warnings._rename_kwargs("0.8.0", categories="include")
@warnings._rename_kwargs("0.10.0", rasterize="rasterized")
def _draw_bars(
cmaps,
Expand Down
5 changes: 0 additions & 5 deletions ultraplot/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,13 +718,8 @@ def __repr__(self):
opts = ", ".join(f"{key}={value!r}" for key, value in opts.items())
return f"Figure({geom}{opts})"

# NOTE: If _rename_kwargs argument is an invalid identifier, it is
# simply used in the warning message.
@docstring._obfuscate_kwargs
@docstring._snippet_manager
@warnings._rename_kwargs(
"0.7.0", axpad="innerpad", autoformat="uplt.rc.autoformat = {}"
)
@_alias_kwargs(
refnum=("ref",),
refaspect=("aspect",),
Expand Down
5 changes: 2 additions & 3 deletions ultraplot/tests/test_constructor_helpers_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ def fake_save(self, **kwargs):

monkeypatch.setattr(pcolors.DiscreteColormap, "save", fake_save)

with pytest.warns(UltraPlotWarning, match="listmode='discrete'"):
deprecated = constructor.Colormap(["red", "blue"], listmode="listed")
assert isinstance(deprecated, pcolors.DiscreteColormap)
discrete = constructor.Colormap(["red", "blue"], listmode="discrete")
assert isinstance(discrete, pcolors.DiscreteColormap)

cmap = constructor.Colormap(
str(hex_path),
Expand Down
3 changes: 1 addition & 2 deletions ultraplot/tests/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ def test_type_checking_block_covers_public_all():
- Module-level scalars defined directly in ``__init__.py`` (``name``,
``version``, ``__version__``, ``setup``) — already visible to type checkers
without an import.
- Deprecated ``_rename_objs`` wrappers (e.g. ``RcConfigurator``,
``inline_backend_fmt``, ``Colors``) — their runtime type is a dynamically
- Deprecated ``_rename_objs`` wrappers — their runtime type is a dynamically
generated class/function from ``internals.warnings``; they cannot be
imported cleanly and are not worth exposing to type checkers.
"""
Expand Down
11 changes: 0 additions & 11 deletions ultraplot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
"to_rgba",
"to_xyza",
"units",
"shade", # deprecated
"saturate", # deprecated
]

UNIT_REGEX = re.compile(
Expand Down Expand Up @@ -768,7 +766,6 @@ def _fontsize_to_pt(size):
)


@warnings._rename_kwargs("0.6.0", units="dest")
def units(
value, numeric=None, dest=None, *, fontsize=None, figure=None, axes=None, width=None
):
Expand Down Expand Up @@ -1158,11 +1155,3 @@ def check_for_update(package_name: str) -> None:
f"{current_version} → {latest_version}\n"
f"Run: pip install -U {package_name}\033[0m"
)


# Deprecations
shade, saturate = warnings._rename_objs(
"0.6.0",
shade=scale_luminance,
saturate=scale_saturation,
)