Skip to content

Commit

Permalink
fixes issue sympy#21999 and also added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
praneethratna committed Sep 2, 2021
1 parent 5c2dfe7 commit 33f2d66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sympy/solvers/polysys.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ def _solve_reduced_system(system, gens, entry=False):

univariate = list(filter(_is_univariate, basis))

if len(basis) < len(gens):
raise NotImplementedError(filldedent('''
only zero-dimensional systems supported
(finite number of solutions)
'''))

if len(univariate) == 1:
f = univariate.pop()
else:
Expand Down
5 changes: 5 additions & 0 deletions sympy/solvers/tests/test_polysys.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def test_solve_poly_system():
[z, -2*x*y**2 + x + y**2*z, y**2*(-z - 4) + 2]))
raises(PolynomialError, lambda: solve_poly_system([1/x], x))

raises(NotImplementedError, lambda: solve_poly_system(
[x-1,], (x, y)))
raises(NotImplementedError, lambda: solve_poly_system(
[y-1,], (x, y)))


def test_solve_biquadratic():
x0, y0, x1, y1, r = symbols('x0 y0 x1 y1 r')
Expand Down

0 comments on commit 33f2d66

Please sign in to comment.