Opened 3 years ago

Last modified 5 weeks ago

#21009 needs_review defect

Doctest: Fix collect_common_factors() to accept any expression

Reported by: rws Owned by:
Priority: major Milestone: sage-8.2
Component: symbolics Keywords:
Cc: Merged in:
Authors: Ralf Stephan Reviewers:
Report Upstream: N/A Work issues:
Branch: u/rws/doctest__fix_collect_common_factors___to_accept_any_expression (Commits) Commit: 1597fed9d9ec4158db6a736a577c94c2e6807d7a
Dependencies: #23325 Stopgaps:

Description (last modified by rws)

Visible already in sage-7.1v, difficult to get a good minimal test case.

sage: (1/24*((sqrt(3)*2^(2/3)*gamma(1/3) + I*2^(2/3)*gamma(1/3))/pi + 4*2^(2/3)*gamma(1/3)/(pi*(sqrt(3) + I)))/x^(1/3)).collect_common_factors()
1/24*2^(2/3)*(sqrt(3) + 4/(sqrt(3) + I) + I)*gamma(1/3)/(pi*x^(1/3))
sage: (1/24*((I*2^(2/3)*gamma(1/3))/pi + 4*2^(2/3)*gamma(1/3)/(pi*(sqrt(3) + I)))/x^(1/3)).collect_common_factors()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-c25fe41fc3c2> in <module>()
----> 1 _.collect_common_factors()

/home/ralf/sage-7.1v/src/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.collect_common_factors (/home/ralf/sage-7.1v/src/build/cythonized/sage/symbolic/expression.cpp:37782)()
   6649         sig_on()
   6650         try:
-> 6651             x = g_collect_common_factors(self._gobj)
   6652         finally:
   6653             sig_off()

ValueError: divide: arguments must be polynomials over the rationals

Change History (10)

comment:1 Changed 21 months ago by rws

  • Description modified (diff)
  • Milestone changed from sage-7.3 to sage-8.1
  • Summary changed from Fix symbolic GCD to accept any expression to Fix collect_common_factors() to accept any expression

comment:2 Changed 19 months ago by rws

  • Milestone changed from sage-8.1 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

We now get with Sage-8.0

sage: (1/24*((I*2^(2/3)*gamma(1/3))/pi + 4*2^(2/3)*gamma(1/3)/(pi*(sqrt(3) + I))
....: )/x^(1/3)).collect_common_factors()
....: 
1/24*2^(2/3)*(4/(sqrt(3) + I) + I)*gamma(1/3)/(pi*x^(1/3))

comment:3 Changed 19 months ago by rws

  • Dependencies set to #23225
  • Milestone changed from sage-duplicate/invalid/wontfix to sage-8.1
  • Status changed from needs_review to needs_work
  • Summary changed from Fix collect_common_factors() to accept any expression to Doctest: Fix collect_common_factors() to accept any expression

Actually the fix was unintentional and is in Pynac-0.7.10. This will add doctests.

comment:4 Changed 19 months ago by rws

  • Branch set to u/rws/doctest__fix_collect_common_factors___to_accept_any_expression

comment:5 Changed 19 months ago by rws

  • Branch u/rws/doctest__fix_collect_common_factors___to_accept_any_expression deleted
  • Dependencies changed from #23225 to #23325

comment:6 Changed 19 months ago by rws

  • Branch set to u/rws/doctest__fix_collect_common_factors___to_accept_any_expression
  • Commit set to e77531edeb3cde45b1a913a82ac0db83658bc733

Sorry.

comment:7 Changed 15 months ago by rws

  • Branch u/rws/doctest__fix_collect_common_factors___to_accept_any_expression deleted
  • Commit e77531edeb3cde45b1a913a82ac0db83658bc733 deleted

comment:8 Changed 15 months ago by rws

  • Branch set to u/rws/doctest__fix_collect_common_factors___to_accept_any_expression

comment:9 Changed 15 months ago by rws

  • Authors set to Ralf Stephan
  • Commit set to 1597fed9d9ec4158db6a736a577c94c2e6807d7a
  • Milestone changed from sage-8.1 to sage-8.2
  • Status changed from needs_work to needs_review

New commits:

1597fed21009: doctest

comment:10 Changed 5 weeks ago by tscrim

If you rebase the branch, I will review this.

Note: See TracTickets for help on using tickets.