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 one line printing of GenericCyclotomicFractions #228

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions src/GenericCyclotomicFractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,17 @@
return GenericCycloFrac(new_numerator, new_denominator, a.exceptions, simplify=false)
end

function show(io::IO, x::GenericCycloFrac)
function show(io::IO, ::MIME"text/plain", x::GenericCycloFrac)

Check warning on line 72 in src/GenericCyclotomicFractions.jl

View check run for this annotation

Codecov / codecov/patch

src/GenericCyclotomicFractions.jl#L72

Added line #L72 was not covered by tests
io=pretty(io)
print(io, x)
if is_restriction(x.exceptions)
print(io, "\nWith exceptions:\n", Indent())
print(io, x.exceptions)
print(io, Dedent())

Check warning on line 78 in src/GenericCyclotomicFractions.jl

View check run for this annotation

Codecov / codecov/patch

src/GenericCyclotomicFractions.jl#L74-L78

Added lines #L74 - L78 were not covered by tests
end
end

function show(io::IO, x::GenericCycloFrac)

Check warning on line 82 in src/GenericCyclotomicFractions.jl

View check run for this annotation

Codecov / codecov/patch

src/GenericCyclotomicFractions.jl#L82

Added line #L82 was not covered by tests
if isone(x.denominator)
print(io, "$(x.numerator)")
else
Expand All @@ -90,11 +99,6 @@
print(io, "($(x.denominator))")
end
end
if is_restriction(x.exceptions)
print(io, "\nWith exceptions:\n", Indent())
print(io, x.exceptions)
print(io, Dedent())
end
end

isone(x::GenericCycloFrac) = isone(x.numerator) && isone(x.denominator)
Expand Down
1 change: 0 additions & 1 deletion src/Parameter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function Parameters(p::Vector{Parameter})
return Parameters(p,UPolyFrac[])
end

# TODO Use OSCAR's expressify system here.
function show(io::IO, a::Parameters)
print(io, join(a.params, ", "))
if !isempty(a.exceptions)
Expand Down
Loading