Your message dated Sun, 12 Nov 2023 19:52:00 +0100
with message-id <zvee0hauwg5gv...@georges.khaznadar.fr>
and subject line Re: python3-sympy: sympy.Poly() fails with: GeneratorsNeeded:
Cannot initialize from 'dict' without generators
has caused the Debian Bug report #1052596,
regarding python3-sympy: sympy.Poly() fails with: GeneratorsNeeded: Cannot
initialize from 'dict' without generators
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
1052596: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052596
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: python3-sympy
Version: 1.12-6
Severity: normal
Thank you very mcuh for maintaining Debian Linux's
"python3-sympy" package.
It's interesting and sophisticated.
Please allow me to draw your attention a possible
bug.
I can elicit it with just 2 lines of code.
Here is how:
$ ipython3
In [1]: from sympy import Poly
In [2]: Poly('((a - b) - (((a - b) + (c - d) + (e - f))/3)) + ((c - d)
- (((a - b) + (c - d) + (e - f))/3)) + (e - f) - ((a - b) + (c - d) +
(e - f))/3')
sympy.Poly() complains with
---------------------------------------------------------------------------
GeneratorsNeeded Traceback (most recent call last)
Cell In [2], line 1
----> 1 Poly('((a - b) - (((a - b) + (c - d) + (e - f))/3)) + ((c - d)
- (((a - b) + (c - d) + (e - f))/3)) + (e - f) - ((a - b) + (c - d) +
(e - f))/3')
File /usr/lib/python3/dist-packages/sympy/polys/polytools.py:182, in
Poly.__new__(cls, rep, *gens, **args)
180 return cls._from_poly(rep, opt)
181 else:
--> 182 return cls._from_expr(rep, opt)
File /usr/lib/python3/dist-packages/sympy/polys/polytools.py:312, in
Poly._from_expr(cls, rep, opt)
310 """Construct a polynomial from an expression. """
311 rep, opt = _dict_from_expr(rep, opt)
--> 312 return cls._from_dict(rep, opt)
File /usr/lib/python3/dist-packages/sympy/polys/polytools.py:249, in
Poly._from_dict(cls, rep, opt)
246 gens = opt.gens
248 if not gens:
--> 249 raise GeneratorsNeeded(
250 "Cannot initialize from 'dict' without generators")
252 level = len(gens) - 1
253 domain = opt.domain
GeneratorsNeeded: Cannot initialize from 'dict' without generators
I expected it to work.
Especially because simply deleting the trailing "/3" from the input does, like
this...
In [3]: Poly('((a - b) - (((a - b) + (c - d) + (e - f))/3)) + ((c - d)
- (((a - b) + (c - d) + (e - f))/3)) + (e - f) - ((a - b) + (c - d) +
(e - f))')
Out[3]: Poly(-2/3*a + 2/3*b - 2/3*c + 2/3*d - 2/3*e + 2/3*f, a, b, c, d, e,
f, domain='QQ')
I suppose an approximate workaround is to replace the trailing
.../3
with a leading
0.333*...
like this...
In [4]: Poly('((a - b) - (((a - b) + (c - d) + (e - f))/3)) + ((c - d)
- (((a - b) + (c - d) + (e - f))/3)) + (e - f) - 0.333*((a - b) +
...: (c - d) + (e - f))')
Out[4]: Poly(0.000333333333333297*a - 0.000333333333333297*b +
0.000333333333333297*c - 0.000333333333333297*d + 0.000333333333333297*e -
0.000333333333333297*f, a, b, c, d, e, f, domain='RR')
I also noticed that replacing the trailing "/3" with division by 1, 2, 4, 5 and
6 worked.
Thanks again for maintaining Debian's python3-sympy package.
Kind regards,
Kingsley
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable')
merged-usr: no
Architecture: i386 (i686)
Kernel: Linux 4.4.0-1-686-pae (SMP w/2 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
Versions of packages python3-sympy depends on:
ii python3 3.11.1-3
ii python3-mpmath 1.2.1-1
Versions of packages python3-sympy recommends:
ii isympy-common 1.7.1-2
ii python3-numpy 1:1.24.2-1
ii python3-pil 9.4.0-1.1+b1
Versions of packages python3-sympy suggests:
pn dvipng <none>
pn python-sympy-doc <none>
pn texlive-fonts-extra <none>
-- no debconf information
--- End Message ---
--- Begin Message ---
Dear Kingsley,
thank you for your bug report.
as the maintainer of the debian package, I am not involved in the
development of python3-sympy. I am forwarding this bug report to the
upstream development team, see
https://github.com/sympy/sympy/issues/25899
Maybe you noticed that you might build a minimal testcase, with
Poly('a-a')?
Best regards, Georges.
Kingsley G. Morse Jr. a écrit :
> Package: python3-sympy
> Version: 1.12-6
> Severity: normal
>
> Thank you very mcuh for maintaining Debian Linux's
> "python3-sympy" package.
>
> It's interesting and sophisticated.
>
> Please allow me to draw your attention a possible
> bug.
>
> I can elicit it with just 2 lines of code.
>
> Here is how:
>
> $ ipython3
>
> In [1]: from sympy import Poly
>
> In [2]: Poly('((a - b) - (((a - b) + (c - d) + (e - f))/3)) + ((c -
> d) - (((a - b) + (c - d) + (e - f))/3)) + (e - f) - ((a - b) + (c - d)
> + (e - f))/3')
>
> sympy.Poly() complains with
>
>
> ---------------------------------------------------------------------------
> GeneratorsNeeded Traceback (most recent call
> last)
> Cell In [2], line 1
> ----> 1 Poly('((a - b) - (((a - b) + (c - d) + (e - f))/3)) + ((c -
> d) - (((a - b) + (c - d) + (e - f))/3)) + (e - f) - ((a - b) + (c - d)
> + (e - f))/3')
>
> File /usr/lib/python3/dist-packages/sympy/polys/polytools.py:182, in
> Poly.__new__(cls, rep, *gens, **args)
> 180 return cls._from_poly(rep, opt)
> 181 else:
> --> 182 return cls._from_expr(rep, opt)
>
> File /usr/lib/python3/dist-packages/sympy/polys/polytools.py:312, in
> Poly._from_expr(cls, rep, opt)
> 310 """Construct a polynomial from an expression. """
> 311 rep, opt = _dict_from_expr(rep, opt)
> --> 312 return cls._from_dict(rep, opt)
>
> File /usr/lib/python3/dist-packages/sympy/polys/polytools.py:249, in
> Poly._from_dict(cls, rep, opt)
> 246 gens = opt.gens
> 248 if not gens:
> --> 249 raise GeneratorsNeeded(
> 250 "Cannot initialize from 'dict' without generators")
> 252 level = len(gens) - 1
> 253 domain = opt.domain
>
> GeneratorsNeeded: Cannot initialize from 'dict' without generators
>
>
> I expected it to work.
>
> Especially because simply deleting the trailing "/3" from the input does,
> like this...
>
> In [3]: Poly('((a - b) - (((a - b) + (c - d) + (e - f))/3)) + ((c -
> d) - (((a - b) + (c - d) + (e - f))/3)) + (e - f) - ((a - b) + (c - d)
> + (e - f))')
>
> Out[3]: Poly(-2/3*a + 2/3*b - 2/3*c + 2/3*d - 2/3*e + 2/3*f, a, b, c, d,
> e, f, domain='QQ')
>
>
> I suppose an approximate workaround is to replace the trailing
>
> .../3
>
> with a leading
>
> 0.333*...
>
> like this...
>
> In [4]: Poly('((a - b) - (((a - b) + (c - d) + (e - f))/3)) + ((c -
> d) - (((a - b) + (c - d) + (e - f))/3)) + (e - f) - 0.333*((a - b) +
> ...: (c - d) + (e - f))')
> Out[4]: Poly(0.000333333333333297*a - 0.000333333333333297*b +
> 0.000333333333333297*c - 0.000333333333333297*d + 0.000333333333333297*e -
> 0.000333333333333297*f, a, b, c, d, e, f, domain='RR')
>
>
> I also noticed that replacing the trailing "/3" with division by 1, 2, 4, 5
> and 6 worked.
>
> Thanks again for maintaining Debian's python3-sympy package.
>
> Kind regards,
> Kingsley
>
>
> -- System Information:
> Debian Release: bullseye/sid
> APT prefers unstable-debug
> APT policy: (500, 'unstable-debug'), (500, 'unstable')
> merged-usr: no
> Architecture: i386 (i686)
>
> Kernel: Linux 4.4.0-1-686-pae (SMP w/2 CPU threads)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not
> set
> Shell: /bin/sh linked to /bin/bash
> Init: systemd (via /run/systemd/system)
>
> Versions of packages python3-sympy depends on:
> ii python3 3.11.1-3
> ii python3-mpmath 1.2.1-1
>
> Versions of packages python3-sympy recommends:
> ii isympy-common 1.7.1-2
> ii python3-numpy 1:1.24.2-1
> ii python3-pil 9.4.0-1.1+b1
>
> Versions of packages python3-sympy suggests:
> pn dvipng <none>
> pn python-sympy-doc <none>
> pn texlive-fonts-extra <none>
>
> -- no debconf information
>
--
Georges KHAZNADAR et Jocelyne FOURNIER
22 rue des mouettes, 59240 Dunkerque France.
Téléphone +33 (0)3 28 29 17 70
signature.asc
Description: PGP signature
--- End Message ---