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

remove deprecated methods #56

Merged
merged 1 commit into from
Aug 10, 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
19 changes: 0 additions & 19 deletions whitecanvas/canvas/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from cmap import Color
from numpy.typing import ArrayLike
from psygnal import Signal, SignalGroup
from typing_extensions import deprecated

from whitecanvas import layers as _l
from whitecanvas import protocols, theme
Expand Down Expand Up @@ -49,7 +48,6 @@
OrientationLike,
Rect,
Symbol,
_Void,
)
from whitecanvas.utils.normalize import as_array_1d, normalize_xy
from whitecanvas.utils.type_check import is_real_number
Expand All @@ -62,7 +60,6 @@

_L = TypeVar("_L", bound=_l.Layer)
_L0 = TypeVar("_L0", _l.Bars, _l.Band)
_void = _Void()


class CanvasEvents(SignalGroup):
Expand Down Expand Up @@ -734,22 +731,6 @@ def stack_over(self, layer: _L0) -> StackOverPlotter[Self, _L0]:
def between(self, l0, l1) -> BetweenPlotter[Self]:
return BetweenPlotter(self, l0, l1)

@deprecated(
"ImageRef is deprecated and will be removed in the future. "
"Please use the Image methods `with_text`, `with_colorbar` instead.",
)
def imref(self, layer: _l.Image):
"""The Image reference namespace."""
from whitecanvas.canvas._imageref import ImageRef

while isinstance(layer, _l.LayerWrapper):
layer = layer._base_layer
if not isinstance(layer, _l.Image):
raise TypeError(
f"Expected an Image layer or its wrapper, got {type(layer)}."
)
return ImageRef(self, layer)

def fit(self, layer: _l.DataBoundLayer[_P]) -> FitPlotter[Self, _P]:
"""The fit plotter namespace."""
return FitPlotter(self, layer)
Expand Down
56 changes: 0 additions & 56 deletions whitecanvas/canvas/_imageref.py

This file was deleted.

15 changes: 4 additions & 11 deletions whitecanvas/layers/group/labeled.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import numpy as np
from cmap import Colormap
from numpy.typing import NDArray
from typing_extensions import deprecated

from whitecanvas.backend import Backend
from whitecanvas.layers import _legend, _mixin, _text_utils
Expand All @@ -28,14 +27,12 @@
Origin,
Rect,
XYData,
_Void,
)
from whitecanvas.utils.normalize import as_any_1d_array, as_color_array

if TYPE_CHECKING:
from typing_extensions import Self

_void = _Void()
_NFace = TypeVar("_NFace", bound="_mixin.FaceNamespace")
_NEdge = TypeVar("_NEdge", bound="_mixin.EdgeNamespace")
_Size = TypeVar("_Size")
Expand Down Expand Up @@ -131,10 +128,6 @@ def with_text_offset(self, dx: Any, dy: Any):
self.texts.set_pos(px + xoff, py + yoff)
self._text_offset = _offset

@deprecated("add_text_offset is deprecated. Please use with_text_offset instead.")
def add_text_offset(self, *args, **kwargs):
return self.with_text_offset(*args, **kwargs)

def with_xerr(
self,
len_lower: float,
Expand Down Expand Up @@ -736,12 +729,12 @@ def origin(self, origin: Origin | str):
self.image.origin = origin

@overload
def fit_to(self, bbox: Rect | tuple[float, float, float, float], /) -> Image:
...
def fit_to(self, bbox: Rect | tuple[float, float, float, float], /) -> Image: ...

@overload
def fit_to(self, left: float, right: float, bottom: float, top: float, /) -> Image:
...
def fit_to(
self, left: float, right: float, bottom: float, top: float, /
) -> Image: ...

def fit_to(self, *args) -> Image:
"""Fit the image to the given bounding box."""
Expand Down
Loading