Skip to content

Commit

Permalink
Print base rings terse and starting with lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Apr 24, 2024
1 parent 58016e1 commit 7e4ea78
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 21 deletions.
3 changes: 1 addition & 2 deletions src/NCPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,8 @@ number_of_generators(R::NCPolyRing) = 1
###############################################################################

function show(io::IO, p::NCPolyRing)
io = pretty(io)
print(io, "Univariate polynomial ring in ", var(p), " over ")
print(IOContext(io, :compact => true), Lowercase(), base_ring(p))
print(terse(pretty(io)), Lowercase(), base_ring(p))

Check warning on line 154 in src/NCPoly.jl

View check run for this annotation

Codecov / codecov/patch

src/NCPoly.jl#L154

Added line #L154 was not covered by tests
end

###############################################################################
Expand Down
3 changes: 2 additions & 1 deletion src/generic/DirectSum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function show(io::IO, N::DirectSumModule{T}) where T <: RingElement
print(io, LowercaseOff(), "DirectSumModule")
else
io = pretty(io)
print(io, LowercaseOff(), "DirectSumModule over ", Lowercase(), base_ring(N))
print(io, LowercaseOff(), "DirectSumModule over ")
print(terse(io), Lowercase(), base_ring(N))

Check warning on line 53 in src/generic/DirectSum.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/DirectSum.jl#L52-L53

Added lines #L52 - L53 were not covered by tests
end
end

Expand Down
6 changes: 2 additions & 4 deletions src/generic/FreeModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ function show(io::IO, M::FreeModule{T}) where T <: Union{RingElement, NCRingElem
print(io, "Free module of rank ")
print(io, rank(M))
print(io, " over ")
io = pretty(io)
print(IOContext(io, :compact => true), Lowercase(), base_ring(M))
print(terse(pretty(io)), Lowercase(), base_ring(M))
end

function show(io::IO, M::FreeModule{T}) where T <: FieldElement
Expand All @@ -85,8 +84,7 @@ function show(io::IO, M::FreeModule{T}) where T <: FieldElement
print(io, "Vector space of dimension ")
print(io, dim(M))
print(io, " over ")
io = pretty(io)
print(IOContext(io, :compact => true), Lowercase(), base_ring(M))
print(terse(pretty(io)), Lowercase(), base_ring(M))

Check warning on line 87 in src/generic/FreeModule.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/FreeModule.jl#L87

Added line #L87 was not covered by tests
end

function show(io::IO, a::FreeModuleElem)
Expand Down
2 changes: 1 addition & 1 deletion src/generic/FunctionField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ end
@enable_all_show_via_expressify FunctionFieldElem

function show(io::IO, R::FunctionField)
print(IOContext(io, :compact => true), "Function Field over ",
print(terse(io), "Function Field over ",

Check warning on line 775 in src/generic/FunctionField.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/FunctionField.jl#L775

Added line #L775 was not covered by tests
base_ring(base_ring(R)), " with defining polynomial ",
numerator(R))
end
Expand Down
4 changes: 2 additions & 2 deletions src/generic/InvariantFactorDecomposition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ end

function show(io::IO, N::SNFModule{T}) where T <: RingElement
print(io, "Invariant factor decomposed module over ")
print(IOContext(io, :compact => true), base_ring(N))
print(terse(pretty(io)), Lowercase(), base_ring(N))

Check warning on line 60 in src/generic/InvariantFactorDecomposition.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/InvariantFactorDecomposition.jl#L60

Added line #L60 was not covered by tests
print(io, " with invariant factors ")
print(IOContext(io, :compact => true), invariant_factors(N))
end

function show(io::IO, N::SNFModule{T}) where T <: FieldElement
print(io, "Vector space over ")
print(IOContext(io, :compact => true), base_ring(N))
print(terse(pretty(io)), Lowercase(), base_ring(N))

Check warning on line 67 in src/generic/InvariantFactorDecomposition.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/InvariantFactorDecomposition.jl#L67

Added line #L67 was not covered by tests
print(io, " with dimension ")
print(io, ngens(N))
end
Expand Down
3 changes: 1 addition & 2 deletions src/generic/MPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3852,8 +3852,7 @@ function MPolyBuildCtx(R::AbstractAlgebra.NCRing)
end

function show(io::IO, M::MPolyBuildCtx)
iocomp = IOContext(io, :compact => true)
print(iocomp, "Builder for an element of ", parent(M.poly))
print(terse(io), "Builder for an element of ", parent(M.poly))
end

@doc raw"""
Expand Down
4 changes: 2 additions & 2 deletions src/generic/Misc/Localization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ end

function show(io::IO, L::LocalizedEuclideanRing)
if L.comp
print(io, "Localization of ", base_ring(L), " at complement of ", prime(L))
print(io, "Localization of ", Lowercase(), base_ring(L), " at complement of ", prime(L))

Check warning on line 170 in src/generic/Misc/Localization.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/Misc/Localization.jl#L170

Added line #L170 was not covered by tests
else
print(io, "Localization of ", base_ring(L), " at ", prime(L))
print(io, "Localization of ", Lowercase(), base_ring(L), " at ", prime(L))

Check warning on line 172 in src/generic/Misc/Localization.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/Misc/Localization.jl#L172

Added line #L172 was not covered by tests
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/generic/QuotientModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ end

function show(io::IO, N::QuotientModule{T}) where T <: RingElement
print(io, "Quotient module over ")
print(IOContext(io, :compact => true), base_ring(N))
print(terse(pretty(io)), Lowercase(), base_ring(N))

Check warning on line 68 in src/generic/QuotientModule.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/QuotientModule.jl#L68

Added line #L68 was not covered by tests
show_gens_rels(io, N)
end

function show(io::IO, N::QuotientModule{T}) where T <: FieldElement
println(io, "Quotient space over:")
print(IOContext(io, :compact => true), base_ring(N))
print(terse(pretty(io)), Lowercase(), base_ring(N))

Check warning on line 74 in src/generic/QuotientModule.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/QuotientModule.jl#L74

Added line #L74 was not covered by tests
show_gens_rels(io, N)
end

Expand Down
4 changes: 2 additions & 2 deletions src/generic/SparsePoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ function Base.show(io::IO, a::SparsePoly)
end

function show(io::IO, p::SparsePolyRing)
print(io, "Sparse Univariate Polynomial Ring in ")
print(io, "Sparse univariate polynomial ring in ")

Check warning on line 112 in src/generic/SparsePoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/SparsePoly.jl#L112

Added line #L112 was not covered by tests
print(io, string(p.S))
print(io, " over ")
print(IOContext(io, :compact => true), base_ring(p))
print(terse(pretty(io)), Lowercase(), base_ring(p))

Check warning on line 115 in src/generic/SparsePoly.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/SparsePoly.jl#L115

Added line #L115 was not covered by tests
end

###############################################################################
Expand Down
4 changes: 2 additions & 2 deletions src/generic/Submodule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ supermodule(M::Submodule{T}) where T <: RingElement = M.m

function show(io::IO, N::Submodule{T}) where T <: RingElement
print(io, "Submodule over ")
print(IOContext(io, :compact => true), base_ring(N))
print(terse(pretty(io)), Lowercase(), base_ring(N))
show_gens_rels(io, N)
end

function show(io::IO, N::Submodule{T}) where T <: FieldElement
print(io, "Subspace over ")
print(IOContext(io, :compact => true), base_ring(N))
print(terse(pretty(io)), Lowercase(), base_ring(N))

Check warning on line 64 in src/generic/Submodule.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/Submodule.jl#L64

Added line #L64 was not covered by tests
show_gens_rels(io, N)
end

Expand Down
3 changes: 2 additions & 1 deletion src/generic/TotalFraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ end
@enable_all_show_via_expressify TotFrac

function show(io::IO, a::TotFracRing)
print(IOContext(io, :compact => true), "Total ring of fractions of ", base_ring(a))
print(io, "Total ring of fractions of ")
print(terse(pretty(io)), Lowercase(), base_ring(a))

Check warning on line 141 in src/generic/TotalFraction.jl

View check run for this annotation

Codecov / codecov/patch

src/generic/TotalFraction.jl#L140-L141

Added lines #L140 - L141 were not covered by tests
end

###############################################################################
Expand Down

0 comments on commit 7e4ea78

Please sign in to comment.