Skip to content
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

improve introspection of Macaulay2 interface #28565

Closed
mwageringel opened this issue Oct 6, 2019 · 10 comments
Closed

improve introspection of Macaulay2 interface #28565

mwageringel opened this issue Oct 6, 2019 · 10 comments

Comments

@mwageringel
Copy link

This ticket improves the introspection for the Macaulay2 interface:

help is now called with a Macaulay2 string instead of a symbol, as this works in more generality, for example for global variables:

sage: macaulay2.errorDepth?

• The class Macaulay2FunctionElement of functions with applied first argument is implemented. This allows to make the help and source code more specific by taking into account the first argument. For example the following only shows the relevant output for Ideal, but not for Matrix or Module.

sage: I = macaulay2('ideal 4')
sage: I.resolution?
sage: I.resolution??

The __getattr__ of Macaulay2 is removed as it is not needed anymore since _function_class is implemented.

• The _sage_src_ of Macaulay2Function is simplified. This also fixes an issue where all the lines are shown with a special end character ^M when inspecting Macaulay2 source code as in:

sage: macaulay2.matrix??
code(methods matrix)^M
^M
o1000000008 = -- code for method: matrix(List)^M
...

• The nodetex and noreplace directives for Sage documentation are added to avoid reformatting of the Macaulay2 documentation. Previously one would get

sage: macaulay2.matrix?
...
+------------------------------+
| i1 : matrix{{1,2,3},{4,5,6}} |
| o1 = | 1 2 3 | 4 5 6 |  2    |
| 3  o1 : Matrix ZZ  <--- ZZ   |
+------------------------------+
...

instead of

+----------------------------+
|i1 : matrix{{1,2,3},{4,5,6}}|
|                            |
|o1 = | 1 2 3 |              |
|     | 4 5 6 |              |
|                            |
|              2        3    |
|o1 : Matrix ZZ  <--- ZZ     |
+----------------------------+

CC: @saliola @dimpase @antonleykin

Component: interfaces: optional

Keywords: macaulay2, IMA Coding Sprint

Author: Markus Wageringel

Branch/Commit: 4ae76ef

Reviewer: Franco Saliola

Issue created by migration from https://trac.sagemath.org/ticket/28565

@mwageringel
Copy link
Author

New commits:

dc7922f28565: improve macaulay2 introspection

@mwageringel
Copy link
Author

Commit: dc7922f

@mwageringel
Copy link
Author

Branch: u/gh-mwageringel/28565

@mwageringel
Copy link
Author

Author: Markus Wageringel

@mwageringel
Copy link
Author

Changed keywords from macaulay2 to macaulay2, IMA Coding Sprint

@saliola
Copy link

saliola commented Oct 6, 2019

Changed branch from u/gh-mwageringel/28565 to public/interfaces/m2/28565

@saliola
Copy link

saliola commented Oct 6, 2019

Changed commit from dc7922f to 4ae76ef

@saliola
Copy link

saliola commented Oct 6, 2019

New commits:

4ae76efMerge branch 'develop' into u/gh-mwageringel/28565

@saliola
Copy link

saliola commented Oct 6, 2019

Reviewer: Franco Saliola

@vbraun
Copy link
Member

vbraun commented Oct 7, 2019

Changed branch from public/interfaces/m2/28565 to 4ae76ef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants