Arnd Baecker | 1 Mar 16:20 2004
Picon

Re: help and lazy-import (?)

Hi,

On Fri, 27 Feb 2004, Arnd Baecker wrote:
> On Fri, 27 Feb 2004, Pearu Peterson wrote:
> > On Fri, 27 Feb 2004, Arnd Baecker wrote:
> >
> > > there there seems to be something weird
> > > going on when trying to access help in the following way
> > >
> > > >>> import scipy
> > > >>> help("scipy.linalg")
> > > Help on instance of _ModuleLoader in scipy:
> > >
> > > scipy.linalg = <module 'scipy.linalg' from '/opt/python/lib/pyt...
> > > e-packages/scipy/linalg/__init__.pyc' [imported]>
> > >
> > > Doing another
> > > >>> help("scipy.linalg")
> > >
> > > one gets the expected help.

> > But in a traditional Python prompt
> >
> > >>> import scipy
> > >>> help("scipy.linalg")
> >
> > I get expected help. This is because ppimport redefines built-in help:
> >
> > >>> help
> > Type help () for interactive help, or help (object) for help about object.
(Continue reading)

Pearu Peterson | 1 Mar 17:45 2004

Re: help and lazy-import (?)


On Mon, 1 Mar 2004, Arnd Baecker wrote:

> we have had a further look into this and the status is as follows
> 
> - setting  postpone_import = 0 in (for example)
>   scipy/xplt/info_xplt.py
>   gives
>  >>> import scipy
>  Traceback (most recent call last):
>  [...]
>  from basic import *
>   File "/opt/python/lib/python2.3/site-packages/scipy/special/basic.py",
> line 10, in ?
>     from scipy import factorial
>   ImportError: cannot import name factorial
> 
>   We thought that setting `postpone_import = 0` means that the import
>   of this module is not postponed so that the doc string should be
>   available from the first call to help("scipy.xplt").
>   Is this idea/approach just wrong ?

No, setting `postpone_import = 0` should have worked. I look into it..
Ahh, I see, it is a chicken and egg problem..

> - We found that for
>     >>> import scipy
>     >>> help(scipy.xplt)
>   the correct documentation is visible already on the first
>   invokation of help.
(Continue reading)

Arnd Baecker | 2 Mar 09:49 2004
Picon

Re: help and lazy-import (?)

Hi Pearu,

On Mon, 1 Mar 2004, Pearu Peterson wrote:

[...]

> I have fixed this issue in CVS using different and I think more robust
> approach: `import scipy_base` will redefine help.__class__.__call__ method
> to support ppimport'ed modules. Now `help` works as expected for all
> of the following usage cases:
>
>   help(scipy.linalg)
>   help("scipy.linalg")
>   exec 'help("scipy.linalg")'
>   etc
>
> I have tested this on Python 2.3.3 only though.

Great - _many_ thanks for the fix!
Both
     >>> import scipy
     >>> help("scipy.xplt")
and
     In [1]: import scipy
     In [2]: help("scipy.xplt")
also work for me (I am also 2.3.3 as well).

There seems to be one case where I still see the module
loader when requesting help:

(Continue reading)

Arnd Baecker | 2 Mar 11:15 2004
Picon

xplt issues

Hi,

we are using scipy.xplt quite happily as it works nicely both under
linux and windows. However, there are two issues which cause
problems in the portability of the code:

a) Plot a single point

##################################
from scipy.xplt import *

window(0)
limits(0.0,10.0,0.0,1.0)
# this does not work (i.e does not show anything) under linux:
x=array([0.5])
y=array([0.5])
plg(y,x,marker='\2',width=10)

# this does work under linux:
x=array([0.5,0.5])
y=array([0.5,0.5])
plg(y,x,marker='\2',width=10)
##################################

I don't know what the origin of this differing behaviour is
(gd library ?)

b) This example illustrates a `dynamic' plot

##################################
(Continue reading)

Arnd Baecker | 2 Mar 11:51 2004
Picon

Re: xplt issues


On Tue, 2 Mar 2004, Arnd Baecker wrote:

[...]
> b) This example illustrates a `dynamic' plot
>
> ##################################
> from scipy.xplt import *
>
> figure()
> x=arange(0.0,0.5,0.001)
> hold('on')
> for xval in x:
>     print xval
>     yval = sin(xval / 4)
>     plot(xval, yval, 'x')
>     pause(1)
> ##################################
>
> The pause(1) is essential under linux so that the
> points are shown one after another.

My statement is not true, as
####################################
from scipy.xplt import *

window(0,wait=1)     #the trick is the wait=1 keyword
x=arange(0.0,5.0,0.001)
hold('on')
for xval in x:
(Continue reading)

Arnd Baecker | 2 Mar 12:06 2004
Picon

ANN: PlottingCanvas

Hi,

a while ago we addressed the question
of plotting  many thousand points quickly and
dynamically (i.e. one after another).
While scipy.xplt does a good job for this
in some cases we also wanted to have a nice
user-interface (with buttons and such)
and our choice came to wxPython.
However, none of the present plotting
packages fully fitted our specific needs and
thus we starting coding our own.
The resulting PlottingCanvas for wxPython can be found under
   http://www.physik.tu-dresden.de/~baecker/python/plot.html

The PlottingCanvas might illustrate what speed
is possible with wxPython (one question is whether
this speed would also be possible in chaco).

Any suggestions for further speed improvements
and comments are welcome!

Nikolai and Arnd
Brett G. Olivier | 2 Mar 23:19 2004
Picon
Picon

gplt.plot3d: grid data and isolines?

Hi

I am trying to plot 3D regular grid data with gplt.plot3d(Arr)
where Arr data is generated as:

1  1  x
1  2  y
2  1  x2
2  2  y2
... etc

plot3d plots the data points ok but the isolines simply join
1 2 y <---> 2 1 x2 etc. Gnuplot's way of sorting this out and quickly
plotting this type of data is to leave a blank line between the major grid
(defining the iso's):

1  1  x
1  2  y

2  1  x2
2  2  y2

I was wondering if there was a way of getting this behaviour using
scipy.gplt?

I have managed to emulate this behaviour relatively easily by altering the
_format(self,x) function in pyPlot.py at line 727

Currently if __format() gets INF it prints a ' - ' it would be really
useful if it printed a space '  ' instead (detail at end), then one could
(Continue reading)

Brett G. Olivier | 3 Mar 15:48 2004
Picon
Picon

Re: gplt.plot3d: grid data and isolines?

Ignore my potential workaround suggested in the last email. It turns out
to be a *very bad idea* as it messes up the 2D plots!

> Currently if __format() gets INF it prints a ' - ' it would be really
> useful if it printed a space '  ' instead

--

-- 
Brett G. Olivier  (bgoli at sun dot ac dot za)
Nils Wagner | 5 Mar 08:54 2004
Picon

Hessenberg form / Improving the wrapper for dgehrd

Hi all,

I was going to build a wrapper for dgehrd in order to have 
a function similar to hess in Matlab.

I am quite sure, that my solution is not optimal. The output 
contains not only the Hessenberg form of the input matrix but
the array tau. How can I circumvent this ?

>man dgehrd
...
the elements below the first subdiagonal, with the  array  TAU, 
represent
the orthogonal matrix Q as a product of elementary reflectors. 
See Further Details.  LDA     (input) INTEGER The leading
dimension of the array A.  LDA >= max(1,N).

Therefore I would appreciate any hint for improving the 
interface according to the rules for a possible implementation in scipy.

Thanks in advance.

Nils

!    -*- f90 -*-
python module hess ! in
    interface  ! in :hess
        subroutine dgehrd(n,ilo,ihi,a,lda,tau,work,lwork,info)
!in:hess:dgehrd.f

(Continue reading)

Massimo Sabbatini | 8 Mar 11:20 2004
Picon

Scipy build under win32

Dear all,

I tried to build scipy (cvs checkout) under win32. I installed MinGW and 
  followed quite closely Pearu's instructions at
http://cens.ioc.ee/~pearu/scipy/BUILD_WIN32.html
However, at the final scipy build stage, when I type

$ msys.py python setup.py build

I obtain the following:

Traceback (most recent call last):
   File "setup.py", line 125, in ?
     setup_package(ignore_packages)
   File "setup.py", line 98, in setup_package
     parent_path=local_path)
   File "setup.py", line 59, in get_packages
     config = setup_module.configuration(*args)
   File "c:\build\scipy\Lib\integrate\setup_integrate.py", line 21, in 
configuration
     raise NotFoundError,'no blas resources found'
scipy_distutils.system_info.NotFoundError: no blas resources found

However, my blas library is correctly found when I run system_info.py

Any hints, suggestions ?

Massimo

--

-- 
(Continue reading)


Gmane