Skip to content

Commit

Permalink
Remove sensor namespace redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Dec 30, 2023
1 parent 84d0fd6 commit a23110f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
17 changes: 0 additions & 17 deletions phoenix5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,3 @@


from .version import version as __version__


# backwards compat
# TODO: remove in 2024
def __getattr__(name):
if name != "sensors":
from .sensors import __all__ as sensors_all

if name in sensors_all:
import warnings
from . import sensors

message = f"{__name__}.{name} has moved to {__name__}.sensors"
warnings.warn(message, FutureWarning, stacklevel=2)
return getattr(sensors, name)

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
7 changes: 0 additions & 7 deletions tests/test_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,3 @@
def test_cancoder():
enc = phoenix5.sensors.CANCoder(0)
enc.getPosition()


def test_deprecated_import():
with pytest.warns(FutureWarning, match="moved"):
from phoenix5 import CANCoder

assert CANCoder is phoenix5.sensors.CANCoder

0 comments on commit a23110f

Please sign in to comment.