Skip to content

Commit

Permalink
changing warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
albi3ro committed Sep 13, 2024
1 parent fce3296 commit 421d589
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pennylane/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,26 @@ def __getattr__(name):
if name == "plugin_devices":
return pennylane.devices.device_constructor.plugin_devices

import warnings # pylint: disable=redefined-outer-name, import-outside-toplevel
from warnings import warn # pylint: disable=import-outside-toplevel

if name == "QubitDevice":
warnings.warn(
warn(
"QubitDevice will no longer be accessible top level. Please access "
" the class as pennylane.devices.QubitDevice",
PennyLaneDeprecationWarning,
)
return pennylane.devices._qubit_device.QubitDevice # pylint:disable=protected-access

if name == "QutritDevice":
warnings.warn(
warn(
"QutritDevice will no longer be accessible top level. Please access "
" the class as pennylane.devices.QutritDevice",
PennyLaneDeprecationWarning,
)
return pennylane.devices._qutrit_device.QutritDevice # pylint:disable=protected-access

if name == "Device":
warnings.warn(
warn(
"Device will no longer be accessible top level. Please access "
" the class as pennylane.devices.LegacyDevice",
PennyLaneDeprecationWarning,
Expand Down

0 comments on commit 421d589

Please sign in to comment.