|
21 | 21 |
|
22 | 22 | if is_using_hardware: |
23 | 23 | try: |
24 | | - from qnodeos.sdk.connection import ( |
25 | | - QNodeOSConnection as NetQASMConnection, # type: ignore |
26 | | - ) |
27 | | - from qnodeos.sdk.socket import Socket # type: ignore |
28 | | - |
29 | | - from netqasm.runtime.hardware import run_application # type: ignore |
| 24 | + from qnodeos.connection import * |
| 25 | + from qnodeos.socket import * |
30 | 26 | except ModuleNotFoundError: |
31 | | - raise ModuleNotFoundError("to use QNodeOS , `qnodeos` needs to be installed") |
| 27 | + raise ModuleNotFoundError("To use QNodeOS , `qnodeos` needs to be installed") |
| 28 | + |
| 29 | + from netqasm.runtime.hardware import run_application # type: ignore |
| 30 | + |
| 31 | + from abc import ABC |
| 32 | + from netqasm.sdk.classical_communication.socket import Socket as ABCSocket |
| 33 | + from netqasm.sdk.connection import BaseNetQASMConnection |
| 34 | + |
| 35 | + |
| 36 | + class NetQASMConnection(BaseNetQASMConnection, ABC): |
| 37 | + """ |
| 38 | + QNodeOS has dropped support for direct instantiations of `NetQASMConnection`. |
| 39 | + Use `qnodeos.connection.QNodeOSConnectionFactory` to create connections. |
| 40 | + """ |
| 41 | + pass |
| 42 | + |
| 43 | + |
| 44 | + class Socket(ABCSocket, ABC): |
| 45 | + """ |
| 46 | + QNodeOS has dropped support for `Socket`. |
| 47 | + Use `qnodeos.socket.[Client,Server]AppSocket` instead. |
| 48 | + """ |
| 49 | + pass |
| 50 | + |
| 51 | + |
| 52 | + raise DeprecationWarning( |
| 53 | + "QNodeOS has dropped support for `NetQASMConnection` and `Socket`." |
| 54 | + " Use `qnodeos.connection.QNodeOSConnectionFactory` to create connections and" |
| 55 | + " use `qnodeos.socket.[Client,Server]AppSocket` to replace `Socket`.") |
| 56 | + |
32 | 57 | elif simulator == Simulator.NETSQUID: |
33 | 58 | try: |
34 | 59 | from squidasm.nqasm.multithread import ( |
|
0 commit comments