pyibis-ami 7.2.3__py3-none-any.whl → 7.2.4__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.
@@ -1,84 +1,84 @@
1
- """
2
- IBIS-AMI reserved parameter names, as a Python ``dataclass``.
3
-
4
- Original author: David Banas <capn.freako@gmail.com>
5
-
6
- Original date: March 17, 2025
7
-
8
- Copyright (c) 2025 David Banas; all rights reserved World wide.
9
- """
10
-
11
- from dataclasses import dataclass
12
-
13
-
14
- @dataclass
15
- class AmiReservedParameterName():
16
- "IBIS-AMI Reserved Parameter Name"
17
-
18
- pname: str
19
-
20
- def __post_init__(self):
21
- "Validate parameter name."
22
-
23
- if self.pname not in RESERVED_PARAM_NAMES:
24
- raise ValueError(f"Parameter name: {self.pname}, is not an IBIS-AMI reserved parameter name!")
25
-
26
-
27
- RESERVED_PARAM_NAMES = [
28
- "AMI_Version",
29
- "Init_Returns_Impulse",
30
- "GetWave_Exists",
31
- "Use_Init_Output",
32
- "Max_Init_Aggressors",
33
- "Ignore_Bits",
34
- "Resolve_Exists",
35
- "Model_Name",
36
- "Special_Param_Names",
37
- "Component_Name",
38
- "Signal_Name",
39
- "Rx_Decision_Time",
40
- "DC_Offset",
41
- "Rx_Use_Clock_Input",
42
- "Supporting_Files",
43
- "DLL_Path",
44
- "DLL_ID",
45
- "Tx_Jitter",
46
- "Tx_DCD",
47
- "Tx_Rj",
48
- "Tx_Dj",
49
- "Tx_Sj",
50
- "Tx_Sj_Frequency",
51
- "Rx_DCD",
52
- "Rx_Rj",
53
- "Rx_Dj",
54
- "Rx_Sj",
55
- "Rx_Clock_PDF",
56
- "Rx_Clock_Recovery_Mean",
57
- "Rx_Clock_Recovery_Rj",
58
- "Rx_Clock_Recovery_Dj",
59
- "Rx_Clock_Recovery_Sj",
60
- "Rx_Clock_Recovery_DCD",
61
- "Rx_Receiver_Sensitivity",
62
- "Rx_Noise",
63
- "Rx_GaussianNoise",
64
- "Rx_UniformNoise",
65
- "Modulation",
66
- "PAM4_Mapping",
67
- "PAM4_UpperThreshold",
68
- "PAM4_CenterThreshold",
69
- "PAM4_LowerThreshold",
70
- "PAM4_UpperEyeOffset",
71
- "PAM4_CenterEyeOffset",
72
- "PAM4_LowerEyeOffset",
73
- "Repeater_Type",
74
- "BCI_Protocol",
75
- "BCI_ID",
76
- "BCI_State",
77
- "BCI_Message_Interval_UI",
78
- "BCI_Training_UI",
79
- "BCI_Training_Mode",
80
- "Ts4file",
81
- "Tx_V",
82
- "Tx_R",
83
- "Rx_R",
84
- ]
1
+ """
2
+ IBIS-AMI reserved parameter names, as a Python ``dataclass``.
3
+
4
+ Original author: David Banas <capn.freako@gmail.com>
5
+
6
+ Original date: March 17, 2025
7
+
8
+ Copyright (c) 2025 David Banas; all rights reserved World wide.
9
+ """
10
+
11
+ from dataclasses import dataclass
12
+
13
+
14
+ @dataclass
15
+ class AmiReservedParameterName():
16
+ "IBIS-AMI Reserved Parameter Name"
17
+
18
+ pname: str
19
+
20
+ def __post_init__(self):
21
+ "Validate parameter name."
22
+
23
+ if self.pname not in RESERVED_PARAM_NAMES:
24
+ raise ValueError(f"Parameter name: {self.pname}, is not an IBIS-AMI reserved parameter name!")
25
+
26
+
27
+ RESERVED_PARAM_NAMES = [
28
+ "AMI_Version",
29
+ "Init_Returns_Impulse",
30
+ "GetWave_Exists",
31
+ "Use_Init_Output",
32
+ "Max_Init_Aggressors",
33
+ "Ignore_Bits",
34
+ "Resolve_Exists",
35
+ "Model_Name",
36
+ "Special_Param_Names",
37
+ "Component_Name",
38
+ "Signal_Name",
39
+ "Rx_Decision_Time",
40
+ "DC_Offset",
41
+ "Rx_Use_Clock_Input",
42
+ "Supporting_Files",
43
+ "DLL_Path",
44
+ "DLL_ID",
45
+ "Tx_Jitter",
46
+ "Tx_DCD",
47
+ "Tx_Rj",
48
+ "Tx_Dj",
49
+ "Tx_Sj",
50
+ "Tx_Sj_Frequency",
51
+ "Rx_DCD",
52
+ "Rx_Rj",
53
+ "Rx_Dj",
54
+ "Rx_Sj",
55
+ "Rx_Clock_PDF",
56
+ "Rx_Clock_Recovery_Mean",
57
+ "Rx_Clock_Recovery_Rj",
58
+ "Rx_Clock_Recovery_Dj",
59
+ "Rx_Clock_Recovery_Sj",
60
+ "Rx_Clock_Recovery_DCD",
61
+ "Rx_Receiver_Sensitivity",
62
+ "Rx_Noise",
63
+ "Rx_GaussianNoise",
64
+ "Rx_UniformNoise",
65
+ "Modulation",
66
+ "PAM4_Mapping",
67
+ "PAM4_UpperThreshold",
68
+ "PAM4_CenterThreshold",
69
+ "PAM4_LowerThreshold",
70
+ "PAM4_UpperEyeOffset",
71
+ "PAM4_CenterEyeOffset",
72
+ "PAM4_LowerEyeOffset",
73
+ "Repeater_Type",
74
+ "BCI_Protocol",
75
+ "BCI_ID",
76
+ "BCI_State",
77
+ "BCI_Message_Interval_UI",
78
+ "BCI_Training_UI",
79
+ "BCI_Training_Mode",
80
+ "Ts4file",
81
+ "Tx_V",
82
+ "Tx_R",
83
+ "Rx_R",
84
+ ]
pyibisami/common.py CHANGED
@@ -1,42 +1,42 @@
1
- """
2
- Definitions common to all PyIBIS-AMI modules.
3
-
4
- Original author: David Banas <capn.freako@gmail.com>
5
-
6
- Original date: May 15, 2024
7
-
8
- Copyright (c) 2024 David Banas; all rights reserved World wide.
9
- """
10
-
11
- from typing import Any, TypeAlias, TypeVar
12
- import numpy.typing as npt # type: ignore
13
- from scipy.linalg import convolution_matrix, lstsq
14
-
15
- Real = TypeVar("Real", float, float)
16
- Comp = TypeVar("Comp", complex, complex)
17
- Rvec: TypeAlias = npt.NDArray["Real"]
18
- Cvec: TypeAlias = npt.NDArray["Comp"]
19
-
20
- PI: float = 3.141592653589793238462643383279502884
21
- TWOPI: float = 2.0 * PI
22
-
23
- # TestConfig: TypeAlias = tuple[str, tuple[dict[str, Any], dict[str, Any]]]
24
- # TestSweep: TypeAlias = tuple[str, str, list[TestConfig]]
25
- TestConfig = tuple[str, tuple[dict[str, Any], dict[str, Any]]]
26
- TestSweep = tuple[str, str, list[TestConfig]]
27
-
28
-
29
- def deconv_same(y: Rvec, x: Rvec) -> Rvec:
30
- """
31
- Deconvolve input from output, to recover filter response, for same length I/O.
32
-
33
- Args:
34
- y: output signal
35
- x: input signal
36
-
37
- Returns:
38
- h: filter impulse response.
39
- """
40
- A = convolution_matrix(x, len(y), "same")
41
- h, _, _, _ = lstsq(A, y)
42
- return h
1
+ """
2
+ Definitions common to all PyIBIS-AMI modules.
3
+
4
+ Original author: David Banas <capn.freako@gmail.com>
5
+
6
+ Original date: May 15, 2024
7
+
8
+ Copyright (c) 2024 David Banas; all rights reserved World wide.
9
+ """
10
+
11
+ from typing import Any, TypeAlias, TypeVar
12
+ import numpy.typing as npt # type: ignore
13
+ from scipy.linalg import convolution_matrix, lstsq
14
+
15
+ Real = TypeVar("Real", float, float)
16
+ Comp = TypeVar("Comp", complex, complex)
17
+ Rvec: TypeAlias = npt.NDArray["Real"]
18
+ Cvec: TypeAlias = npt.NDArray["Comp"]
19
+
20
+ PI: float = 3.141592653589793238462643383279502884
21
+ TWOPI: float = 2.0 * PI
22
+
23
+ # TestConfig: TypeAlias = tuple[str, tuple[dict[str, Any], dict[str, Any]]]
24
+ # TestSweep: TypeAlias = tuple[str, str, list[TestConfig]]
25
+ TestConfig = tuple[str, tuple[dict[str, Any], dict[str, Any]]]
26
+ TestSweep = tuple[str, str, list[TestConfig]]
27
+
28
+
29
+ def deconv_same(y: Rvec, x: Rvec) -> Rvec:
30
+ """
31
+ Deconvolve input from output, to recover filter response, for same length I/O.
32
+
33
+ Args:
34
+ y: output signal
35
+ x: input signal
36
+
37
+ Returns:
38
+ h: filter impulse response.
39
+ """
40
+ A = convolution_matrix(x, len(y), "same")
41
+ h, _, _, _ = lstsq(A, y)
42
+ return h