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

UngradedModules: don't use display(...) in special show methods #2909

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

benlorenz
Copy link
Member

From the help of display(...):

In general, you cannot assume that display output goes to stdout...

But all the text surrounding that display call goes to stdout.

Also it doesn't get captured by Documenter which is used for checking the code for the oscar-book.

The new show call seems to replicate the previous output:

julia> show_subquo(H)
Graded subquotient of
[1   0   0   0]
[0   0   0   1]
by image of
[x     0   0     0]
[0   y^2   0     0]
[0     0   x     0]
[0     0   0   y^2]
with ambient free module Rg^4

Anyone who knows more about all the pretty-printing features please feel free to add suggestions.

> In general, you cannot assume that display output goes to stdout...

also it doesn't get captured by documenter
@fingolfin
Copy link
Member

As far as I can tell, all these methods show_subquo , show_morphism_as_map, show_morphism are not called anywhere. It is not clear to me what they are meant to be used for, and by whom. As they are right now, I think they are best internal debugging helpers?

Perhaps @jankoboehm can clarify.

@benlorenz
Copy link
Member Author

They are exported and show_subquo even has a docstring. show_subquo is used in the book chapter on algebraic geometry.

@jankoboehm
Copy link
Contributor

show_subquo prints a subquo in terms of a dense representation of the vectors and omits the indexing of the vectors i.e. in terms of a generator and relation matrix. This was requested by various people because in some settings this offers a shorter and better understandable presentation. We would like to keep that, but we can rename it or make it available in a different way. The analogous thing is show_morphism.

The function show_morphism_as_map is historical. Remember that a morphism then only printed domain and codomain. This function is what later became the standard way of printing morphisms. So it should be removed.

@benlorenz
Copy link
Member Author

I will merge this now as this helps with the Oscar book testing and the new code just uses more appropriate methods for displaying the matrices. The output should be identical.
Feel free to make a new PR to clean up the historical method and/or reorganize this.

@benlorenz benlorenz merged commit f88f79e into master Oct 16, 2023
9 of 13 checks passed
@benlorenz benlorenz deleted the bl/nodisplay branch October 16, 2023 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants