[Numpy-discussion] test for long double support

2010-09-14 Thread Neal Becker
What is the recommended way to test for long double and clongdouble?

Is it:
#if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Difference in astype() for scalars and arrays?

2010-09-14 Thread Lorenz Hüdepohl
On Monday 13 September 2010 Pauli Virtanen wrote:
 Doesn't seem correct -- please file a bug ticket.

I did that: http://projects.scipy.org/numpy/ticket/1611

Regards,
Lorenz
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] test for long double support

2010-09-14 Thread Neal Becker
Neal Becker wrote:

 What is the recommended way to test for long double and clongdouble?
 
 Is it:
 #if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE

I guess I found it?

#if HAVE_LONG_DOUBLE// defined in pyconfig.h


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] how to store variable length string in array and get single char by it's position?

2010-09-14 Thread Keith Goodman
On Tue, Sep 14, 2010 at 9:25 AM, kee chen keekychen.sha...@gmail.com wrote:
 Dear All,

 Suppose I have a list group some kind like DNA sequence:

 1  ATGCATGCAATTGGCC
 2  ATGCATGCAATTGGCCATCD
 3  CATGCAATTGGC
 ..
 10 CATGCAAATTGGC

 the string length of each item is not sure and may get change/update later,
 then how can I store above in a numpy array (include the ID) and easy to get
 the single value?

 for example
 1.  ATGCATGCAATTGGCC
 I want get the first T then I use something like array[1][1], means
 A[T]G..   and if I want to update the 3rd postion I can use array[1][2]
 = T to set the AT[G]C... to AT[T]C...?

How about using a python list:

 array = ['ATGC', 'CATGA', 'A']
 array[0][1]
   'T'
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] how to store variable length string in array and get single char by it's position?

2010-09-14 Thread Bruce Southey

 On 09/14/2010 11:33 AM, Keith Goodman wrote:

On Tue, Sep 14, 2010 at 9:25 AM, kee chenkeekychen.sha...@gmail.com  wrote:

Dear All,

Suppose I have a list group some kind like DNA sequence:

1  ATGCATGCAATTGGCC
2  ATGCATGCAATTGGCCATCD
3  CATGCAATTGGC
..
10 CATGCAAATTGGC

the string length of each item is not sure and may get change/update later,
then how can I store above in a numpy array (include the ID) and easy to get
the single value?

for example
1.  ATGCATGCAATTGGCC
I want get the first T then I use something like array[1][1], means
A[T]G..   and if I want to update the 3rd postion I can use array[1][2]
= T to set the AT[G]C... to AT[T]C...?

How about using a python list:


array = ['ATGC', 'CATGA', 'A']
array[0][1]

'T'
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Variable length is incompatible with numpy:
'NumPy arrays have a fixed size at creation, unlike Python lists (which 
can grow dynamically).'

http://docs.scipy.org/doc/numpy/user/whatisnumpy.html

So you have to allocate the space for the largest sequence - although 
you can try using Scipy's sparse matrix (where nucleotides/amino acids 
are coded in numbers starting at 1 such that zeros code the empty areas.


If lists (or dictionaries) don't work for you, you might want to explore 
bioinformatics packages like 'pygr' (http://code.google.com/p/pygr/) and 
Biopython (http://biopython.org/wiki/Main_Page) or try more general 
approaches such hdf5 and pytables.


Bruce
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Can we freeze the subversion repository and move to github this week?

2010-09-14 Thread Travis Oliphant

On Sep 13, 2010, at 3:46 PM, Charles R Harris wrote:

 
 
 On Mon, Sep 13, 2010 at 2:33 PM, Travis Oliphant oliph...@enthought.com 
 wrote:
 
 Are we ready to do this yet?
 
 I know there were some outstanding questions.   Are there major concerns 
 remaining?   Or, is it just picking a time to freeze subversion when someone 
 like David or Pauli who know how to move the repository to github correctly a 
 time to do it.
 
 
 I didn't see any problems, but I didn't use the test repository that much. 
 Maybe we should just make the jump and iron out any little wrinkles as they 
 show up. Losing small bits of history doesn't bother me much.
 
 I think you guys have a big chore ahead of you to merge the refactored stuff 
 while keeping all the fixes that have gone in since the fork. Good Luck!

I know.   That's why I want to do it with git as much as possible... ;-)

-Travis


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Can we freeze the subversion repository and move to github this week?

2010-09-14 Thread Travis Oliphant

On Sep 13, 2010, at 6:20 PM, Pauli Virtanen wrote:

 Mon, 13 Sep 2010 21:41:18 +, Pauli Virtanen wrote:
 [clip]
 I can upload a final repository today/tomorrow. If it seems OK, we can
 freeze SVN trunk a few days after that.
 
 Or we can freeze the trunk sooner than that after the final repo is
 up, and patch up things manually, if something turns up (unlikely).
 
 Here we go:
 
   http://github.com/numpy/numpy
 
   http://github.com/numpy/vendor


Thanks!   This is really great work.   So much thanks is due to Pauli and David 
for making this happen. I will get Aaron River to freeze the SVN trunk as 
well as work on trac integration.   

There may be some learning for using the git workflow, and but it sounds like 
there are some good tutorials for doing it. 

I've heard several people say that once they used git, they can't imagine going 
back to SVN.  

-Travis

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] test for long double support

2010-09-14 Thread Lisandro Dalcin
On 14 September 2010 12:47, Neal Becker ndbeck...@gmail.com wrote:
 Neal Becker wrote:

 What is the recommended way to test for long double and clongdouble?

 Is it:
 #if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE

 I guess I found it?

 #if HAVE_LONG_DOUBLE            // defined in pyconfig.h


I think these two are different things. For example, MSVC do support
'long double', it is a different type than 'double', but sizeof(long
double) == sizeof(double).

Also look at CPython's objimpl.h, union _gc_head, you will see an
unprotected usage of 'long double', so it seems that CPython requires
that the C compiler to support 'long double'.


-- 
Lisandro Dalcin
---
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Can we freeze the subversion repository and move to github this week?

2010-09-14 Thread Fernando Perez
On Tue, Sep 14, 2010 at 4:05 PM, Travis Oliphant oliph...@enthought.com wrote:
 Here we go:

       http://github.com/numpy/numpy

       http://github.com/numpy/vendor


 Thanks!   This is really great work.   So much thanks is due to Pauli and 
 David for making this happen.     I will get Aaron River to freeze the SVN 
 trunk as well as work on trac integration.

Ditto thanks!

 There may be some learning for using the git workflow, and but it sounds like 
 there are some good tutorials for doing it.

I keep a list of resources here in case someone finds them useful:

http://fperez.org/py4science/git.html

 I've heard several people say that once they used git, they can't imagine 
 going back to SVN.

As you were writing this, Min RK and I were discussing on IRC:

minrk1 there are so many people who provide patches on github, since
the process is so easy
fperez I couldn't think of going back from git to svn now.

:)

Cheers,

f
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [OT: MATLAB] Any way to globally make Matlab struct attributes Python-property-like

2010-09-14 Thread Ken Watford
On Mon, Sep 13, 2010 at 10:24 PM, David Goldsmith
d.l.goldsm...@gmail.com wrote:
 I.e., I'd, at minimum, like to globally replace

 get(Handel, 'Property')

 with

 object.Property

 and

 set(Handel, 'Property', value)

 with

 object.Property = value

 to an arbitrary level of composition.

Both structures and objects of both handle and value types work
exactly like you're asking for.

You're probably talking about handle graphics objects (which are
just opaque numeric values representing things related to the UI),
which do still require the get/set functions. They're just doubles,
after all. It should be feasible to write a class that wraps them for
ease of use, but that wouldn't be a topic for here. If that intrigues
you, try asking about it on StackOverflow.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] sf.net export controls for numpy/scipy

2010-09-14 Thread Jarrod Millman
Hello,

I plan to update the export controls settings for both numpy and scipy to:

This project does NOT incorporate, access, call upon, or otherwise
use encryption of any kind, including, but not limited to, open source
algorithms and/or calls to encryption in the operating system or
underlying platform.

Unless I hear from someone that I overlooked something, I will make
the changes tomorrow.

Best,
Jarrod
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Buildbot errors and failures

2010-09-14 Thread Charles R Harris
Just thought I'd throw these out there, they've been showing for a while.


Windows XP:
===

ERROR: test_fromfile_tofile_seeks (test_regression.TestRegression)
--
Traceback (most recent call last):
  File 
C:\buildbot\numpy\b11\numpy-install25\Lib\site-packages\numpy\core\tests\test_regression.py,
line 1384, in test_fromfile_tofile_seeks
ret = np.fromfile(f, count=4, dtype='u1')
IOError: first argument must be an open file

BSD :
=

gmake test
/usr/local/bin/python2.6 -c 'import numpy,sys;sys.exit(not
numpy.test(full, verbose=10).wasSuccessful())'
Traceback (most recent call last):
  File string, line 1, in module
  File 
/home/doconnor/numpy-buildbot/b12/numpy-install/lib/python2.6/site-packages/numpy/__init__.py,
line 136, in module
import add_newdocs
  File 
/home/doconnor/numpy-buildbot/b12/numpy-install/lib/python2.6/site-packages/numpy/add_newdocs.py,
line 9, in module
from numpy.lib import add_newdoc
  File 
/home/doconnor/numpy-buildbot/b12/numpy-install/lib/python2.6/site-packages/numpy/lib/__init__.py,
line 13, in module
from polynomial import *
  File 
/home/doconnor/numpy-buildbot/b12/numpy-install/lib/python2.6/site-packages/numpy/lib/polynomial.py,
line 17, in module
from numpy.linalg import eigvals, lstsq
  File 
/home/doconnor/numpy-buildbot/b12/numpy-install/lib/python2.6/site-packages/numpy/linalg/__init__.py,
line 48, in module
from linalg import *
  File 
/home/doconnor/numpy-buildbot/b12/numpy-install/lib/python2.6/site-packages/numpy/linalg/linalg.py,
line 23, in module
from numpy.linalg import lapack_lite
ImportError: /usr/local/lib/liblapack.so.4: Undefined symbol
_gfortran_st_write
Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion