Re: [Numpy-discussion] [ANN] Python for Scientific Computing conference in Boulder, CO; April'15

2014-10-28 Thread Jean-Baptiste Marquette

Le 28 oct. 2014 à 19:09, Fernando Perez fperez@gmail.com a écrit :

 a colleague from NCAR in Boulder just sent me this link about a conference 
 they are organizing in the spring:
 


Wrong year on the web page: April 13 - 17, 2014

Cheers,
JB



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


Re: [Numpy-discussion] EuroSciPy 2014 Call for Abstracts

2014-03-05 Thread Jean-Baptiste Marquette
Hi Ralf,

 EuroSciPy 2014, the Seventh Annual Conference on Python in Science, takes 
 place in Cambridge, UK on 27 - 30 August 2013. The conference features two 
 days of tutorials followed by two days of scientific talks. The day after the 
 main conference, developer sprints will be organized on projects of interest 
 to attendees.
  
 The topics presented at EuroSciPy are very diverse, with a focus on advanced 
 software engineering and original uses of Python and its scientific 
 libraries, either in theoretical or experimental research, from both academia 
 and the industry. The program includes keynotes, contributed talks and 
 posters. 
 
 Submissions for talks and posters are welcome on our website 
 (http://www.euroscipy.org/2014/). In your abstract, please provide details on 
 what Python tools are being employed, and how. The deadline for submission is 
 14 April 2013.

Some dates refer to 2013…

Cheers,
JB

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


Re: [Numpy-discussion] EuroSciPy 2014 Call for Abstracts

2014-03-05 Thread Jean-Baptiste Marquette

Le 5 mars 2014 à 20:43, Ralf Gommers ralf.gomm...@gmail.com a écrit :

 Hmm, that's why one shouldn't send emails like these at the end of a long 
 day. Dates are correct except for 2013--2014.

« It's only those who do nothing that make no mistakes, I suppose. »
Joseph Conrad (An Outcast of the Islands, 1896, pt. 3, chap. 2)___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Simple way to launch python processes?

2011-12-07 Thread Jean-Baptiste Marquette
You should consider the powerful multiprocessing package. Have a look on this 
piece of code:

import glob
import os
import multiprocessing as multi
import subprocess as sub
import time

NPROC = 4
Python = '/Library/Frameworks/EPD64.framework/Versions/Current/bin/python'
Xterm = '/usr/X11/bin/xterm '

coord = []
Size = '100x10'
XPos = 810
YPos = 170
XOffset = 0
YOffset = 0

for i in range(NPROC):
if i % 2 == 0:
coord.append(Size + '+' + str(YPos) + '+' + str(YOffset))
else:
coord.append(Size + '+' + str(XPos) + '+' + str(YOffset))
YOffset = YOffset + YPos

def CompareColourRef(Champ):
BaseChamp = os.path.basename(Champ)
NameProc = int(multi.current_process().name[-1]) - 1
print 'Processing', BaseChamp, 'on processor', NameProc+1
os.putenv('ADAM_USER', DirWrk + 'adam_' + str(NameProc+1))
Command =  Xterm + '-geometry ' + '' + coord[NameProc] + ' -T  Proc' + 
str(NameProc+1) + ' ' + BaseChamp + ' ' + ' -e  ' + Python + ' ' + DirSrc + \
'CompareColourRef.py ' + BaseChamp + ' 21 | tee ' + DirLog + 
BaseChamp + '.log'
Process = sub.Popen([Command], shell=True)
Process.wait()
print BaseChamp, 'processed on processor', NameProc+1
return

pool = multi.Pool(processes=NPROC)

Champs = glob.glob(DirImg + '*/*')
results = pool.map_async(CompareColourRef, Champs)
pool.close()

while results._number_left  0:
print Waiting for, results._number_left, 'tasks to complete'
time.sleep(15)

pool.join()

print 'Process completed'
exit(0)

Cheers
Jean-Baptiste


Le 7 déc. 2011 à 15:43, Olivier Delalleau a écrit :

 Maybe try stackoverflow, since this isn't really a numpy question.
 To run a command like python myscript.py arg1 arg2 in a separate process, 
 you can do:
 p = subprocess.Popen(python myscript.py arg1 arg2.split())
 You can launch many of these, and if you want to know if a process p is over, 
 you can call p.poll().
 I'm sure there are other (and better) options though.
 
 -=- Olivier
 
 2011/12/7 Lou Pecora lou_boog2...@yahoo.com
 I would like to launch python modules or functions (I don't know which is 
 easier to do, modules or functions) in separate Terminal windows so I can see 
 the output from each as they execute.  I need to be able to pass each module 
 or function a set of parameters.  I would like to do this from a python 
 script already running in a Terminal window.  In other words, I'd start up a 
 master script and it would launch, say, three processes using another 
 module or a function with different parameter values for each launch and each 
 would run independently in its own Terminal window so stdout from each 
 process would go to it's own respective window.  When the process terminated 
 the window would remain open.
 
 I've begun to look at subprocess modules, etc., but that's pretty confusing. 
 I can do what I say above manually, but it's gotten clumsy as I want to run 
 eventually in 12 cores.
 
 I have a Mac Pro running Mac OS X 10.6.
 
 If there is a better forum to ask this question, please let me know. 
 
 Thanks for any advice.
 
  
 -- Lou Pecora, my views are my own.
 
 
 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion
 
 
 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion

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


Re: [Numpy-discussion] ANN: SciPy 0.10.0 released

2011-11-14 Thread Jean-Baptiste Marquette

Le 13 nov. 2011 à 20:19, Ralf Gommers a écrit :

 I am pleased to announce the availability of SciPy 0.10.0.

Hi all,

Thanks for this great job.
I've run nosetests on my Mac (64-bit 10.7.2 build on EPD) which fails on the 
following test:

test_definition (test_basic.TestDoubleIFFT) ... FAIL
test_definition_real (test_basic.TestDoubleIFFT) ... ok
test_djbfft (test_basic.TestDoubleIFFT) ... python(60968) malloc: *** error for 
object 0x105435b58: incorrect checksum for freed object - object was probably 
modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6


Thanks for any hint,

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


Re: [Numpy-discussion] what to use in buildbot config for numpy testing

2011-09-08 Thread Jean-Baptiste Marquette
There is much more simple: the command nosetests numpy
Of course, nosetests needs to be installed...

Cheers
JB


Le 7 sept. 2011 à 23:44, Chris Kees a écrit :

 Hi Derek,
 
 Thanks! I forgot that python would exit with 0 even if numpy.test()
 fails.  That could have taken a while to realize.
 
 Chris
 
 On Wed, Sep 7, 2011 at 4:22 PM, Derek Homeier
 de...@astro.physik.uni-goettingen.de wrote:
 On 07.09.2011, at 10:52PM, Chris Kees wrote:
 
 Is there a recommended way to run the numpy test suite as a buildbot
 test? Just run ad python -c import numpy; numpy.test as ShellCommand
 object?
 
 It would be numpy.test() [or numpy.test('full')]; then it depends on what 
 you need
 as the return value of your test. I am using for package verification
 
 python -c 'import numpy, sys; ret=numpy.test(full); 
 sys.exit(2*len(ret.errors+ret.failures))'
 
 so python will return with a value != 0 in case of an unsuccessful test 
 (which it
 otherwise would not do). But this is just within a simple shell script.
 
 Cheers,
Derek
 --
 
 Derek Homeier  Centre de Recherche Astrophysique de Lyon
 ENS Lyon  46, Allée d'Italie
 69364 Lyon Cedex 07, France  +33 1133 47272-8894
 
 
 
 
 
 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion
 
 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion

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


Re: [Numpy-discussion] A question about dtype syntax

2011-09-01 Thread Jean-Baptiste Marquette

Hi Warren  Pierre,

 Notice that your array is actually a 2D structured array with shape (n, 1).  
 Try reshaping it to (n,) or apply np.squeeze before calling savetxt.

Thanks to both of you, I made huge progress to understand how numpy arrays 
work. I use PyDev under Eclipse, and the debugger showed me that the vstack 
function generated a 2D array. So I used append instead, and my script now 
works!

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


Re: [Numpy-discussion] A question about dtype syntax

2011-08-31 Thread Jean-Baptiste Marquette

Hi Pierre,

Thanks for the guess. Unfortunately, I got the same error:

[('bs3000k.cat', 280.60341, -7.09118, 9480, 0.2057, 0.14)]
Traceback (most recent call last):
  File /Users/marquett/workspace/Distort/src/StatsSep.py, line 40, in module
StatsAll = np.array(np.asarray(Stats), dtype=('a15, f8, f8, i4, f8, f8'))
ValueError: could not convert string to float: bs3000k.cat

The code is

Stats = [(CatBase, round(stats.mean(Data.Ra), 5), round(stats.mean(Data.Dec), 
5), len(Sep), round(stats.mean(Sep),4), round(stats.stdev(Sep),4),)]
print Stats
if First:
StatsAll = np.array(np.asarray(Stats), dtype=('a15, f8, f8, i4, f8, f8'))
First = False
else: 
StatsAll = np.vstack((StatsAll, np.asarray(Stats)))
print len(StatsAll)

I tried various syntaxes, without success.

Cheers
JB


 
 On Aug 30, 2011, at 10:46 AM, Marquette Jean-Baptiste wrote:
 
 Hi all,
 
 I have this piece of code:
 
 Stats = [CatBase, round(stats.mean(Data.Ra), 5), round(stats.mean(Data.Dec), 
 5), len(Sep), round(stats.mean(Sep),4), round(stats.stdev(Sep),4)]
 print Stats
 if First:
  StatsAll = np.array(np.asarray(Stats), dtype=('a11, f8, f8, i4, f8, 
 f8'))
First = False
 else: 
StatsAll = np.vstack((StatsAll, np.asarray(Stats)))
print len(StatsAll)
 
 This yields the error:
 
 ['bs3000k.cat', 280.60341, -7.09118, 9480, 0.2057, 0.14]
 Traceback (most recent call last):
  File /Users/marquett/workspace/Distort/src/StatsSep.py, line 40, in 
 module
StatsAll = np.array(np.asarray(Stats), dtype=('a11, f8, f8, i4, f8, f8'))
 ValueError: could not convert string to float: bs3000k.cat
 
 What's wrong ?
 
 My guess:
 Stats is a list of 5 elements, but you want a list of 1 5-element tuple to 
 match the type. 
 
 Stats = [(CatBase, round(stats.mean(Data.Ra), 5), 
 round(stats.mean(Data.Dec), 5), len(Sep), round(stats.mean(Sep),4), 
 round(stats.stdev(Sep),4),)]
 
 
 
 
 
 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion

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


Re: [Numpy-discussion] A question about dtype syntax

2011-08-31 Thread Jean-Baptiste Marquette

Hi Pierre,

Bingo ! That works. I finally coded like:

Stats = [(CatBase, round(stats.mean(Data.Ra), 5), 
round(stats.mean(Data.Dec), 5), len(Sep), round(stats.mean(Sep),4), 
round(stats.stdev(Sep),4),)]
StatArray = np.array(Stats, dtype=([('Catalog', 'a15'), ('RaMean', 
'f8'), ('DecMean', 'f8'), ('NStars', 'i4'), ('RMS', 'f8'), ('StdDev', 'f8')]))
print StatArray
if First:
StatsAll = StatArray
First = False
else: 
StatsAll = np.vstack((StatsAll, StatArray))


My next problem deals with the writing of data to a file. I use the command:

np.savetxt(Table, StatsAll, delimiter=' ', fmt=['%15s %.5f %.5f %5d %.4f %.4f'])

which yields:

Traceback (most recent call last):
  File /Users/marquett/workspace/Distort/src/StatsSep.py, line 44, in module
np.savetxt(Table, StatsAll, delimiter=' ', fmt=['%15s %.5f %.5f %5d %.4f 
%.4f'])
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/numpy/lib/npyio.py,
 line 979, in savetxt
fh.write(asbytes(format % tuple(row) + newline))
TypeError: not enough arguments for format string

I struggled with various unsuccessful fmt syntaxes, and the numpy doc is very 
discrete about that topic:

fmt : string or sequence of strings
A single format (%10.5f), a sequence of formats

But I don't find this valid sequence nor an example...

Cheers
JB


 
 On Aug 31, 2011, at 12:20 PM, Jean-Baptiste Marquette wrote:
 
 
 Hi Pierre,
 
 Thanks for the guess. Unfortunately, I got the same error:
 
 [('bs3000k.cat', 280.60341, -7.09118, 9480, 0.2057, 0.14)]
 Traceback (most recent call last):
  File /Users/marquett/workspace/Distort/src/StatsSep.py, line 40, in 
 module
StatsAll = np.array(np.asarray(Stats), dtype=('a15, f8, f8, i4, f8, f8'))
 ValueError: could not convert string to float: bs3000k.cat
 
 Of course, silly me
 
 Your line 40 is actually
   StatsAll = np.array(np.asarray(Stats), dtype=('a15, f8, f8, i4, f8, f8'))
 
 With np.asarray(Stats), you're trying to load Stats as an array using a dtype 
 of float by default. Of course, np.asarray is choking on the first element.
 
 So, try to use instead
   StatsAll = np.array(Stats, dtype=('a15, f8, f8, i4, f8, f8'))
 
 
 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion

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


Re: [Numpy-discussion] A question about dtype syntax

2011-08-31 Thread Jean-Baptiste Marquette

Hi Pierre,

 
 On Aug 31, 2011, at 3:40 PM, Jean-Baptiste Marquette wrote:
 Traceback (most recent call last):
  File /Users/marquett/workspace/Distort/src/StatsSep.py, line 44, in 
 module
np.savetxt(Table, StatsAll, delimiter=' ', fmt=['%15s %.5f %.5f %5d %.4f 
 %.4f'])
  File 
 /Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/numpy/lib/npyio.py,
  line 979, in savetxt
fh.write(asbytes(format % tuple(row) + newline))
 TypeError: not enough arguments for format string
 
 Without knowing StatsAll, it ain't easy… From the exception message, we could 
 expect that one of rows is empty or as less than the 6 elements required by 
 your format string.
 If you're using IPython, switch to debugger mode (pdb), then inspect row and 
 format to find out the content of the offending line.

Here is a (short) sample of StatsAll:

[[('bs3000k.cat', 280.60341, -7.09118, 9480, 0.2057, 0.14)]
 [('bs3000l.cat', 280.61389, -7.24097, 11490, 0.1923, 0.0747)]
 [('bs3000m.cat', 280.77074, -7.08237, 13989, 0.2289, 0.1009)]
 [('bs3000n.cat', 280.77228, -7.23563, 15811, 0.1767, 0.1327)]
 [('bs3001k.cat', 280.95383, -7.10004, 7402, 0.2539, 0.0777)]
 [('bs3001l.cat', 280.95495, -7.23409, 13840, 0.1463, 0.1008)]
 [('bs3001m.cat', 281.1172, -7.08094, 9608, 0.2311, 0.1458)]
 [('bs3001n.cat', 281.12447, -7.23398, 14030, 0.2538, 0.1022)]
 [('bs3002k.cat', 280.62533, -7.47818, 593, 0.0291, 0.0237)]
 [('bs3002l.cat', 280.61508, -7.60359, 9122, 0.0518, 0.0205)]
 [('bs3002m.cat', 280.77209, -7.46262, 1510, 0.0415, 0.0302)]
 [('bs3002n.cat', 280.77578, -7.60117, 14177, 0.0807, 0.0327)]
 [('bs3003k.cat', 280.96463, -7.42967, 13506, 0.0305, 0.0225)]
 [('bs3003l.cat', 280.95638, -7.58462, 17903, 0.0458, 0.0298)]
 [('bs3003m.cat', 281.12729, -7.42516, 15676, 0.0879, 0.0446)]
 [('bs3003n.cat', 281.1354, -7.58497, 16015, 0.0685, 0.0376)]
 [('bs3004k.cat', 280.61148, -7.78976, 14794, 0.079, 0.0473)]
 [('bs3004l.cat', 280.61791, -7.94186, 15455, 0.0818, 0.0727)]
 [('bs3004m.cat', 280.78388, -7.78834, 14986, 0.0966, 0.0313)]
 [('bs3004n.cat', 280.78261, -7.93932, 18713, 0.0925, 0.0472)]
 [('bs3005k.cat', 280.9659, -7.78816, 14906, 0.0456, 0.022)]
 [('bs3005l.cat', 280.96811, -7.93894, 19744, 0.021, 0.0218)]
 [('bs3005m.cat', 281.1344, -7.78035, 15943, 0.0687, 0.0203)]
 [('bs3005n.cat', 281.13915, -7.93027, 18183, 0.1173, 0.0695)]
 [('bs3006k.cat', 280.61294, -8.14201, 13309, 0.143, 0.065)]
 [('bs3006l.cat', 280.65109, -8.29416, 405, 0.258, 0.1147)]
 [('bs3006m.cat', 280.78767, -8.13916, 14527, 0.1106, 0.0568)]
 [('bs3006n.cat', 280.80935, -8.28823, 818, 0.2382, 0.0764)]
 [('bs3007k.cat', 280.96614, -8.1401, 13251, 0.0946, 0.0415)]
 [('bs3007l.cat', 280.97158, -8.23797, 5807, 0.1758, 0.0636)]
 [('bs3007m.cat', 281.14129, -8.13799, 13886, 0.1524, 0.0517)]
 [('bs3007n.cat', 281.15309, -8.2476, 214, 0.1584, 0.0648)]]

 
 I struggled with various unsuccessful fmt syntaxes, and the numpy doc is 
 very discrete about that topic:
 
 fmt : string or sequence of strings
 
A single format (%10.5f), a sequence of formats
 
 Looks clear enough to me… But yes, a comment in the code shows that`fmt` 
 can be a string with multiple insertion points or a list of formats.  E.g. 
 '%10.5f\t%10d' or ('%10.5f', '$10d') (so we should probably update the doc 
 to this regard)

The command with parentheses:

np.savetxt(Table, StatsAll, delimiter=' ', fmt=('%15s %.5f %.5f %5d 
%.4f %.4f'))

fails as well, but with a different error:

Traceback (most recent call last):
  File /Users/marquett/workspace/Distort/src/StatsSep.py, line 44, in module
np.savetxt(Table, StatsAll, delimiter=' ', fmt=('%15s %.5f %.5f %5d %.4f 
%.4f'))
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/numpy/lib/npyio.py,
 line 974, in savetxt
% fmt)
AttributeError: fmt has wrong number of % formats.  %15s %.5f %.5f %5d %.4f %.4f

Plus, this one:

np.savetxt(Table, StatsAll, delimiter=' ', fmt=('%15s', '%.5f', '%.5f', 
'%5d', '%.4f', '%.4f'))

yields:

Traceback (most recent call last):
  File /Users/marquett/workspace/Distort/src/StatsSep.py, line 44, in module
np.savetxt(Table, StatsAll, delimiter=' ', fmt=('%15s', '%.5f', '%.5f', 
'%5d', '%.4f', '%.4f'))
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/numpy/lib/npyio.py,
 line 966, in savetxt
raise AttributeError('fmt has wrong shape.  %s' % str(fmt))
AttributeError: fmt has wrong shape.  ('%15s', '%.5f', '%.5f', '%5d', '%.4f', 
'%.4f')

Quite puzzling...
Should I switch to the I/O of asciitable package ?
Anyway, thanks again for your help.
JB

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