-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve intellisense autocompletion and brief docstring of patched `…
…Poly` methods
- Loading branch information
1 parent
289857a
commit e228261
Showing
8 changed files
with
175 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
""" | ||
A subpackage containing arrays over Galois fields. | ||
""" | ||
from . import _constructors | ||
from ._conway import * | ||
from ._factor import * | ||
from ._functions import * | ||
from ._irreducible import * | ||
from ._poly import * | ||
from ._primitive import * | ||
|
||
# pylint: disable=undefined-variable | ||
Poly.square_free_factors = _factor.square_free_factors | ||
Poly.distinct_degree_factors = _factor.distinct_degree_factors | ||
Poly.equal_degree_factors = _factor.equal_degree_factors | ||
Poly.factors = _factor.factors | ||
Poly.is_irreducible = _irreducible.is_irreducible | ||
Poly.is_primitive = _primitive.is_primitive | ||
_constructors.POLY = Poly | ||
_constructors.POLY_DEGREES = Poly.Degrees | ||
_constructors.POLY_INT = Poly.Int | ||
_constructors.POLY_RANDOM = Poly.Random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
""" | ||
A module containing polynomial constructors that will be monkey-patched to Poly(), Poly.Int(), Poly.Degrees(), | ||
and Poly.Random() in polys/__init__.py. | ||
This is done to separate code into related modules without having circular imports with Poly(). | ||
""" | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING, Sequence, Type | ||
|
||
import numpy as np | ||
from typing_extensions import Literal | ||
|
||
from .._domains import Array | ||
from ..typing import ArrayLike | ||
|
||
if TYPE_CHECKING: | ||
from ._poly import Poly | ||
|
||
|
||
def POLY( | ||
coeffs: ArrayLike, | ||
field: Type[Array] | None = None, | ||
order: Literal["desc", "asc"] = "desc", | ||
) -> Poly: | ||
raise NotImplementedError | ||
|
||
|
||
def POLY_DEGREES( | ||
degrees: Sequence[int] | np.ndarray, | ||
coeffs: ArrayLike | None = None, | ||
field: Type[Array] | None = None, | ||
) -> Poly: | ||
raise NotImplementedError | ||
|
||
|
||
def POLY_INT(integer: int, field: Type[Array] | None = None) -> Poly: | ||
raise NotImplementedError | ||
|
||
|
||
def POLY_RANDOM( | ||
degree: int, | ||
seed: int | np.integer | np.random.Generator | None = None, | ||
field: Type[Array] | None = None, | ||
) -> Poly: | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.