Skip to content

Fix reportInvalidTypeForm diagnostics in sympy-stubs #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions stubs/sympy-stubs/polys/domains/algebraicfield.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ from sympy.utilities import public

@public
class AlgebraicField(Field, CharacteristicZero, SimpleDomain):
dtype = ANP
is_Algebraic = ...
is_Numerical = ...
has_assoc_Ring = ...
has_assoc_Field = ...
def __init__(self, dom, *ext, alias=...) -> None: ...
def new(self, element) -> dtype: ...
def new(self, element) -> ANP: ...
def __hash__(self) -> int: ...
def __eq__(self, other) -> bool: ...
def algebraic_field(self, *extension, alias=...) -> Any: ...
Expand All @@ -40,7 +39,7 @@ class AlgebraicField(Field, CharacteristicZero, SimpleDomain):
def from_GaussianIntegerRing(K1, a, K0): ...
def from_GaussianRationalField(K1, a, K0): ...
def maximal_order(self) -> Any | None: ...
def integral_basis(self, fmt=...) -> list[Any | Order] | list[Any] | list[dtype]: ...
def integral_basis(self, fmt=...) -> list[Any | Order] | list[Any] | list[ANP]: ...
def discriminant(self) -> Any | None: ...
def primes_above(self, p) -> Any: ...
def galois_group(self, by_name=..., max_tries=..., randomize=...) -> Any: ...
3 changes: 1 addition & 2 deletions stubs/sympy-stubs/polys/domains/expressiondomain.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ class ExpressionDomain(Field, CharacteristicZero, SimpleDomain):
def gcd(f, g) -> Self: ...
def lcm(f, g) -> Self: ...

dtype = Expression
zero = ...
one = ...
rep = ...
has_assoc_Ring = ...
has_assoc_Field = ...
def __init__(self) -> None: ...
def to_sympy(self, a): ...
def from_sympy(self, a) -> dtype: ...
def from_sympy(self, a) -> Expression: ...
def from_ZZ(K1, a, K0): ...
def from_ZZ_python(K1, a, K0): ...
def from_QQ(K1, a, K0): ...
Expand Down
9 changes: 4 additions & 5 deletions stubs/sympy-stubs/polys/domains/integerring.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
class IntegerRing(Ring, CharacteristicZero, SimpleDomain): # type: ignore
rep = ...
alias = ...
dtype = MPZ
zero = dtype(0)
one = dtype(1)
tp: type[dtype]
zero = MPZ(0)
one = MPZ(1)
tp: type[MPZ]

Check failure on line 15 in stubs/sympy-stubs/polys/domains/integerring.pyi

View workflow job for this annotation

GitHub Actions / test

Variable not allowed in type expression (reportInvalidTypeForm)
is_ZZ = ...
is_Numerical = ...
is_PID = ...
Expand All @@ -25,7 +24,7 @@
def get_field(self) -> Any: ...
def algebraic_field(self, *extension, alias=...) -> Any: ...
def from_AlgebraicField(K1, a, K0) -> None: ...
def log(self, a, b) -> dtype: ...
def log(self, a, b) -> MPZ: ...

Check failure on line 27 in stubs/sympy-stubs/polys/domains/integerring.pyi

View workflow job for this annotation

GitHub Actions / test

Variable not allowed in type expression (reportInvalidTypeForm)
def from_FF(K1, a, K0) -> int: ...
def from_FF_python(K1, a, K0) -> int: ...
def from_ZZ(K1, a, K0) -> int: ...
Expand Down
5 changes: 2 additions & 3 deletions stubs/sympy-stubs/polys/domains/old_fractionfield.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ from sympy.polys.domains.field import Field
from sympy.polys.polyclasses import DMF

class FractionField(Field, CharacteristicZero, CompositeDomain):
dtype = DMF
is_Frac = ...
has_assoc_Ring = ...
has_assoc_Field = ...
def __init__(self, dom, *gens) -> None: ...
def new(self, element) -> dtype: ...
def new(self, element) -> DMF: ...
def __hash__(self) -> int: ...
def __eq__(self, other) -> bool: ...
def to_sympy(self, a): ...
Expand All @@ -33,4 +32,4 @@ class FractionField(Field, CharacteristicZero, CompositeDomain):
def is_nonnegative(self, a): ...
def numer(self, a): ...
def denom(self, a): ...
def factorial(self, a) -> dtype: ...
def factorial(self, a) -> DMF: ...
4 changes: 1 addition & 3 deletions stubs/sympy-stubs/polys/domains/old_polynomialring.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class PolynomialRingBase(Ring, CharacteristicZero, CompositeDomain):
@public
class GlobalPolynomialRing(PolynomialRingBase):
is_Poly = ...
dtype = DMP
def from_FractionField(K1, a, K0) -> None: ...
def to_sympy(self, a) -> Order: ...
def from_sympy(self, a): ...
Expand All @@ -49,8 +48,7 @@ class GlobalPolynomialRing(PolynomialRingBase):
def is_nonnegative(self, a): ...

class GeneralizedPolynomialRing(PolynomialRingBase):
dtype = DMF
def new(self, a) -> dtype: ...
def new(self, a) -> DMF: ...
def __contains__(self, a) -> Literal[False]: ...
def from_FractionField(K1, a, K0): ...
def to_sympy(self, a): ...
Expand Down
11 changes: 5 additions & 6 deletions stubs/sympy-stubs/polys/domains/rationalfield.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
is_Numerical = ...
has_assoc_Ring = ...
has_assoc_Field = ...
dtype = MPQ
zero = dtype(0)
one = dtype(1)
tp: type[dtype]
zero = MPQ(0)
one = MPQ(1)
tp: type[MPQ]

Check failure on line 21 in stubs/sympy-stubs/polys/domains/rationalfield.pyi

View workflow job for this annotation

GitHub Actions / test

Variable not allowed in type expression (reportInvalidTypeForm)
def __init__(self) -> None: ...
def get_ring(self) -> Any: ...
def to_sympy(self, a) -> Rational | Integer: ...
Expand All @@ -36,8 +35,8 @@
def from_RealField(K1, a, K0) -> PythonMPQ: ...
def exquo(self, a, b) -> NotImplementedType | Self: ...
def quo(self, a, b) -> NotImplementedType | Self: ...
def rem(self, a, b) -> dtype: ...
def div(self, a, b) -> tuple[NotImplementedType | Self, dtype]: ...
def rem(self, a, b) -> MPQ: ...

Check failure on line 38 in stubs/sympy-stubs/polys/domains/rationalfield.pyi

View workflow job for this annotation

GitHub Actions / test

Variable not allowed in type expression (reportInvalidTypeForm)
def div(self, a, b) -> tuple[NotImplementedType | Self, MPQ]: ...

Check failure on line 39 in stubs/sympy-stubs/polys/domains/rationalfield.pyi

View workflow job for this annotation

GitHub Actions / test

Variable not allowed in type expression (reportInvalidTypeForm)
def numer(self, a): ...
def denom(self, a): ...

Expand Down
Loading