pyibis-ami 7.2.1__py3-none-any.whl → 7.2.2__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.
- {pyibis_ami-7.2.1.dist-info → pyibis_ami-7.2.2.dist-info}/METADATA +1 -1
- {pyibis_ami-7.2.1.dist-info → pyibis_ami-7.2.2.dist-info}/RECORD +8 -8
- {pyibis_ami-7.2.1.dist-info → pyibis_ami-7.2.2.dist-info}/WHEEL +1 -1
- pyibisami/ami/model.py +43 -9
- pyibisami/common.py +2 -2
- {pyibis_ami-7.2.1.dist-info → pyibis_ami-7.2.2.dist-info}/entry_points.txt +0 -0
- {pyibis_ami-7.2.1.dist-info → pyibis_ami-7.2.2.dist-info}/licenses/LICENSE +0 -0
- {pyibis_ami-7.2.1.dist-info → pyibis_ami-7.2.2.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
|
|
1
|
-
pyibis_ami-7.2.
|
1
|
+
pyibis_ami-7.2.2.dist-info/licenses/LICENSE,sha256=iUtKhGdFJ8yC7IpQuUiwjveBUd6Uxk4tZ68yKfStPrM,1293
|
2
2
|
pyibisami/IBIS_AMI_Checker.ipynb,sha256=3LwppSqwVuPD85kVKdXOdtXdDKr9ba8fib1_IJ1jjMc,1390165
|
3
3
|
pyibisami/IBIS_AMI_Tester.ipynb,sha256=ywuwhAChAZXmk_Q1fkmS8scN6ZuV6gLteG_KfQa8NQ8,784499
|
4
4
|
pyibisami/__init__.py,sha256=DxWwWtfpqEKhGY9tdQqjjnEYR7tTC7OyPSfnKH-g0Qs,668
|
5
5
|
pyibisami/__main__.py,sha256=-2FQZACAF5NBVMl02Pf2aq4-gKvgjv2VyMGuIwhpX-w,317
|
6
|
-
pyibisami/common.py,sha256=
|
6
|
+
pyibisami/common.py,sha256=T3FMCHYx10f0-16U092l_xDHaaJmkIuZ-FiHJ0mnM6A,1182
|
7
7
|
pyibisami/ami/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
pyibisami/ami/config.py,sha256=fXfROquueeUX5larasZ8ia_FuvfAyuvmyW67fBOQA5I,10804
|
9
9
|
pyibisami/ami/generic.ami.em,sha256=EZpswZid-iRDDBnUuR3lL0fd1M6o6SCaoJKGeGALwZI,499
|
10
10
|
pyibisami/ami/generic.ibs.em,sha256=7kwwe1vSoV6p-ZCMbrUGniwTs1hLpDOBa6TfxQJbX7Q,5791
|
11
|
-
pyibisami/ami/model.py,sha256=
|
11
|
+
pyibisami/ami/model.py,sha256=sZuAWDTHafok89PEOlnAn1qBxHAfTnxgGvFHrCr-Bhs,24914
|
12
12
|
pyibisami/ami/parameter.py,sha256=Fk_qibbVGxK6hifYAzhyp-zgMUvOewrv-CjkiaCYZbM,10992
|
13
13
|
pyibisami/ami/parser.py,sha256=EXa57w-4KA77wZAvyBf4mhEdpa2s92zG0nqAP8Xg_kU,25681
|
14
14
|
pyibisami/ami/reserved_parameter_names.py,sha256=hOIDREU_TbXaZHbGQaBv98CJB_8z2mzPiBlLa1_IjIQ,1781
|
@@ -20,8 +20,8 @@ pyibisami/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
pyibisami/tools/run_notebook.py,sha256=vVDccARwVnpu1EH50G8gKatt6pdPFqsNycxk-LsZzK8,5440
|
21
21
|
pyibisami/tools/run_tests.py,sha256=Kaopc0a3XxSuatRtPgvgT5JukIB-My4Gfxwn5ASEZh4,9344
|
22
22
|
pyibisami/tools/test_results.xsl,sha256=RQv9oiu6XQ8Q_swO0ak1FGdL28h3ucJr_FAWsgD001I,1662
|
23
|
-
pyibis_ami-7.2.
|
24
|
-
pyibis_ami-7.2.
|
25
|
-
pyibis_ami-7.2.
|
26
|
-
pyibis_ami-7.2.
|
27
|
-
pyibis_ami-7.2.
|
23
|
+
pyibis_ami-7.2.2.dist-info/METADATA,sha256=AZfdnTFMXiRyb6JDp6Xk8ug2huFqp2PJZ7c2VamNOz4,5273
|
24
|
+
pyibis_ami-7.2.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
25
|
+
pyibis_ami-7.2.2.dist-info/entry_points.txt,sha256=x2QobJi2Pu25LgUeWg60XZzOWH8j2R60oWGN-1Z7uVA,149
|
26
|
+
pyibis_ami-7.2.2.dist-info/top_level.txt,sha256=k2KfR4t4tJ47HrnzvSh77w9N2Xyz8_uUusJLbqXK0g4,10
|
27
|
+
pyibis_ami-7.2.2.dist-info/RECORD,,
|
pyibisami/ami/model.py
CHANGED
@@ -159,6 +159,13 @@ class AMIModelInitializer:
|
|
159
159
|
if key in self._init_data:
|
160
160
|
self._init_data[key] = optional_args[key]
|
161
161
|
|
162
|
+
def __str__(self):
|
163
|
+
return "\n\t".join([
|
164
|
+
f"AMIModelInitializer instance:",
|
165
|
+
f"`ami_params`: {self.ami_params}",
|
166
|
+
f"`info_params`: {self.ami_params}",
|
167
|
+
])
|
168
|
+
|
162
169
|
def _getChannelResponse(self):
|
163
170
|
return list(map(float, self._init_data["channel_response"]))
|
164
171
|
|
@@ -234,6 +241,7 @@ class AMIModel: # pylint: disable=too-many-instance-attributes
|
|
234
241
|
OSError: If given file cannot be opened.
|
235
242
|
"""
|
236
243
|
|
244
|
+
self._filename = filename
|
237
245
|
self._ami_mem_handle = None
|
238
246
|
my_dll = CDLL(filename)
|
239
247
|
self._amiInit = my_dll.AMI_Init
|
@@ -255,6 +263,24 @@ class AMIModel: # pylint: disable=too-many-instance-attributes
|
|
255
263
|
if self._ami_mem_handle:
|
256
264
|
self._amiClose(self._ami_mem_handle)
|
257
265
|
|
266
|
+
def __str__(self):
|
267
|
+
return "\n\t".join([
|
268
|
+
f"AMIModel instance: `{self._filename}`",
|
269
|
+
f"Length of initOut = {len(self._initOut)}",
|
270
|
+
f"row_size = {self._row_size}",
|
271
|
+
f"num_aggressors = {self._num_aggressors}",
|
272
|
+
f"sample_interval = {self._sample_interval}",
|
273
|
+
f"bit_time = {self._bit_time}",
|
274
|
+
f"samps_per_bit = {self._samps_per_bit}",
|
275
|
+
f"bits_per_call = {self._bits_per_call}",
|
276
|
+
f"ami_params_in = {self._ami_params_in}",
|
277
|
+
f"ami_params_out = {self._ami_params_out}",
|
278
|
+
f"&ami_mem_handle = {byref(self._ami_mem_handle)}",
|
279
|
+
f"Message = {self._msg}",
|
280
|
+
f"AMI_Init(): {self._amiInit}",
|
281
|
+
f"AMI_GetWave(): {self._amiGetWave}",
|
282
|
+
f"AMI_Close(): {self._amiClose}",])
|
283
|
+
|
258
284
|
def initialize(self, init_object: AMIModelInitializer):
|
259
285
|
"""
|
260
286
|
Wraps the ``AMI_Init()`` function.
|
@@ -298,15 +324,13 @@ class AMIModel: # pylint: disable=too-many-instance-attributes
|
|
298
324
|
"bit_time"
|
299
325
|
]
|
300
326
|
self._info_params = init_object.info_params # pylint: disable=attribute-defined-outside-init
|
301
|
-
assert self._info_params, RuntimeError(
|
302
|
-
f"`info_params` is None!\n`init_object: {init_object}"
|
303
|
-
) # pylint: disable=attribute-defined-outside-init
|
304
327
|
|
305
328
|
# Check GetWave() consistency if possible.
|
306
329
|
if init_object.info_params and init_object.info_params["GetWave_Exists"]:
|
307
|
-
|
308
|
-
|
309
|
-
|
330
|
+
if not self._amiGetWave:
|
331
|
+
raise RuntimeError(
|
332
|
+
"Reserved parameter `GetWave_Exists` is True, but I can't bind to `AMI_GetWave()`!"
|
333
|
+
)
|
310
334
|
|
311
335
|
# Construct the AMI parameters string.
|
312
336
|
def sexpr(pname, pval):
|
@@ -420,9 +444,19 @@ class AMIModel: # pylint: disable=too-many-instance-attributes
|
|
420
444
|
else:
|
421
445
|
tmp_wave = wave[idx: idx + samps_per_call]
|
422
446
|
_wave = Signal(*tmp_wave)
|
423
|
-
|
424
|
-
|
425
|
-
|
447
|
+
try:
|
448
|
+
self._amiGetWave(
|
449
|
+
byref(_wave), len(_wave), byref(_clock_times),
|
450
|
+
byref(self._ami_params_out), self._ami_mem_handle
|
451
|
+
) # type: ignore
|
452
|
+
except OSError:
|
453
|
+
print(self)
|
454
|
+
print(f"byref(_wave): {byref(_wave)}")
|
455
|
+
print(f"len(_wave): {len(_wave)}")
|
456
|
+
print(f"byref(_clock_times): {byref(_clock_times)}")
|
457
|
+
print(f"byref(self._ami_params_out): {byref(self._ami_params_out)}")
|
458
|
+
print(f"self._ami_mem_handle: {self._ami_mem_handle}")
|
459
|
+
raise
|
426
460
|
wave_out.extend(_wave)
|
427
461
|
clock_times.extend(_clock_times)
|
428
462
|
params_out.append(self.ami_params_out)
|
pyibisami/common.py
CHANGED
@@ -14,8 +14,8 @@ from scipy.linalg import convolution_matrix, lstsq
|
|
14
14
|
|
15
15
|
Real = TypeVar("Real", float, float)
|
16
16
|
Comp = TypeVar("Comp", complex, complex)
|
17
|
-
Rvec: TypeAlias = npt.NDArray[Real]
|
18
|
-
Cvec: TypeAlias = npt.NDArray[Comp]
|
17
|
+
Rvec: TypeAlias = npt.NDArray["Real"]
|
18
|
+
Cvec: TypeAlias = npt.NDArray["Comp"]
|
19
19
|
|
20
20
|
PI: float = 3.141592653589793238462643383279502884
|
21
21
|
TWOPI: float = 2.0 * PI
|
File without changes
|
File without changes
|
File without changes
|