Skip to content

Commit

Permalink
Fix type hint for NumPy integer types
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Jan 23, 2022
1 parent 54e99b7 commit 04539f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions galois/_codes/_bch.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def detect(self, codeword: Union[np.ndarray, GF2]) -> Union[bool, np.ndarray]:
def decode(self, codeword: Union[np.ndarray, GF2], errors: Literal[False] = False) -> Union[np.ndarray, GF2]:
...
@overload
def decode(self, codeword: Union[np.ndarray, GF2], errors: Literal[True] = True) -> Tuple[Union[np.ndarray, GF2], Union[int, np.ndarray]]:
def decode(self, codeword: Union[np.ndarray, GF2], errors: Literal[True] = True) -> Tuple[Union[np.ndarray, GF2], Union[np.integer, np.ndarray]]:
...
def decode(self, codeword, errors=False):
r"""
Expand All @@ -436,7 +436,7 @@ def decode(self, codeword, errors=False):
-------
numpy.ndarray, galois.GF2
The decoded message as either a :math:`k`-length vector or :math:`(N, k)` matrix.
int, np.ndarray
numpy.integer, numpy.ndarray
Optional return argument of the number of corrected bit errors as either a scalar or :math:`n`-length vector.
Valid number of corrections are in :math:`[0, t]`. If a codeword has too many errors and cannot be corrected,
-1 will be returned.
Expand Down
4 changes: 2 additions & 2 deletions galois/_codes/_reed_solomon.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def detect(self, codeword: Union[np.ndarray, FieldArray]) -> Union[bool, np.ndar
def decode(self, codeword: Union[np.ndarray, FieldArray], errors: Literal[False] = False) -> Union[np.ndarray, FieldArray]:
...
@overload
def decode(self, codeword: Union[np.ndarray, FieldArray], errors: Literal[True] = True) -> Tuple[Union[np.ndarray, FieldArray], Union[int, np.ndarray]]:
def decode(self, codeword: Union[np.ndarray, FieldArray], errors: Literal[True] = True) -> Tuple[Union[np.ndarray, FieldArray], Union[np.integer, np.ndarray]]:
...
def decode(self, codeword, errors=False):
r"""
Expand All @@ -340,7 +340,7 @@ def decode(self, codeword, errors=False):
-------
numpy.ndarray, galois.FieldArray
The decoded message as either a :math:`k`-length vector or :math:`(N, k)` matrix.
int, np.ndarray
numpy.integer, numpy.ndarray
Optional return argument of the number of corrected symbol errors as either a scalar or :math:`n`-length vector.
Valid number of corrections are in :math:`[0, t]`. If a codeword has too many errors and cannot be corrected,
-1 will be returned.
Expand Down

0 comments on commit 04539f7

Please sign in to comment.