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

Add missing parentheses in stacked printing of univpolys #1667

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

lgoettgens
Copy link
Collaborator

Consider the following example:

julia> R = universal_polynomial_ring(QQ)
Universal Polynomial Ring over Rationals

julia> x = gen(R, "x")
x

julia> S, y = polynomial_ring(R, "y")
(Univariate polynomial ring in y over universal Polynomial Ring over Rationals, y)

julia> (x+1)*y
x + 1*y

The missing parentheses in the last output are clearly misleading, and create an ambiguity between (x+1)*y and x+1*y.

This PR addresses this issue by replacing the printing of univ polys by using the expressify output of the underlying MPolyRing. This then fixes the recursive call of expressify on the coefficients of the polyring S.

Let's hope that this behavior is not doctested downstream and can be released quickly.

@lgoettgens lgoettgens requested a review from fingolfin April 15, 2024 13:50
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.88%. Comparing base (2da9299) to head (8290c05).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1667      +/-   ##
==========================================
- Coverage   86.88%   86.88%   -0.01%     
==========================================
  Files         116      116              
  Lines       29652    29650       -2     
==========================================
- Hits        25764    25762       -2     
  Misses       3888     3888              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thofma thofma merged commit 2d9bb4f into Nemocas:master Apr 16, 2024
29 of 31 checks passed
@lgoettgens lgoettgens deleted the lg/univpoly-show branch April 17, 2024 07: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.

3 participants