nirfmxpulse 26.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nirfmxpulse/__init__.py +106 -0
- nirfmxpulse/attributes.py +2899 -0
- nirfmxpulse/enums.py +345 -0
- nirfmxpulse/errors.py +96 -0
- nirfmxpulse/examples/Support/Pulse_FMChirpUp-10MHz_BW-80MHz_Rect-filter.tdms +0 -0
- nirfmxpulse/examples/nirfmxpulse_stability_basic.py +274 -0
- nirfmxpulse/examples/nirfmxpulse_time_and_power_basic.py +224 -0
- nirfmxpulse/examples/nirfmxpulse_time_sidelobe.py +303 -0
- nirfmxpulse/examples/nirfmxpulse_time_with_segmented_acquisition_basic_grpc.py +247 -0
- nirfmxpulse/grpc_session_options.py +64 -0
- nirfmxpulse/internal/_custom_types.py +13 -0
- nirfmxpulse/internal/_grpc_stub_interpreter.py +993 -0
- nirfmxpulse/internal/_helper.py +248 -0
- nirfmxpulse/internal/_library.py +1803 -0
- nirfmxpulse/internal/_library_interpreter.py +1986 -0
- nirfmxpulse/internal/_library_singleton.py +53 -0
- nirfmxpulse/internal/nidevice_pb2.py +37 -0
- nirfmxpulse/internal/nidevice_pb2_grpc.py +3 -0
- nirfmxpulse/internal/nirfmxpulse_pb2.py +438 -0
- nirfmxpulse/internal/nirfmxpulse_pb2_grpc.py +4263 -0
- nirfmxpulse/internal/session_pb2.py +33 -0
- nirfmxpulse/internal/session_pb2_grpc.py +3 -0
- nirfmxpulse/pulse.py +3434 -0
- nirfmxpulse/pulse_measurement.py +31 -0
- nirfmxpulse/pulse_measurement_configuration.py +4568 -0
- nirfmxpulse/pulse_measurement_results.py +7937 -0
- nirfmxpulse-26.3.0.dist-info/METADATA +226 -0
- nirfmxpulse-26.3.0.dist-info/RECORD +30 -0
- nirfmxpulse-26.3.0.dist-info/WHEEL +4 -0
- nirfmxpulse-26.3.0.dist-info/licenses/LICENSE +30 -0
nirfmxpulse/__init__.py
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""nirfmxpulse package."""
|
|
2
|
+
|
|
3
|
+
__version__ = "26.3.0"
|
|
4
|
+
|
|
5
|
+
from nirfmxpulse.attributes import * # noqa: F403
|
|
6
|
+
from nirfmxpulse.enums import * # noqa: F403
|
|
7
|
+
from nirfmxpulse.grpc_session_options import * # noqa: F403
|
|
8
|
+
from nirfmxpulse.pulse import Pulse, _PulseSignalConfiguration
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def get_diagnostic_information():
|
|
12
|
+
"""Get diagnostic information about the system state that is suitable for printing or logging.
|
|
13
|
+
returns: dict
|
|
14
|
+
note: Python bitness may be incorrect when running in a virtual environment.
|
|
15
|
+
"""
|
|
16
|
+
import importlib.metadata
|
|
17
|
+
import os
|
|
18
|
+
import platform
|
|
19
|
+
import struct
|
|
20
|
+
import sys
|
|
21
|
+
|
|
22
|
+
def is_python_64bit():
|
|
23
|
+
return struct.calcsize("P") == 8
|
|
24
|
+
|
|
25
|
+
def is_os_64bit():
|
|
26
|
+
return platform.machine().endswith("64")
|
|
27
|
+
|
|
28
|
+
def is_venv():
|
|
29
|
+
return "VIRTUAL_ENV" in os.environ
|
|
30
|
+
|
|
31
|
+
info = {} # type: ignore
|
|
32
|
+
info["os"] = {}
|
|
33
|
+
info["python"] = {}
|
|
34
|
+
info["driver"] = {}
|
|
35
|
+
info["module"] = {}
|
|
36
|
+
if platform.system() == "Windows":
|
|
37
|
+
try:
|
|
38
|
+
import winreg as winreg
|
|
39
|
+
except ImportError:
|
|
40
|
+
import _winreg as winreg # type: ignore
|
|
41
|
+
|
|
42
|
+
os_name = "Windows"
|
|
43
|
+
try:
|
|
44
|
+
driver_version_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\National Instruments\RFmx\Pulse\C Runtime Support") # type: ignore
|
|
45
|
+
driver_version = winreg.QueryValueEx(driver_version_key, "Version")[0] # type: ignore
|
|
46
|
+
except WindowsError: # type: ignore
|
|
47
|
+
driver_version = "Unknown"
|
|
48
|
+
else:
|
|
49
|
+
raise SystemError("Unsupported platform: {}".format(platform.system()))
|
|
50
|
+
|
|
51
|
+
if sys.version_info[1] >= 10:
|
|
52
|
+
installed_packages_names = [
|
|
53
|
+
name
|
|
54
|
+
for name_list in importlib.metadata.packages_distributions().values()
|
|
55
|
+
for name in name_list
|
|
56
|
+
]
|
|
57
|
+
installed_packages_names = set(installed_packages_names) # type: ignore
|
|
58
|
+
installed_packages_list = [
|
|
59
|
+
{"name": name, "version": importlib.metadata.distribution(name).version}
|
|
60
|
+
for name in sorted(installed_packages_names)
|
|
61
|
+
]
|
|
62
|
+
else:
|
|
63
|
+
import pkg_resources
|
|
64
|
+
|
|
65
|
+
installed_packages = pkg_resources.working_set
|
|
66
|
+
installed_packages_list = [
|
|
67
|
+
{
|
|
68
|
+
"name": i.key,
|
|
69
|
+
"version": i.version,
|
|
70
|
+
}
|
|
71
|
+
for i in installed_packages
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
info["os"]["name"] = os_name
|
|
75
|
+
info["os"]["version"] = platform.version()
|
|
76
|
+
info["os"]["bits"] = "64" if is_os_64bit() else "32" # type: ignore
|
|
77
|
+
info["driver"]["name"] = "RFmx Pulse"
|
|
78
|
+
info["driver"]["version"] = driver_version
|
|
79
|
+
info["module"]["name"] = "nirfmxpulse"
|
|
80
|
+
info["module"]["version"] = "26.3.0"
|
|
81
|
+
info["python"]["version"] = sys.version
|
|
82
|
+
info["python"]["bits"] = "64" if is_python_64bit() else "32" # type: ignore
|
|
83
|
+
info["python"]["is_venv"] = is_venv() # type: ignore
|
|
84
|
+
info["python"]["packages"] = installed_packages_list
|
|
85
|
+
|
|
86
|
+
return info
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def print_diagnostic_information():
|
|
90
|
+
"""Print diagnostic information in a format suitable for issue report.
|
|
91
|
+
note: Python bitness may be incorrect when running in a virtual environment.
|
|
92
|
+
"""
|
|
93
|
+
info = get_diagnostic_information() # type: ignore
|
|
94
|
+
|
|
95
|
+
row_format = " {:<10"
|
|
96
|
+
for type in ["OS", "Driver", "Module", "Python"]:
|
|
97
|
+
typename = type.lower()
|
|
98
|
+
print(type + ":")
|
|
99
|
+
for item in info[typename]:
|
|
100
|
+
if item != "packages":
|
|
101
|
+
print(row_format.format(item.title() + ":", info[typename][item]))
|
|
102
|
+
print(" Installed Packages:")
|
|
103
|
+
for p in info["python"]["packages"]:
|
|
104
|
+
print((" " * 8) + p["name"] + "==" + p["version"])
|
|
105
|
+
|
|
106
|
+
return info
|