Lambdify namespace order bugfix

2 views
Skip to first unread message

Matthew Brett

unread,
Jul 1, 2010, 4:53:55 PM7/1/10
to sympy patches
Hi,

I posted to report a problem with lambdify and namespaces to the sympy
mailing list a while ago:

http://groups.google.com/group/sympy/browse_thread/thread/bb2c16413c49b6f9?fwc=2

but was stirred by the silence to go and find and fix the bug (patch
attached, with explanatory test).

Sorry not to raise an Issue for this - issue - but I am in Cuba at the
moment; Google code sees this and takes appropriate action.

See you,

Matthew

0001-Bugfix-lambdify-dictionaries-modules-namespace-confu.patch

Ondrej Certik

unread,
Jul 2, 2010, 6:05:13 PM7/2/10
to sympy-...@googlegroups.com, Andy Ray Terrel
Hi Matthew!

On Thu, Jul 1, 2010 at 1:53 PM, Matthew Brett <matthe...@gmail.com> wrote:
> Hi,
>
> I posted to report a problem with lambdify and namespaces to the sympy
> mailing list a while ago:
>
> http://groups.google.com/group/sympy/browse_thread/thread/bb2c16413c49b6f9?fwc=2
>
> but was stirred by the silence to go and find and fix the bug (patch
> attached, with explanatory test).

The patch is +1, and I've pushed it in. It's in this repo:

http://github.com/sympy/sympy

I am proposing on our list now that this becomes our official repo, it
sort of is already. (the git.sympy.org, running on my server,
currently got broken).

Btw, I just talked to Andy in Pilsen, how he got involved with sympy
and he told me the exact same experience as you did --- was stirred by
the silence, so he just fixed it himself. :)

>
> Sorry not to raise an Issue for this - issue - but I am in Cuba at the
> moment; Google code sees this and takes appropriate action.

It sucks. Does github work fine?

Ondrej

Aaron S. Meurer

unread,
Jul 4, 2010, 11:56:08 AM7/4/10
to sympy-...@googlegroups.com
For some reason, this patch removed the ">>> from sympy import lambdify" line from the docstring, which now causes doctest failures.

Aaron Meurer

Ondrej Certik

unread,
Jul 4, 2010, 1:43:51 PM7/4/10
to sympy-...@googlegroups.com
Oops, you are right.

I just fixed that. I forgot to run doctests, and the reason is that I
got a failure in mpmath tests, some vizualization problem, when I run
it remotely.

ondrej@raven:~/repos/sympy(master)$ bin/test
sympy/mpmath/tests/test_visualization.py
============================= test process starts ==============================
executable: /usr/bin/python (2.6.5-final-0)

sympy/mpmath/tests/test_visualization.py[1] E [FAIL]

________________________________________________________________________________
______________ sympy/mpmath/tests/test_visualization.py:test_axes ______________
File "/home/ondrej/repos/sympy/sympy/mpmath/tests/test_visualization.py",
line 15, in test_axes
fig = pylab.figure()
File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 254, in figure
**kwargs)
File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py",
line 90, in new_figure_manager
window = Tk.Tk()
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1646, in __init__
self.tk = _tkinter.create(screenName, baseName, className,
interactive, wantobjects, useTk, sync, use)
TclError: no display name and no $DISPLAY environment variable

=========== tests finished: 0 passed, 1 exceptions, in 0.66 seconds ============
DO *NOT* COMMIT!


Ondrej

> --
> You received this message because you are subscribed to the Google Groups "sympy-patches" group.
> To post to this group, send email to sympy-...@googlegroups.com.
> To unsubscribe from this group, send email to sympy-patche...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy-patches?hl=en.
>
>

Aaron S. Meurer

unread,
Jul 4, 2010, 1:45:17 PM7/4/10
to sympy-...@googlegroups.com
> Oops, you are right.
>
> I just fixed that. I forgot to run doctests, and the reason is that I
> got a failure in mpmath tests, some vizualization problem, when I run
> it remotely.

See issue 1956.

Aaron Meurer

Ondrej Certik

unread,
Jul 4, 2010, 1:54:07 PM7/4/10
to sympy-...@googlegroups.com

I just fixed that too.

Ondrej

Øyvind Jensen

unread,
Jul 5, 2010, 8:16:18 AM7/5/10
to sympy-patches


On 4 Jul, 19:54, Ondrej Certik <ond...@certik.cz> wrote:
> On Sun, Jul 4, 2010 at 10:45 AM, Aaron S. Meurer <asmeu...@gmail.com> wrote:
>
> >> Oops, you are right.
>
> >> I just fixed that. I forgot to run doctests, and the reason is that I
> >> got a failure in mpmath tests, some vizualization problem, when I run
> >> it remotely.
>
> > See issue 1956.
>
> I just fixed that too.

1956 is not fixed in master:

[oy@ubuntulaptop sympy (master)]$ git log --oneline -1
34a70c9 Don't run mpmath pylab tests, if pylab fails to import
[oy@ubuntulaptop sympy (master)]$ bin/test sympy/mpmath/tests/
test_visualization.py
============================= test process starts
==============================
executable: /usr/bin/python (2.5.2-final-0)

sympy/mpmath/tests/test_visualization.py[1]
E [FAIL]

________________________________________________________________________________
______________ sympy/mpmath/tests/test_visualization.py:test_axes
______________
File "/home/oy/git_workingdir/sympy/sympy/mpmath/tests/
test_visualization.py", line 22, in test_axes
assert axes.get_xlabel() == 'x'
AttributeError: Subplot instance has no attribute 'get_xlabel'

=========== tests finished: 0 passed, 1 exceptions, in 1.19 seconds
============
DO *NOT* COMMIT!

Øyvind

Matthew Brett

unread,
Jul 5, 2010, 12:00:56 PM7/5/10
to sympy-patches
Hi,

> The patch is +1, and I've pushed it in. It's in this repo:
>
> http://github.com/sympy/sympy

Great - thanks - I'd actually already switched to github.com/sympy/sympy

> Btw, I just talked to Andy in Pilsen, how he got involved with sympy
> and he told me the exact same experience as you did --- was stirred by
> the silence, so he just fixed it himself. :)

:) I'm sure there's a good balance of noise and silence

>> Sorry not to raise an Issue for this - issue - but I am in Cuba at the
>> moment; Google code sees this and takes appropriate action.
>
> It sucks. Does github work fine?

For now, yes, it does - luckily - otherwise I'd be really stuck when I
come to work here. I arrive here in a lab full of programmers and
physicists and say 'Python is excellent - much better than matlab -
give it a try - whoops - Google code has banned you and you can't get
package X, Y, Z' and that's a bit depressing. Maybe someday it will
seem part of what Hillary Clinton has called the US 'national brand'
to encourage open collaboration on scientific coding.

http://www.pcworld.com/article/187365/clinton_us_govt_will_push_harder_against_web_censorship.html

See you,

Matthew

Ondrej Certik

unread,
Jul 5, 2010, 1:08:16 PM7/5/10
to sympy-...@googlegroups.com

That's a different error -- what version of matplotlib do you have?

Ondrej

Øyvind Jensen

unread,
Jul 5, 2010, 1:21:22 PM7/5/10
to sympy-...@googlegroups.com

In [1]: import matplotlib

In [2]: matplotlib.__version__
Out[2]: '0.91.2'

It's old, but it is the version shipped with Ubuntu hardy, so it will be
around for another year at least.

Øyvind

Reply all
Reply to author
Forward
0 new messages