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

Make show(:::AbsSimpleNumField) more consistent #1664

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/antic/nf_elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,12 @@
###############################################################################

function Base.show(io::IO, ::MIME"text/plain", a::AbsSimpleNumField)
@show_name(io, a)
@show_special(io, MIME"text/plain"(), a)

Check warning on line 255 in src/antic/nf_elem.jl

View check run for this annotation

Codecov / codecov/patch

src/antic/nf_elem.jl#L254-L255

Added lines #L254 - L255 were not covered by tests
print(io, "Number field with defining polynomial ", defining_polynomial(a))
println(io)
io = AbstractAlgebra.pretty(io)
print(io, AbstractAlgebra.Indent(), "over ", AbstractAlgebra.Lowercase(), QQ)
print(io, Dedent())
io = pretty(io)
print(io, Indent(), "over ", Lowercase(), QQ, Dedent())

Check warning on line 259 in src/antic/nf_elem.jl

View check run for this annotation

Codecov / codecov/patch

src/antic/nf_elem.jl#L258-L259

Added lines #L258 - L259 were not covered by tests
#print(IOContext(io, :supercompact => true))
end

Expand All @@ -267,8 +268,9 @@
print(io, "Number field")
else
# nested printing allowed, preferably supercompact
io = pretty(io)
print(io, "Number field of degree $(degree(a))")
print(IOContext(io, :supercompact => true), " over ", Nemo.QQ)
print(IOContext(io, :supercompact => true), " over ", Lowercase(), QQ)
end
end

Expand Down Expand Up @@ -1204,6 +1206,15 @@
print(io, "Cyclotomic field of order $(get_attribute(a, :cyclo))")
end

function show_cyclo(io::IO, ::MIME"text/plain", a::AbsSimpleNumField)

Check warning on line 1209 in src/antic/nf_elem.jl

View check run for this annotation

Codecov / codecov/patch

src/antic/nf_elem.jl#L1209

Added line #L1209 was not covered by tests
# TODO: change to print something with "cyclotomic" in it
@assert is_cyclo_type(a)
print(io, "Number field with defining polynomial ", defining_polynomial(a))
println(io)
io = pretty(io)
print(io, Indent(), "over ", Lowercase(), QQ, Dedent())

Check warning on line 1215 in src/antic/nf_elem.jl

View check run for this annotation

Codecov / codecov/patch

src/antic/nf_elem.jl#L1211-L1215

Added lines #L1211 - L1215 were not covered by tests
end


@doc raw"""
cyclotomic_real_subfield(n::Int, s::VarName = "(z_$n + 1/z_$n)", t = "\$"; cached = true)
Expand Down
Loading