Skip to content

Commit

Permalink
Trac #31773: make doctests compatible with Macaulay2 1.17
Browse files Browse the repository at this point in the history
With Macaulay2 1.17, some doctests fail due to slight changes in the
print representation.

URL: https://trac.sagemath.org/31773
Reported by: gh-mwageringel
Ticket author(s): Markus Wageringel
Reviewer(s): Samuel Lelièvre
  • Loading branch information
Release Manager committed Jul 24, 2021
2 parents 71e523a + 919907a commit abcef87
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/sage/interfaces/macaulay2.py
Expand Up @@ -40,7 +40,7 @@
sage: R = macaulay2('ZZ/5[x,y,z]') # optional - macaulay2
sage: R # optional - macaulay2
ZZ
--[x, y, z]
--[x...z]
5
sage: x = macaulay2('x') # optional - macaulay2
sage: y = macaulay2('y') # optional - macaulay2
Expand Down Expand Up @@ -435,7 +435,7 @@ def set(self, var, value):
sage: R = macaulay2('QQ[x, y]') # indirect doctest, optional - macaulay2
sage: R.net() # optional - macaulay2
QQ[x, y]
QQ[x...y]
sage: S = R / macaulay2('ideal {x^2 - y}') # optional - macaulay2
sage: macaulay2.eval('class x === %s' % S.name()) # optional - macaulay2
true
Expand Down Expand Up @@ -675,7 +675,7 @@ def ideal(self, *gens):
EXAMPLES::
sage: R2 = macaulay2.ring('QQ', '[x, y]'); R2 # optional - macaulay2
QQ[x, y]
QQ[x...y]
sage: I = macaulay2.ideal( ('y^2 - x^3', 'x - y') ); I # optional - macaulay2
3 2
ideal (- x + y , x - y)
Expand Down Expand Up @@ -752,7 +752,7 @@ def help(self, s):
****...
...
* "input" -- read Macaulay2 commands and echo
* "notify" -- whether to notify the user when a file is loaded
* "notify" -- whether to notify the user when a file is loaded...
TESTS:
Expand Down Expand Up @@ -912,11 +912,11 @@ def __str__(self):
sage: str(x+y) # optional - macaulay2
x + y
sage: str(macaulay2("QQ[x,y,z]")) # optional - macaulay2
QQ[x, y, z]
QQ[x...z]
sage: str(macaulay2("QQ[x,y,z]/(x+y+z)")) # optional - macaulay2
QQ[x, y, z]
-----------
x + y + z
QQ[x...z]
-------...
x + y + z
"""
P = self._check_valid()
return P.get(self._name)
Expand Down Expand Up @@ -1742,7 +1742,7 @@ def _instancedoc_(self):
****...
...
* "input" -- read Macaulay2 commands and echo
* "notify" -- whether to notify the user when a file is loaded
* "notify" -- whether to notify the user when a file is loaded...
TESTS:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/finite_rings/integer_mod_ring.py
Expand Up @@ -501,7 +501,7 @@ def _macaulay2_init_(self, macaulay2=None):
...
TypeError: Error evaluating Macaulay2 code.
IN:...
OUT:...error: ZZ/n not implemented yet for composite n
OUT:...error: ZZ/n not implemented yet for composite n...
"""
return "ZZ/{}".format(self.order())

Expand Down
4 changes: 2 additions & 2 deletions src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
Expand Up @@ -1119,12 +1119,12 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
sage: R.<x,y> = QQ[]
sage: macaulay2(R) # optional - macaulay2
QQ[x, y]
QQ[x...y]
sage: R.<x,y> = GF(17)[]
sage: macaulay2(R) # optional - macaulay2
ZZ
--[x, y]
--[x...y]
17
"""
try:
Expand Down
6 changes: 3 additions & 3 deletions src/sage/rings/quotient_ring.py
Expand Up @@ -1321,7 +1321,7 @@ def _macaulay2_init_(self, macaulay2=None):
sage: Q = R.quotient_ring(I); Q
Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 - y)
sage: Q._macaulay2_init_() # optional - macaulay2
QQ[x, y]
QQ[x...y]
--------
2
x - y
Expand All @@ -1331,7 +1331,7 @@ def _macaulay2_init_(self, macaulay2=None):
sage: Q = R.quotient(I); Q
Quotient of Multivariate Polynomial Ring in x, y, z, w over Integer Ring by the ideal (x*y - z^2, y^2 - w^2)
sage: Q._macaulay2_init_() # optional - macaulay2
ZZ[x, y, z, w]
ZZ[x...z, w]
-------------------
2 2 2
(x*y - z , y - w )
Expand All @@ -1342,7 +1342,7 @@ def _macaulay2_init_(self, macaulay2=None):
Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 101 by the ideal (x^2 + x, y^2 + y)
sage: Q._macaulay2_init_() # optional - macaulay2
ZZ
---[x, y]
---[x...y]
101
----------------
2 2
Expand Down

0 comments on commit abcef87

Please sign in to comment.