forked from pyvisa/pyvisa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisa.py
More file actions
61 lines (52 loc) · 1.44 KB
/
visa.py
File metadata and controls
61 lines (52 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- coding: utf-8 -*-
"""Module to provide an import shortcut for the most common VISA operations.
This file is part of PyVISA.
:copyright: 2014-2019 by PyVISA Authors, see AUTHORS for more details.
:license: MIT, see COPYING for more details.
"""
import warnings
warnings.warn(
(
"The visa module provided by PyVISA is being deprecated. "
"You can replace `import visa` by `import pyvisa as visa` "
"to achieve the same effect.\n\n"
"The reason for the deprecation is the possible conflict with "
"the visa package provided by the "
"https://github.com/visa-sdk/visa-python which can result in "
"hard to debug situations."
),
FutureWarning,
)
from pyvisa import logger, __version__, log_to_screen, constants
from pyvisa.highlevel import ResourceManager
from pyvisa.errors import (
Error,
VisaIOError,
VisaIOWarning,
VisaTypeError,
UnknownHandler,
OSNotSupported,
InvalidBinaryFormat,
InvalidSession,
LibraryError,
)
# This is needed to registry all resources.
from pyvisa.resources import Resource
from pyvisa.cmd_line_tools import visa_main
__all__ = [
"ResourceManager",
"constants",
"logger",
"Error",
"VisaIOError",
"VisaIOWarning",
"VisaTypeError",
"UnknownHandler",
"OSNotSupported",
"InvalidBinaryFormat",
"InvalidSession",
"LibraryError",
"log_to_screen",
]
if __name__ == "__main__":
visa_main()