Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-05 Thread Travis Oliphant
Matthew Brett wrote:
 Hi,

   
 This is a result of PyArray_FromAny changing when object arrays are
 explicitly requested (which they are in this case --- although behind
 the scenes).
 

 Hmm - I think I am hitting a related bug/feature/surprising change in
 behavior, which is showing up rather obscurely in a failure of the
 scipy.io matlab loading tests:

 http://projects.scipy.org/scipy/scipy/ticket/258

 Here's the change I wasn't expecting, present with current SVN:

 a = arange(2)
 b = arange(1)
 c = array([a, b], dtype=object)
 c
 -
 array([[0, 1],
[0, 0]], dtype=object)

 On a previous version of numpy (1.02b.dev2975) I get the answer I was 
 expecting:

 array([[0], [0 1]], dtype=object)
   

Grrr..Object arrays are very hard to get right.  I have no idea why 
this is happening, but I'll look into it.   I think it's the bug that 
led me to put in the special-case object-array handling in the first 
place.   Now, that special-case object-array handling is only done on an 
error condition, I need to fix this right and raise an inconsistent 
shape error.  It will probably help with the TypeError messages that are 
currently raised in this situation with other types as well.

-Travis


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] order keyword

2006-09-05 Thread Travis Oliphant
Charles R Harris wrote:
 I am trying to write more document strings for numpy and have a 
 question about the order keyword in tostring. The usual allowed values 
 of this keyword are C, F, or None, but in the tostring method 
 there is also the value Any which has the same effect as None. I 
 wonder if the Any shouldn't be removed as None seems to be the 
 preferred form in other methods. 
I don't think keeping 'Any' as a keyword here is a problem.

 Also, the default value of order in the tostring method is C and it 
 seems to me that the principal of least surprise requires None as the 
 default so that the order of the array being converted is the default.
I've thought this through several times.  There may be a few cases where 
'Any' is appropriate but the user will be expecting 'C' as the default 
because that was the only possibility for a long time.  It's actually 
very problematic to switch to 'Any' as the default.  You end up with 
lots of surprises as things start behaving very differently then they 
used to under Numeric once you transpose the array.

-Travis


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] (no subject)

2006-09-05 Thread kortmann
Hey guys I posted this on matplotlibs mailing list
 hey guys i got the subversion from the site and I am trying to install it
 on windows.

 I changed dir into the matplotlib dir that includes the setup.py file.

 run python setup.py install, and im getting a wierd error.  i left the
 topmost lines along with the error.  has anyone seen anything like this
 before?

 building 'matplotlib.enthought.traits.ctraits' extension
 creating build\temp.win32-2.4\Release\lib
 creating build\temp.win32-2.4\Release\lib\matplotlib
 creating build\temp.win32-2.4\Release\lib\matplotlib\enthought
 creating build\temp.win32-2.4\Release\lib\matplotlib\enthought\traits
 C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c
 /nologo /Ox
  /MD /W3 /GX /DNDEBUG -Ic:\Python24\include -Ic:\Python24\PC
 /Tclib/matplotlib/e
 nthought/traits/ctraits.c
 /Fobuild\temp.win32-2.4\Release\lib/matplotlib/enthoug
 ht/traits/ctraits.obj
 C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe /DLL
 /nologo
  /INCREMENTAL:NO /LIBPATH:c:\Python24\libs /LIBPATH:c:\Python24\PCBuild
 /EXPORT:
 initctraits
 build\temp.win32-2.4\Release\lib/matplotlib/enthought/traits/ctraits
 .obj /OUT:build\lib.win32-2.4\matplotlib\enthought\traits\ctraits.pyd
 /IMPLIB:bu
 ild\temp.win32-2.4\Release\lib/matplotlib/enthought/traits\ctraits.lib
 building 'matplotlib.backends._tkagg' extension
 C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c
 /nologo /Ox
  /MD /W3 /GX /DNDEBUG -Iwin32_static/include/tcl84 -I. -Isrc -Iswig
 -Iagg23/incl
 ude -I. -I. -Iwin32_static/include/tcl84\freetype2 -I.\freetype2
 -Isrc\freetype2
  -Iswig\freetype2 -Iagg23/include\freetype2 -I.\freetype2 -I.\freetype2
 -Ic:\Pyt
 hon24\include -Ic:\Python24\PC /Tpsrc/_tkagg.cpp
 /Fobuild\temp.win32-2.4\Release
 \src/_tkagg.obj
 _tkagg.cpp
 src\_tkagg.cpp(28) : fatal error C1083: Cannot open include file: 'tk.h':
 No suc
 h file or directory
 error: Command C:\Program Files\Microsoft Visual Studio .NET
 2003\Vc7\bin\cl.e
 xe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Iwin32_static/include/tcl84 -I.
 -Isrc -
 Iswig -Iagg23/include -I. -I. -Iwin32_static/include/tcl84\freetype2
 -I.\freetyp
 e2 -Isrc\freetype2 -Iswig\freetype2 -Iagg23/include\freetype2
 -I.\freetype2 -I.\
 freetype2 -Ic:\Python24\include -Ic:\Python24\PC /Tpsrc/_tkagg.cpp
 /Fobuild\temp
 .win32-2.4\Release\src/_tkagg.obj failed with exit status 2

and recieved this response


 You need to install the tcl/tk headers as Darren mentioned.  I just
 install ActiveTcl and the build should pick up on it no problem.


And then after that I ran into another error that looks like it might be
numpy related.  So i am posting this here and on Matplotlibs list.  The
second error is why i am posting here but since some of you use the latest
SVN on windows maybe you could offer more general help of how to compile
matplotlib on windows

I went ahead and installed Active Tcl
I removed microsft visual studio 2003 .net from my computer because I never
used it, and I did not want it on here in the first place but i had it on
here from being an intern over the summer.
C:\matplotlib\trunk\matplotlibc:\Python24\python.exe setup.py install
GTK requires pygtk
building tkagg 2 4
Building for python24
GTKAgg requires pygtk
running install
running build
running build_py
running build_ext
No module named msvccompiler in numpy.distutils, trying from distutils..
building 'matplotlib.backends._tkagg' extension
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo
/Ox
 /MD /W3 /GX
/DNDEBUG -Iwin32_static/include/tcl84 -I. -Isrc -Iswig -Iagg23/incl
ude -I. -I. -Iwin32_static/include/tcl84\freetype2 -I.\freetype2
-Isrc\freetype2
 -Iswig\freetype2 -Iagg23/include\freetype2 -I.\freetype2 -I.\freetype2
-Ic:\Pyt
hon24\include -Ic:\Python24\PC /Tpsrc/_tkagg.cpp
/Fobuild\temp.win32-2.4\Release
\src/_tkagg.obj
_tkagg.cpp
src\_tkagg.cpp(28) : fatal error C1083: Cannot open include file: 'tk.h': No
suc
h file or directory
error: Command C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\bin\cl.e
xe /c /nologo /Ox /MD /W3 /GX
/DNDEBUG -Iwin32_static/include/tcl84 -I. -Isrc -
Iswig -Iagg23/include -I. -I. -Iwin32_static/include/tcl84\freetype2
-I.\freetyp
e2 -Isrc\freetype2 -Iswig\freetype2 -Iagg23/include\freetype2 -I.\freetype2
-I.\
freetype2 -Ic:\Python24\include -Ic:\Python24\PC /Tpsrc/_tkagg.cpp
/Fobuild\temp
.win32-2.4\Release\src/_tkagg.obj failed with exit status 2

This is the error i got after my first try at

python setup.py install

after it did not work is when i uninstalled .net 2003.  and i recieve this
error currently.
C:\matplotlib\trunk\matplotlibc:\Python24\python.exe setup.py install
GTK requires pygtk
building tkagg 2 4
Building for python24
GTKAgg requires pygtk
running install
running build
running build_py
running build_ext
No module named msvccompiler in numpy.distutils, trying from distutils..
error: The .NET Framework SDK needs to be installed before building

Re: [Numpy-discussion] Irregular arrays

2006-09-05 Thread Torgil Svensson
 Think about gridding physical problems expressed in cylindrical or
 spherical coordinates.  The natural slices are not rectangles.  You can
 use rectangular storage but only with O(n^3) waste.

I don't get this argument. Are you slicing your spherical coordinates
with a cartesian coordinate system? That's surely a waste. Many times
bases can be chosen so that you even in an array doesn't waste space.

I can't see the point attacking numpy with this irregular
generalisation. Numpy is a tool very good for it's purpose, we don't
really want to trash it with features for solving unspecified general
problems. Instead, specify a real world problem, and perhaps someone
might have a good tip, otherwise look for other tools. Pytables for
example can efficiently store varying length arrays.

Maybe start on developing an variable length array yourself that
integrates perfectly with Numpy where applicable?

//Torgil


On 9/5/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Exalted presences and superior intellects aside, the point is not hard
 to get:  Motivational examples are everywhere.

 Think about gridding physical problems expressed in cylindrical or
 spherical coordinates.  The natural slices are not rectangles.  You can
 use rectangular storage but only with O(n^3) waste.

 More abstract solution spaces of math and physics do not usually lend
 themselves to rectangular treatments.  (I understand finite element
 techniques and am not referring to those.)  Again, rectangular storage
 is possible only with O(n^d) waste, where commonly d3.

 Granted one may overcome these issues with software development effort;
 that insight begs the question.  I am looking for teaching software that
 already does so.

 I agree that rectangular storage is easiest for software programmers and
 hence common.  It is not easiest for solving all problems.  Students
 should explore solutiuon spaces in a proper setting.  So I just asked
 what numpy could do in this regard.  Now I have the plain answer, and am
 grateful for it.

 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Numpy-discussion mailing list
 Numpy-discussion@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/numpy-discussion


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Keyword added to searchsorted.

2006-09-05 Thread Martin Spacek
I agree. This'll allow me to delete some messy code I have to get the 
same behaviour.

I'm amazed by how often I use searchsorted.

'side' sounds like a good keyword name to me.

Martin

Robert Kern wrote:
 Charles R Harris wrote:
 Hi all,

 I added the keyword side to the searchsorted method and functions. 
 
 Thank you! Just the other day, I was wishing that we had such a thing.
 

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion