Skip to content

Commit

Permalink
add DeprecationWarning for info() (#30)
Browse files Browse the repository at this point in the history
* add DeprecationWarning

* update warning

* remove space
  • Loading branch information
CSY-ModelCloud authored Nov 29, 2024
1 parent 8f73ef0 commit 190b624
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions device_smi/device.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import platform
import re
import warnings

from .apple import AppleDevice
from .base import _run
Expand Down Expand Up @@ -51,6 +52,14 @@ def __init__(self, device):
else:
raise Exception(f"The device {device_type} is not supported")

def info(self):
warnings.warn(
"info() method is deprecated and will be removed in next release.",
DeprecationWarning,
stacklevel=2
)
return self

def memory_total(self):
return self.memory_total

Expand Down

0 comments on commit 190b624

Please sign in to comment.