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

Another fix for printing of scheme-related types #2864

Merged
merged 8 commits into from
Oct 2, 2023

Conversation

StevellM
Copy link
Member

Complement to #2856 for scheme objects.

  • Fix the :supercompact printings for the scheme-related objects (which was too compact and not useful);
  • Remove spacings for some morphism types;
  • Replace occurrences of Morphism by Hom in the compact printings of morphisms.

@simonbrandhorst

(I duplicated the changes of PR-2856 for two of the types to avoid potential conflicts when one of the two PR will be merged.)

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it really confusing that the supercompact, oneline and detailed printing for these objects often use completely different taglines.

Maybe this is justified in a few cases, but in all??

I think this is partly because there is no systematic testing for this printing and so one does not even see anywhere what changes to these cause, and how the different printing options look when put next to each other.

I've created a setup for making this kind of tests a bit easier to write, you can preview it in https://github.com/Nemocas/AbstractAlgebra.jl/pull/1450/files#diff-249d4721dac939c93f2b04531e4728899bf98414e9ffeff88015a2e9516fd8b5 -- it will hopefully soon be available here (after some PR merging and releases)

experimental/Schemes/CoveredProjectiveSchemes.jl Outdated Show resolved Hide resolved
experimental/Schemes/FunctionFields.jl Outdated Show resolved Hide resolved
experimental/Schemes/IdealSheaves.jl Outdated Show resolved Hide resolved
@@ -15,7 +15,7 @@ end
# one line printing
function Base.show(io::IO, X::AbsProjectiveVariety{<:Field,<:MPolyQuoRing})
if get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Projective variety")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Else case is missing this prefix and instead prints "V(...)" with "V" hardcoded that seems not good?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here was one of the solution to obtain explicit short printing, that could also fit well in nested printings. For a projective variety, we know the defining ideal I and it is common to use the notation V(I) to describe such objects. This is why the "V" is hardcoded, and then we print the ideal in between parentheses.

src/AlgebraicGeometry/Schemes/SpecOpen/Objects/Methods.jl Outdated Show resolved Hide resolved
@StevellM
Copy link
Member Author

I will go through the comments, thank you very much for this!

The differences between printing modes for a same types (with sometimes slight change of signatures) have been made on purpose, thoroughly. We can of course discuss the relevance/consistency, but words are put in a certain context and so the printings have been sometimes adapted to make them as clear as possible and avoid redundancy.

I agree that for some places, viewing some of your comments, there are things to be adapted that I did not notice the first time I made all those changes. For some others I do not agree, and I guess it is important to keep those differences because we do not bring the same amount of information between detailed and non-detailed printings.

The general motto was: we do not compute anything we do not know, but we put as much information as we know about the object in the (super)compact printings. In the case of AffineVariety for instance, by the signatures of the type, we can already deduce that it is an affine space, and the other cases we don't know... but in the case where we know it is an affine space, why shouldn't we print that it is an affine space ?
This explains why we carry those difference of printings (similarly with the Empty version of some of the printing: isn't it easier to know directly by the printing that something is empty if the object knows it is empty ?)

auto-merge was automatically disabled September 30, 2023 14:38

Head branch was pushed to by a user without write access

@codecov
Copy link

codecov bot commented Sep 30, 2023

Codecov Report

Merging #2864 (3bcc7d7) into master (aa9c04b) will decrease coverage by 0.01%.
The diff coverage is 28.84%.

@@            Coverage Diff             @@
##           master    #2864      +/-   ##
==========================================
- Coverage   80.49%   80.48%   -0.01%     
==========================================
  Files         456      456              
  Lines       65220    65214       -6     
==========================================
- Hits        52501    52490      -11     
- Misses      12719    12724       +5     
Files Coverage Δ
experimental/Schemes/CoveredScheme.jl 94.63% <ø> (ø)
experimental/Schemes/SpaceGerms.jl 68.43% <ø> (ø)
...etry/Schemes/AffineSchemes/Morphisms/Attributes.jl 79.66% <ø> (ø)
...ry/Schemes/AffineSchemes/Morphisms/Constructors.jl 100.00% <ø> (ø)
...ometry/Schemes/AffineSchemes/Objects/Attributes.jl 88.34% <ø> (ø)
...try/Schemes/CoveredSchemes/Morphisms/Attributes.jl 61.11% <ø> (ø)
...y/Schemes/CoveredSchemes/Morphisms/Constructors.jl 100.00% <ø> (ø)
...metry/Schemes/CoveredSchemes/Objects/Attributes.jl 98.41% <ø> (ø)
...eometry/Schemes/Covering/Morphisms/Constructors.jl 100.00% <ø> (ø)
.../AlgebraicGeometry/Schemes/Glueing/Constructors.jl 70.78% <ø> (ø)
... and 29 more

... and 5 files with indirect coverage changes

Comment on lines 284 to 272
print(io, "Covered projective scheme")
print(io, "Relative projective scheme")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check this with @HechtiDerLachs -- "Covered projective scheme" has the wording of the underlying type built into it. This might be on purpose.

println(io, "Morphism")
println(io, "Spec open morphism")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but for later discussion:
Spec open is not a standard wording. Maybe it should be printed as a typename or with a different wording.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree. To be honnest I was not sure what to do with this without having very long names. At least the printing looks consistent and it carries the wording of the typename (for now)

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks, this is now much better in terms of consistency!

@fingolfin fingolfin merged commit 141adbf into oscar-system:master Oct 2, 2023
11 of 15 checks passed
@StevellM StevellM deleted the sm/fix_print_scheme branch April 29, 2024 11:58
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.

4 participants