Alan G Isaac | 1 Aug 2007 04:01
Picon
Favicon

Re: Finding Neighboors

On Tue, 17 Apr 2007, Matthieu Brucher apparently wrote:
> I wanted to know if there was a module in scipy that is able to find the 
> k-neighboors of a point ? 
> If so, is there an optimized one - tree-based search - ? 
> If not, I'm doing the optimized version. 

Hi Matthieu,

Where did you go with this?

Thanks!
Alan
David Cournapeau | 1 Aug 2007 03:57
Picon
Picon

Re: Problems installing scipy

Alexander Dietz wrote:
> Hi,
>
> thanks for the tipps bot none of them are working!
>
> On 7/31/07, *David Cournapeau* < david <at> ar.media.kyoto-u.ac.jp 
> <mailto:david <at> ar.media.kyoto-u.ac.jp>> wrote:
>
>     Alexander Dietz wrote:
>     > Hi,
>     >
>     > I am trying to install scipy on my laptop, running FC5. I have
>     > installed numpy, so I downloaded the scipy-package and run the setup
>     > script which creates a warning only:
>     >
>     Note that to avoid all this hassle, there are some rpm for FC5 for
>     numpy
>     and scipy:
>
>     http://download.opensuse.org/repositories/home:/ashigabou/Fedora_Extras_5/
>     <http://download.opensuse.org/repositories/home:/ashigabou/Fedora_Extras_5/>
>
>
> I tried to install the rpm package, but, as I expected before, several 
> other packages are required to install scipy:
>
> error: Failed dependencies:
>         libblas.so.3 is needed by python-scipy-0.5.2-14.1.i386
>         liblapack.so.3 is needed by python-scipy-0.5.2-14.1.i386
>         python-numpy is needed by python-scipy-0.5.2-14.1.i386
(Continue reading)

David Cournapeau | 1 Aug 2007 04:00
Picon
Picon

Re: Another error while installing scipy

Robert Kern wrote:
> Alexander Dietz wrote:
>   
>> Hi,
>>
>> while trying to install scipy on my laptop (FC5, numpy 1.0.3) I
>> encountered finally an error never occured before. I would appreciate to
>> resolve this problem in order to get scipy installed.
>>     
>
>   
>>   File "Lib/odr/setup.py", line 9, in ?
>>     from numpy.distutils.misc_util import get_path, Configuration, dot_join
>> ImportError: cannot import name get_path
>>
>>
>> As far as I know I have all these lapack, blas and atlas packages
>> installed. Any ideas?
>>     
>
> I goofed before the 1.0.3 release. I thought that get_path() was only used
> internally; it *is* currently deprecated in favor of using the Configuration
> object. Lib/odr/setup.py is fixed in scipy SVN, though.
>
>   
Alexander, to install numpy and scipy, you should really try the rpms of 
the ashigabou repository, they take care of all those problems. It is 
just a matter to add the repository to your package manager, and then 
everything is taken care for you. The above problem is taken care of, 
for example :) (I backported some changes from svn to make it work).
(Continue reading)

R S Ananda Murthy | 1 Aug 2007 05:28
Picon
Favicon

Error in SciPy install on Zenwalk-4.6.1 system.

Hello,

I am trying to make package of SciPy on Zenwalk-4.6.1. I have already 
installed numpy, lapack, fftw. When I do

python setup.py install --prefix=/usr --root=$dest

setup runs for some time, and then I get the following message:

  File "/usr/lib/python2.5/site-packages/numpy/distutils/misc_util.py",
line 687, in _get_configuration_from_setup_py
    ('.py', 'U', 1))
  File "Lib/odr/setup.py", line 9, in <module>
    from numpy.distutils.misc_util import get_path, Configuration, dot_join
ImportError: cannot import name get_path

Why am I getting this ImportError? How to correct this?

Thanks for your help,

Anand
Robert Kern | 1 Aug 2007 05:33
Picon
Gravatar

Re: Error in SciPy install on Zenwalk-4.6.1 system.

R S Ananda Murthy wrote:
> Hello,
> 
> I am trying to make package of SciPy on Zenwalk-4.6.1. I have already 
> installed numpy, lapack, fftw. When I do
> 
> python setup.py install --prefix=/usr --root=$dest
> 
> setup runs for some time, and then I get the following message:
> 
>   File "/usr/lib/python2.5/site-packages/numpy/distutils/misc_util.py",
> line 687, in _get_configuration_from_setup_py
>     ('.py', 'U', 1))
>   File "Lib/odr/setup.py", line 9, in <module>
>     from numpy.distutils.misc_util import get_path, Configuration, dot_join
> ImportError: cannot import name get_path
> 
> 
> Why am I getting this ImportError?

Because I screwed up just before the numpy 1.0.3 release and removed that
deprecated function without realizing that scipy 0.5.2 still used it.

> How to correct this?

This is fixed in the SVN scipy.

--

-- 
Robert Kern

(Continue reading)

R S Ananda Murthy | 1 Aug 2007 06:08
Picon
Favicon

Re: Error in SciPy install on Zenwalk-4.6.1 system.

R S Ananda Murthy wrote:
> Hello,
> 
> I am trying to make package of SciPy on Zenwalk-4.6.1. I have already 
> installed numpy, lapack, fftw. When I do
> 
> python setup.py install --prefix=/usr --root=$dest
> 
> setup runs for some time, and then I get the following message:
> 
>   File "/usr/lib/python2.5/site-packages/numpy/distutils/misc_util.py",
> line 687, in _get_configuration_from_setup_py
>     ('.py', 'U', 1))
>   File "Lib/odr/setup.py", line 9, in <module>
>     from numpy.distutils.misc_util import get_path, Configuration, dot_join
> ImportError: cannot import name get_path
> 
> 
> Why am I getting this ImportError?

Because I screwed up just before the numpy 1.0.3 release and removed that
deprecated function without realizing that scipy 0.5.2 still used it.

> How to correct this?

This is fixed in the SVN scipy.

--

-- 
Robert Kern

(Continue reading)

David Cournapeau | 1 Aug 2007 06:04
Picon
Picon

Re: Error in SciPy install on Zenwalk-4.6.1 system.

R S Ananda Murthy wrote:
> R S Ananda Murthy wrote:
>   
>> Hello,
>>
>> I am trying to make package of SciPy on Zenwalk-4.6.1. I have already 
>> installed numpy, lapack, fftw. When I do
>>
>> python setup.py install --prefix=/usr --root=$dest
>>
>> setup runs for some time, and then I get the following message:
>>
>>   File "/usr/lib/python2.5/site-packages/numpy/distutils/misc_util.py",
>> line 687, in _get_configuration_from_setup_py
>>     ('.py', 'U', 1))
>>   File "Lib/odr/setup.py", line 9, in <module>
>>     from numpy.distutils.misc_util import get_path, Configuration, dot_join
>> ImportError: cannot import name get_path
>>
>>
>> Why am I getting this ImportError?
>>     
>
> Because I screwed up just before the numpy 1.0.3 release and removed that
> deprecated function without realizing that scipy 0.5.2 still used it.
>
>   
>> How to correct this?
>>     
>
(Continue reading)

Rob Clewley | 1 Aug 2007 06:39
Picon
Favicon

Re: restricting optimize.leastsq to positive results

Hi Christoph,

If you want to keep using the leastsq code then the way to do it is to
penalize negative values via your residual. This needs to be done in a
way that makes the algorithm think that the optimal solution is only
in the positive half-space. So when you write your residual function
as a python function, you have various options. A really simple one
that breaks some of the assumptions of smoothness (i.e. for people who
don't care to retain theoretical conditions on the convergence
properties of leastsq, esp. for such a simple problem as this...)
might look something like this (off the top of my head):

from numpy import any
from numpy.linalg import norm

# a global algorithmic parameter that should be fairly large,
depending on the scale of your residual function res(p)
neg_penalty = 100

def res(p):
  # this is your original unconstrained residual based on distance of
your data points from your fitted line
  return <your residual as a function of the parameters p>

def residual(p):
  # Non-negativity pseudo-constraint
  # Assume p = array([a, b, A, B]) are floats, chosen by leastsq
  if any(p<0):
    return neg_penalty * norm(p[p<0]) * res(p)
  else:
(Continue reading)

Robert Kern | 1 Aug 2007 06:48
Picon
Gravatar

Re: Error in SciPy install on Zenwalk-4.6.1 system.

David Cournapeau wrote:

> Anand, I answer to you in this mail since it seems your reply is 
> mislocated in your email. To fetch numpy and scipy from sources, you 
> need to install subversion first, and then:
> 
> svn co http://svn.scipy.org/svn/numpy/trunk numpy.svn
> svn co http://svn.scipy.org/svn/scipy/trunk scipy.svn
> 
> And then build numpy and scipy from sources as usual. Note that your 
> problem is not scipy but numpy (numpy is used by scipy to build).

Well, sort of. While I shouldn't have removed get_path(), odr's setup.py
shouldn't have been using it. Of course, the fault is mine for both!

Anand, if you just want to patch the scipy 0.5.2 that you have, you can see the
relevant changes here:

http://projects.scipy.org/scipy/scipy/changeset?new=trunk%2FLib%2Fodr%2Fsetup.py%403006&old=trunk%2FLib%2Fodr%2Fsetup.py%402596

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco
David Cournapeau | 1 Aug 2007 07:17
Picon
Picon

Re: Error in SciPy install on Zenwalk-4.6.1 system.

Robert Kern wrote:
> David Cournapeau wrote:
>
>> Anand, I answer to you in this mail since it seems your reply is 
>> mislocated in your email. To fetch numpy and scipy from sources, you 
>> need to install subversion first, and then:
>>
>> svn co http://svn.scipy.org/svn/numpy/trunk numpy.svn
>> svn co http://svn.scipy.org/svn/scipy/trunk scipy.svn
>>
>> And then build numpy and scipy from sources as usual. Note that your 
>> problem is not scipy but numpy (numpy is used by scipy to build).
>
> Well, sort of. While I shouldn't have removed get_path(), odr's setup.py
> shouldn't have been using it. Of course, the fault is mine for both!
>
Is this the only problem arising when building current relased scipy + 
nump ? I don't remember the details, but I had to backport other changes 
to make rpms build and succeed the test suites (maybe this was only for 
64 bits arch, don't remember).

David

Gmane