Skip to content

Commit

Permalink
Trac #33278: Adapt Macaulay2 interface doctests to Macaulay2 1.19
Browse files Browse the repository at this point in the history
We adapt the Macaulay2 interface doctests
to Macaulay2 1.19.

URL: https://trac.sagemath.org/33278
Reported by: gh-sheerluck
Ticket author(s): Andrey Belgorodski
Reviewer(s): Markus Wageringel
  • Loading branch information
Release Manager committed Feb 14, 2022
2 parents d026799 + 4b07b12 commit 01e8677
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
37 changes: 20 additions & 17 deletions src/sage/interfaces/macaulay2.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,13 @@ def help(self, s):
sage: shell.run_cell('macaulay2.help("try")') # optional - macaulay2
try -- catch an error
****...
The object "try" is a keyword.
The object "try" is a...
sage: from sage.repl.interpreter import get_test_shell
sage: shell = get_test_shell()
sage: shell.run_cell('macaulay2.help("errorDepth")') # optional - macaulay2
errorDepth...
The object "errorDepth" is an integer.
The object "errorDepth" is a...
"""
r = self.eval('help "%s"' % s)
end = r.rfind("\n\nDIV")
Expand Down Expand Up @@ -885,7 +885,7 @@ def _latex_(self):
| 1 2 |
| 3 4 |
sage: latex(m) # optional - macaulay2
\begin{pmatrix}...1...2...3...4...\end{pmatrix}
\left(\begin{smallmatrix} 1&2\\ 3&4\\ \end{smallmatrix}\right)
"""
s = self.tex().external_string().strip('"').strip('$').replace('\\\\','\\')
s = s.replace(r"\bgroup","").replace(r"\egroup","")
Expand Down Expand Up @@ -1755,15 +1755,15 @@ def _instancedoc_(self):
sage: shell = get_test_shell()
sage: shell.run_cell('macaulay2.matrix?') # optional - macaulay2
...
+----------------------------+
|i1 : matrix{{1,2,3},{4,5,6}}|
| |
|o1 = | 1 2 3 | |
| | 4 5 6 | |
| |
| 2 3 |
|o1 : Matrix ZZ <--- ZZ |
+----------------------------+
+--------------------------------+
| i1 : matrix{{1,2,3},{4,5,6}} |
| |
| o1 = | 1 2 3 | |
| | 4 5 6 | |
| |
| 2 3 |
| o1 : Matrix ZZ <--- ZZ |
+--------------------------------+
...
"""
r = self._parent.help(self._name)
Expand Down Expand Up @@ -1795,17 +1795,20 @@ def _instancedoc_(self):
sage: shell = get_test_shell()
sage: shell.run_cell('I = macaulay2("ideal {4}")') # optional - macaulay2
sage: shell.run_cell('I.resolution?') # optional - macaulay2
Signature:...
Signature: I.resolution(*args, **kwds)
Type: Macaulay2FunctionElement
String form: resolution
File: ...
Docstring:
resolution -- projective resolution
****...
<BLANKLINE>
resolution(Ideal) -- compute a projective resolution of...
****...
| 1 4 6 4 1 |
|o3 = R <-- R <-- R <-- R <-- R <-- 0|
| |
| 0 1 2 3 4 5|
| 1 4 6 4 1 |
| o3 = R <-- R <-- R <-- R <-- R <-- 0 |
| |
| 0 1 2 3 4 5 |
...
"""
P = self._obj.parent()
Expand Down
4 changes: 3 additions & 1 deletion src/sage/rings/ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,9 @@ def _macaulay2_init_(self, macaulay2=None):
sage: macaulay2(ideal(5)) # optional - macaulay2
ideal 5
sage: macaulay2(ideal(QQ(5))) # optional - macaulay2
sage: J = ideal(QQ(5))
...
sage: macaulay2(J) # optional - macaulay2
ideal 1
TESTS:
Expand Down

0 comments on commit 01e8677

Please sign in to comment.