nirfmxvna 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.
- nirfmxvna/__init__.py +106 -0
- nirfmxvna/attributes.py +2234 -0
- nirfmxvna/enums.py +1048 -0
- nirfmxvna/errors.py +96 -0
- nirfmxvna/examples/nirfmxvna_calibration_with_calset_save_two_port.py +186 -0
- nirfmxvna/examples/nirfmxvna_pulsed_s_params.py +174 -0
- nirfmxvna/examples/nirfmxvna_s_params_corrected_with_calset_load_two_port_grpc.py +234 -0
- nirfmxvna/examples/nirfmxvna_waves.py +174 -0
- nirfmxvna/grpc_session_options.py +64 -0
- nirfmxvna/internal/_custom_types.py +13 -0
- nirfmxvna/internal/_grpc_stub_interpreter.py +1757 -0
- nirfmxvna/internal/_helper.py +387 -0
- nirfmxvna/internal/_library.py +3790 -0
- nirfmxvna/internal/_library_interpreter.py +3011 -0
- nirfmxvna/internal/_library_singleton.py +53 -0
- nirfmxvna/internal/nidevice_pb2.py +37 -0
- nirfmxvna/internal/nidevice_pb2_grpc.py +3 -0
- nirfmxvna/internal/nirfmxvna_pb2.py +1094 -0
- nirfmxvna/internal/nirfmxvna_pb2_grpc.py +9990 -0
- nirfmxvna/internal/session_pb2.py +33 -0
- nirfmxvna/internal/session_pb2_grpc.py +3 -0
- nirfmxvna/iq.py +31 -0
- nirfmxvna/iq_configuration.py +290 -0
- nirfmxvna/iq_results.py +108 -0
- nirfmxvna/marker.py +31 -0
- nirfmxvna/marker_configuration.py +429 -0
- nirfmxvna/marker_results.py +168 -0
- nirfmxvna/s_params.py +31 -0
- nirfmxvna/s_params_configuration.py +1656 -0
- nirfmxvna/s_params_results.py +244 -0
- nirfmxvna/vna.py +12920 -0
- nirfmxvna/waves.py +31 -0
- nirfmxvna/waves_configuration.py +1255 -0
- nirfmxvna/waves_results.py +235 -0
- nirfmxvna-26.3.0.dist-info/METADATA +228 -0
- nirfmxvna-26.3.0.dist-info/RECORD +38 -0
- nirfmxvna-26.3.0.dist-info/WHEEL +4 -0
- nirfmxvna-26.3.0.dist-info/licenses/LICENSE +30 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Creates singleton instance of a module."""
|
|
2
|
+
|
|
3
|
+
import ctypes
|
|
4
|
+
import ctypes.util
|
|
5
|
+
import platform
|
|
6
|
+
import threading
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
import nirfmxvna.errors as errors
|
|
10
|
+
import nirfmxvna.internal._library as _library
|
|
11
|
+
|
|
12
|
+
_instance = None
|
|
13
|
+
_instance_lock = threading.Lock()
|
|
14
|
+
_library_info = {"Windows": {"64bit": {"name": "niRFmxVNA.dll", "type": "cdll"}}}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_library_name() -> str:
|
|
18
|
+
try:
|
|
19
|
+
lib_name = ctypes.util.find_library(
|
|
20
|
+
_library_info[platform.system()][platform.architecture()[0]]["name"]
|
|
21
|
+
) # We find and return full path to the DLL
|
|
22
|
+
if lib_name is None:
|
|
23
|
+
raise errors.DriverNotInstalledError() # type: ignore
|
|
24
|
+
return lib_name
|
|
25
|
+
except KeyError:
|
|
26
|
+
raise errors.UnsupportedConfigurationError
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _get_library_type() -> Any:
|
|
30
|
+
try:
|
|
31
|
+
return _library_info[platform.system()][platform.architecture()[0]]["type"]
|
|
32
|
+
except KeyError:
|
|
33
|
+
raise errors.UnsupportedConfigurationError
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def get() -> Any:
|
|
37
|
+
"""Returns the library.Library singleton for nirfmxvna."""
|
|
38
|
+
global _instance
|
|
39
|
+
global _instance_lock
|
|
40
|
+
|
|
41
|
+
with _instance_lock:
|
|
42
|
+
if _instance is None:
|
|
43
|
+
try:
|
|
44
|
+
library_type = _get_library_type()
|
|
45
|
+
if library_type == "windll":
|
|
46
|
+
ctypes_library = ctypes.WinDLL(_get_library_name()) # type: ignore
|
|
47
|
+
else:
|
|
48
|
+
assert library_type == "cdll"
|
|
49
|
+
ctypes_library = ctypes.CDLL(_get_library_name())
|
|
50
|
+
except OSError:
|
|
51
|
+
raise errors.DriverNotInstalledError() # type: ignore
|
|
52
|
+
_instance = _library.Library(ctypes_library) # type: ignore
|
|
53
|
+
return _instance
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: nidevice.proto
|
|
4
|
+
"""Generated protocol buffer code."""
|
|
5
|
+
from google.protobuf import (
|
|
6
|
+
descriptor as _descriptor,
|
|
7
|
+
descriptor_pool as _descriptor_pool,
|
|
8
|
+
symbol_database as _symbol_database,
|
|
9
|
+
)
|
|
10
|
+
from google.protobuf.internal import builder as _builder
|
|
11
|
+
|
|
12
|
+
# @@protoc_insertion_point(imports)
|
|
13
|
+
|
|
14
|
+
_sym_db = _symbol_database.Default()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|
18
|
+
b'\n\x0enidevice.proto\x12\rnidevice_grpc"2\n\x0fNIComplexNumber\x12\x0c\n\x04real\x18\x01 \x01(\x01\x12\x11\n\timaginary\x18\x02 \x01(\x01"5\n\x12NIComplexNumberF32\x12\x0c\n\x04real\x18\x01 \x01(\x02\x12\x11\n\timaginary\x18\x02 \x01(\x02"/\n\x0cNIComplexI16\x12\x0c\n\x04real\x18\x01 \x01(\x11\x12\x11\n\timaginary\x18\x02 \x01(\x11"r\n\x0fSmtSpectrumInfo\x12\x15\n\rspectrum_type\x18\x01 \x01(\r\x12\x11\n\tlinear_db\x18\x02 \x01(\r\x12\x0e\n\x06window\x18\x03 \x01(\r\x12\x13\n\x0bwindow_size\x18\x04 \x01(\x11\x12\x10\n\x08\x66\x66t_size\x18\x05 \x01(\x11\x42\x42\n\x12\x63om.ni.grpc.deviceB\x08NiDeviceP\x01\xaa\x02\x1fNationalInstruments.Grpc.Deviceb\x06proto3'
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
|
22
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "nidevice_pb2", globals())
|
|
23
|
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
24
|
+
|
|
25
|
+
DESCRIPTOR._options = None
|
|
26
|
+
DESCRIPTOR._serialized_options = (
|
|
27
|
+
b"\n\022com.ni.grpc.deviceB\010NiDeviceP\001\252\002\037NationalInstruments.Grpc.Device"
|
|
28
|
+
)
|
|
29
|
+
_NICOMPLEXNUMBER._serialized_start = 33
|
|
30
|
+
_NICOMPLEXNUMBER._serialized_end = 83
|
|
31
|
+
_NICOMPLEXNUMBERF32._serialized_start = 85
|
|
32
|
+
_NICOMPLEXNUMBERF32._serialized_end = 138
|
|
33
|
+
_NICOMPLEXI16._serialized_start = 140
|
|
34
|
+
_NICOMPLEXI16._serialized_end = 187
|
|
35
|
+
_SMTSPECTRUMINFO._serialized_start = 189
|
|
36
|
+
_SMTSPECTRUMINFO._serialized_end = 303
|
|
37
|
+
# @@protoc_insertion_point(module_scope)
|