swarmauri_matrix_hamming74 0.9.4.dev3__tar.gz → 0.11.0.dev1__tar.gz

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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swarmauri_matrix_hamming74
3
- Version: 0.9.4.dev3
3
+ Version: 0.11.0.dev1
4
4
  Summary: Swarmauri Hamming (7,4) matrix community package.
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -40,7 +40,8 @@ Description-Content-Type: text/markdown
40
40
  <img src="https://img.shields.io/pypi/l/swarmauri_matrix_hamming74" alt="PyPI - License"/></a>
41
41
  <a href="https://pypi.org/project/swarmauri_matrix_hamming74/">
42
42
  <img src="https://img.shields.io/pypi/v/swarmauri_matrix_hamming74?label=swarmauri_matrix_hamming74&color=green" alt="PyPI - swarmauri_matrix_hamming74"/></a>
43
- </p>
43
+ <a href="https://discord.gg/N4UpBuQv8T">
44
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
44
45
 
45
46
  # Swarmauri Matrix Hamming(7,4)
46
47
 
@@ -48,10 +49,10 @@ The `swarmauri_matrix_hamming74` package provides a binary Hamming (7,4) code ma
48
49
 
49
50
  ## Features
50
51
 
51
- - 🧮 Binary matrix implementation built on `MatrixBase` with full indexing and arithmetic support.
52
- - 🧷 Generator and parity-check matrix accessors for classic Hamming (7,4) coding schemes.
53
- - 📨 Encoding, syndrome calculation, and nearest-codeword decoding helpers powered by the Hamming metric.
54
- - 🔁 Binary-safe matrix operations (addition, subtraction, multiplication, and matrix multiplication modulo 2).
52
+ - Binary matrix implementation built on `MatrixBase` with full indexing and arithmetic support.
53
+ - Generator and parity-check matrix accessors for classic Hamming (7,4) coding schemes.
54
+ - Encoding, syndrome calculation, and nearest-codeword decoding helpers powered by the Hamming metric.
55
+ - Binary-safe matrix operations (addition, subtraction, multiplication, and matrix multiplication modulo 2).
55
56
 
56
57
  ## Installation
57
58
 
@@ -94,3 +95,5 @@ print(nearest) # Recovers the original codeword
94
95
 
95
96
  We welcome contributions! Please submit issues and pull requests through the [Swarmauri SDK GitHub repository](https://github.com/swarmauri/swarmauri-sdk).
96
97
 
98
+
99
+
@@ -11,7 +11,8 @@
11
11
  <img src="https://img.shields.io/pypi/l/swarmauri_matrix_hamming74" alt="PyPI - License"/></a>
12
12
  <a href="https://pypi.org/project/swarmauri_matrix_hamming74/">
13
13
  <img src="https://img.shields.io/pypi/v/swarmauri_matrix_hamming74?label=swarmauri_matrix_hamming74&color=green" alt="PyPI - swarmauri_matrix_hamming74"/></a>
14
- </p>
14
+ <a href="https://discord.gg/N4UpBuQv8T">
15
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
15
16
 
16
17
  # Swarmauri Matrix Hamming(7,4)
17
18
 
@@ -19,10 +20,10 @@ The `swarmauri_matrix_hamming74` package provides a binary Hamming (7,4) code ma
19
20
 
20
21
  ## Features
21
22
 
22
- - 🧮 Binary matrix implementation built on `MatrixBase` with full indexing and arithmetic support.
23
- - 🧷 Generator and parity-check matrix accessors for classic Hamming (7,4) coding schemes.
24
- - 📨 Encoding, syndrome calculation, and nearest-codeword decoding helpers powered by the Hamming metric.
25
- - 🔁 Binary-safe matrix operations (addition, subtraction, multiplication, and matrix multiplication modulo 2).
23
+ - Binary matrix implementation built on `MatrixBase` with full indexing and arithmetic support.
24
+ - Generator and parity-check matrix accessors for classic Hamming (7,4) coding schemes.
25
+ - Encoding, syndrome calculation, and nearest-codeword decoding helpers powered by the Hamming metric.
26
+ - Binary-safe matrix operations (addition, subtraction, multiplication, and matrix multiplication modulo 2).
26
27
 
27
28
  ## Installation
28
29
 
@@ -64,3 +65,5 @@ print(nearest) # Recovers the original codeword
64
65
  ## Contributing
65
66
 
66
67
  We welcome contributions! Please submit issues and pull requests through the [Swarmauri SDK GitHub repository](https://github.com/swarmauri/swarmauri-sdk).
68
+
69
+
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "swarmauri_matrix_hamming74"
3
- version = "0.9.4.dev3"
3
+ version = "0.11.0.dev1"
4
4
  description = "Swarmauri Hamming (7,4) matrix community package."
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
@@ -76,7 +76,7 @@ dev = [
76
76
  "pytest-xdist>=3.6.1",
77
77
  "pytest-json-report>=1.5.0",
78
78
  "python-dotenv",
79
- "requests>=2.32.3",
79
+ "httpx>=0.27",
80
80
  "flake8>=7.0",
81
81
  "pytest-timeout>=2.3.1",
82
82
  "ruff>=0.9.9",
@@ -106,10 +106,14 @@ class Hamming74Matrix(MatrixBase):
106
106
  def __mul__(self, other: BinaryLike) -> "Hamming74Matrix":
107
107
  return Hamming74Matrix((self._data * self._coerce(other)) % 2)
108
108
 
109
- def __matmul__(self, other: Union[BinaryLike, np.ndarray]) -> "Hamming74Matrix":
109
+ def __matmul__(
110
+ self, other: Union[BinaryLike, np.ndarray]
111
+ ) -> "Hamming74Matrix":
110
112
  matrix = self._coerce(other)
111
113
  if self.shape[1] != matrix.shape[0]:
112
- raise ValueError("Matrix dimensions do not align for multiplication")
114
+ raise ValueError(
115
+ "Matrix dimensions do not align for multiplication"
116
+ )
113
117
  return Hamming74Matrix(np.mod(self._data @ matrix, 2))
114
118
 
115
119
  def __truediv__(self, other: BinaryLike) -> "Hamming74Matrix":
@@ -130,7 +134,9 @@ class Hamming74Matrix(MatrixBase):
130
134
  def transpose(self) -> "Hamming74Matrix":
131
135
  return Hamming74Matrix(self._data.T)
132
136
 
133
- def __array__(self) -> np.ndarray: # pragma: no cover - numpy protocol helper
137
+ def __array__(
138
+ self,
139
+ ) -> np.ndarray: # pragma: no cover - numpy protocol helper
134
140
  return np.array(self._data, copy=True)
135
141
 
136
142
  # ------------------------------------------------------------------
@@ -151,7 +157,9 @@ class Hamming74Matrix(MatrixBase):
151
157
  def encode(self, message: Sequence[int]) -> List[int]:
152
158
  bits = np.mod(np.array(message, dtype=int), 2)
153
159
  if bits.size != 4:
154
- raise ValueError("Hamming (7,4) encoding expects exactly 4 message bits")
160
+ raise ValueError(
161
+ "Hamming (7,4) encoding expects exactly 4 message bits"
162
+ )
155
163
  codeword = np.mod(bits @ self._data, 2)
156
164
  return codeword.astype(int).tolist()
157
165
 
@@ -175,7 +183,8 @@ class Hamming74Matrix(MatrixBase):
175
183
  raise ValueError("Nearest codeword search expects 7-bit inputs")
176
184
  codebook = self.codewords()
177
185
  distances = [
178
- self._metric.distance(candidate.tolist(), codeword) for codeword in codebook
186
+ self._metric.distance(candidate.tolist(), codeword)
187
+ for codeword in codebook
179
188
  ]
180
189
  index = int(np.argmin(distances))
181
190
  return codebook[index]