Opened 6 years ago
Closed 6 years ago
#17736 closed defect (fixed)
not all fractions get converted with ex.fraction()
Reported by: | rws | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.7 |
Component: | symbolics | Keywords: | |
Cc: | Merged in: | ||
Authors: | Ralf Stephan | Reviewers: | Martin Albrecht |
Report Upstream: | N/A | Work issues: | |
Branch: | b46d1df (Commits, GitHub, GitLab) | Commit: | b46d1df5a328fd39b2d6fa47e09deb2f8619b8e5 |
Dependencies: | Stopgaps: |
Description
sage: a = var('a') sage: b = (1/a).fraction(QQ) ... TypeError: unsupported operand parent(s) for '/': 'Univariate Polynomial Ring in x over Rational Field' and 'Univariate Polynomial Ring in a over Rational Field'
The 1
apparently gets coerced into the x
-ring, so we need to ensure equal rings somehow.
Change History (8)
comment:1 Changed 6 years ago by
- Branch set to u/rws/not_all_fractions_get_converted_with_ex_fraction__
comment:2 Changed 6 years ago by
- Commit set to b46d1df5a328fd39b2d6fa47e09deb2f8619b8e5
- Milestone changed from sage-6.5 to sage-6.6
- Status changed from new to needs_review
comment:3 Changed 6 years ago by
Passes all patchbot tests.
comment:4 Changed 6 years ago by
- Milestone changed from sage-6.6 to sage-6.7
- Reviewers set to Martin Albrecht
- Status changed from needs_review to positive_review
Looks good to me. A potential feature request could be to allow the user to specify the ordering of variables, but perhaps that's overkill?
comment:5 Changed 6 years ago by
I'm not so familiar with algebra. Would you suggest specific orderings or is there a convention?
comment:6 follow-up: ↓ 7 Changed 6 years ago by
Hi, sorry for not being clear:
I merely meant the ordering of variable (names), where you currently call sort()
. But as I said: it's an optional feature request which could go into a separate ticket.
Of course, arbitrary term ordering ("lex" and "deglex" etc.) could also be considered. But I'd say a user should do the conversion by hand perhaps in this case.
comment:7 in reply to: ↑ 6 Changed 6 years ago by
Replying to malb:
I merely meant the ordering of variable (names), where you currently call
sort()
. But as I said: it's an optional feature request which could go into a separate ticket.
Ah but yes, I agree. Thanks for the review.
comment:8 Changed 6 years ago by
- Branch changed from u/rws/not_all_fractions_get_converted_with_ex_fraction__ to b46d1df5a328fd39b2d6fa47e09deb2f8619b8e5
- Resolution set to fixed
- Status changed from positive_review to closed
New commits:
17736: not all fractions get converted with ex.fraction()