<?xml version="1.0"?>
<rss version="2.0">

<channel>
	<title>Planet SciPy</title>
	<link>http://planet.scipy.org/</link>
	<language>en</language>
	<description>Planet SciPy - http://planet.scipy.org/</description>

<item>
	<title>Matthieu Brucher: Book review: Beautiful Testing: Leading Professionals Reveal How They Improve Software</title>
	<guid>http://matt.eifelle.com/?p=1352</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/_5-BvPKbmFc/</link>
	<description>&lt;p&gt;Testing is one of the basis to create robust and correct code. O&amp;#8217;Reilly has published in its &amp;#8220;Beautiful&amp;#8221; series a lot of books on different parts of the development process. This is the testing part.&lt;br /&gt; &lt;span id=&quot;more-1352&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4&gt;Content and opinions&lt;/h4&gt;&lt;p&gt;According to this book, testing has three aspects: testers, process and tools.&lt;/p&gt;&lt;p&gt;Perhaps the biggest issue in testing is getting motivated testers. The first part of the book has only three chapters. I guess there is no silver bullet for getting a beautiful team of testers, it&amp;#8217;s mainly about people getting along.&lt;/p&gt;&lt;p&gt;The second part is the one that got the most attention in the book. In retrospective, thanks to this book, I&amp;#8217;ve discovered many aspects of testing are never addressed , and I thought that some code couldn&amp;#8217;t even be tested. I was obviously very wrong. For instance, testing mathematical code can be done, a chapter gives a pretty good direction to follow. Several chapters address fuzzing and thus an aspect of testing that is mainly done after discovering a flaw (whereas fuzzing may give a shot at fixing the bug before it is discovered), or also software testing over a network. In fact the broad scope of projects that participated in this part gives me hope and shame at the same time (because there are many things I didn&amp;#8217;t test for, didn&amp;#8217;t anticipate, &amp;#8230;).&lt;/p&gt;&lt;p&gt;The last part handles tools that are used during testing. It&amp;#8217;s not about the usual xUnit, but more about some of the once-upon-a-time small tools that morphed into one of the pillars of testing in its project, or Open Source tools (valgrind, &amp;#8230;) or even others.&lt;/p&gt;&lt;h4&gt;Conclusion&lt;/h4&gt;&lt;p&gt;A very broad scope of projects, of people and of workflow are depicted inside this book. If there are many beautiful processes out there, there are not so many ways of getting beautiful people inside test teams. Also, it seems that many beautiful tools were mainly small project tools that were written for a simple crude purpose and that were progressively refactored into something more powerful.&lt;/p&gt;&lt;p&gt;I especially liked some chapters in the process part, for instance the statistical one. It&amp;#8217;s something very difficult to test, and although the chapter doesn&amp;#8217;t solve the ultimate issue of statistics, it helps creating something that looks like real random tests.&lt;/p&gt;&lt;p&gt;Also, I won&amp;#8217;t see Q&amp;#038;A the same way now.&lt;/p&gt;&lt;div&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://r.popshops.com/r/ZWc2UDRXY2J5UE5xSkVkNmVGeDVFY0Y3WVdhOEJldjhBL3B0UVhjK0trZz0K&quot;&gt;&lt;img src=&quot;http://images.barnesandnoble.com/images/49590000/49591814.JPG&quot; border=&quot;0&quot; alt=&quot;Beautiful Testing: Leading Professionals Reveal How They Improve Software&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://r.popshops.com/r/ZWc2UDRXY2J5UE5xSkVkNmVGeDVFY0Y3WVdhOEJldjhBL3B0UVhjK0trZz0K&quot;&gt;Beautiful Testing: Leading Professionals Reveal How They Improve Software&lt;/a&gt;&lt;br /&gt; Price: $44.99&lt;br /&gt; This unique book offers essays from 25 leading software testers that illustrate the qualities and techniques necessary to make software testing an art in itself. The latest entry in O&amp;#8217;Reilly&amp;#8217;s successful series that includes &amp;#8220;Beautiful Code&amp;#8221; (9780596510046) and &amp;#8220;Beautiful Teams&amp;#8221; (9780596518028), this book demonstrates through personal stories and many examples the simplicity, maintainability, flexibility, and efficiency required to test every aspect of a software project.&lt;/div&gt;&lt;div class=&quot;subcolumns&quot;&gt;&lt;div&gt;&lt;div&gt; &lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/0596159811/masbl03-20&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://ecx.images-amazon.com/images/I/61X2oBf7OFL._SL75_.jpg&quot; width=&quot;57&quot; height=&quot;75&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/0596159811/masbl03-20&quot; target=&quot;_blank&quot;&gt;Beautiful Testing: Leading Professionals Reveal How They Improve Software (Theory in Practice)&lt;/a&gt; (Paperback)&lt;br /&gt; &lt;span&gt;by &lt;strong&gt;Tim Riley, Adam Goucher&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; ISBN: 0596159811&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Price:&lt;/strong&gt; &lt;span&gt;USD 43.76&lt;/span&gt;&lt;br /&gt; &lt;strong&gt;39 used &amp;#038; new&lt;/strong&gt; available from &lt;span&gt;USD 33.34&lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;img src=&quot;http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/stars-5.gif&quot; class=&quot;asa_rating_stars&quot; /&gt; | 5 | 5&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/z9xv_z3dDCvUZFCKs4yF6641mUw/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/z9xv_z3dDCvUZFCKs4yF6641mUw/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/z9xv_z3dDCvUZFCKs4yF6641mUw/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/z9xv_z3dDCvUZFCKs4yF6641mUw/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/_5-BvPKbmFc&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 31 Aug 2010 07:33:21 +0000</pubDate>
</item>
<item>
	<title>David Cournapeau: cournape</title>
	<guid>http://cournape.wordpress.com/?p=245</guid>
	<link>http://cournape.wordpress.com/2010/08/30/fixing-error-1396-hy000-operation-create-user-failed/</link>
	<description>&lt;p&gt;I got bitten by this several times already, here is what usually works if this error happens for user foo&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;delete from mysql.user where user=foo;&lt;/li&gt;
&lt;li&gt;delete from mysql.db where user=foo&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/cournape.wordpress.com/245/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/cournape.wordpress.com/245/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/cournape.wordpress.com/245/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/cournape.wordpress.com/245/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/cournape.wordpress.com/245/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/cournape.wordpress.com/245/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/cournape.wordpress.com/245/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/cournape.wordpress.com/245/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/cournape.wordpress.com/245/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/cournape.wordpress.com/245/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/cournape.wordpress.com/245/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/cournape.wordpress.com/245/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/cournape.wordpress.com/245/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/cournape.wordpress.com/245/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=cournape.wordpress.com&amp;amp;blog=2210763&amp;amp;post=245&amp;amp;subd=cournape&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Mon, 30 Aug 2010 08:54:21 +0000</pubDate>
</item>
<item>
	<title>Enthought: A Renewed ReStructuredText Editor!</title>
	<guid>http://blog.enthought.com/?p=1013</guid>
	<link>http://blog.enthought.com/enthought-tool-suite/a-renewed-restructured-text-editor/</link>
	<description>Remember the ReStructuredText editor? Well I just spent my Google Summer of Code adding a bunch of new features to it: A new toolbar with nice icons from the Tango icon library to give quick access to old and new features alike. Buttons to apply inline markup for *emphasis*, **strong emphasis** and &amp;#8220;inline literal&amp;#8220; to [...]</description>
	<pubDate>Fri, 27 Aug 2010 19:25:08 +0000</pubDate>
</item>
<item>
	<title>Fwrap blog: freemalloc</title>
	<guid>http://fortrancython.wordpress.com/?p=82</guid>
	<link>http://fortrancython.wordpress.com/2010/08/25/fwrap-has-moved-to-github/</link>
	<description>&lt;h2&gt;From mercurial to git&lt;/h2&gt;
&lt;p&gt;After speaking with some folks at SciPy-Austin this year (in particular, Fernando Perez), I wanted to try out git &amp;amp; github as an alternative to mercurial &amp;amp; bitbucket.  As with anything with so much overlap, there are pros and there are cons, and it comes down to small differences.  The deciding factor, ultimately, was the &lt;a href=&quot;http://hg-git.github.com/&quot;&gt;hg-git mercurial plugin&lt;/a&gt;, which allows someone to use a mercurial client with a git repository,&lt;em&gt; with improved branch functionality&lt;/em&gt;.  So all of the nice, smooth, user-friendly mercurial commands you&amp;#8217;re used to are available, and you can push/pull bookmarks a-la git branches.  (I&amp;#8217;ve not used this extensively, so &lt;em&gt;caveat emptor&lt;/em&gt;.)&lt;/p&gt;
&lt;p&gt;Some of my reasons for the move:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As mentioned above, the hg-git plugin allows both mercurial and git users to collaborate using the same repository, so there is no need for current mercurial users to have to change to git.&lt;/li&gt;
&lt;li&gt;The numpy/scipy ecosystem is converging on git &amp;amp; github for SCM.  Arguably Cython (which uses mercurial) would be more influential here, but pretty much every fwrap user would be coming from a numerical &amp;amp; Fortran background, which would be more numpy/scipy-centric, hence git &amp;amp; github.&lt;/li&gt;
&lt;li&gt;The way Git handles branches fits my style much better.  And I really like the index.  Mercurial seems to encourage enabling the &amp;#8216;queue&amp;#8217; extension for advanced stuff, but it just plain doesn&amp;#8217;t fit my brain, and I always screw it up.  Granted, it&amp;#8217;s plenty easy to blow off your hand using git, although I&amp;#8217;ve become quite proficient at messing up whatever SCM I&amp;#8217;m using at the time.&lt;/li&gt;
&lt;li&gt;It seems that mercurial goes to great lengths to keep their design pure, which I can respect.  Unfortunately by not allowing bookmarks to be pushed/pulled as part of the wire protocol, they force you to use mercurial branches, which are much heavier than I need them to be.  If mercurial would just allow bookmarks (which are the closest analogue to git branches) to be pushed-pulled, I&amp;#8217;d have a much harder time justifying the switch to git.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Github repository&lt;/h2&gt;
&lt;p&gt;Fwrap&amp;#8217;s new home:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://github.com/kwmsmith/fwrap&quot;&gt;http://github.com/kwmsmith/fwrap&lt;/a&gt;&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/fortrancython.wordpress.com/82/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/fortrancython.wordpress.com/82/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/fortrancython.wordpress.com/82/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/fortrancython.wordpress.com/82/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/fortrancython.wordpress.com/82/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/fortrancython.wordpress.com/82/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/fortrancython.wordpress.com/82/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/fortrancython.wordpress.com/82/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/fortrancython.wordpress.com/82/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/fortrancython.wordpress.com/82/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/fortrancython.wordpress.com/82/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/fortrancython.wordpress.com/82/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/fortrancython.wordpress.com/82/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/fortrancython.wordpress.com/82/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=fortrancython.wordpress.com&amp;amp;blog=7448735&amp;amp;post=82&amp;amp;subd=fortrancython&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Wed, 25 Aug 2010 15:17:12 +0000</pubDate>
</item>
<item>
	<title>Ga&amp;#235;l Varoquaux: SVG Word map of countries</title>
	<guid>http://gael-varoquaux.info/blog/?p=138</guid>
	<link>http://gael-varoquaux.info/blog/?p=138</link>
	<description>&lt;p&gt;
To be able to visualize some quantities attached to countries all over the world, I needed a image with various countries color-coded. The fantastic &lt;a href=&quot;http://matplotlib.sourceforge.net/basemap/doc/html/&quot;&gt;matplotlib basemap package&lt;/a&gt; was not an option as I really needed a static image.
&lt;/p&gt;
&lt;p&gt;
So I generated an SVG image with all the countries. It was generating by tracing a bitmap, so it has a lot of imperfections, but being an SVG with each (major) country as a different object, it can be used to create a colored-code world map. I am uploading it here under a public-domain license. Enjoy!
&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://gael-varoquaux.info/blog/wp-content/uploads/2010/countries.svg&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://gael-varoquaux.info/blog/wp-content/uploads/2010/countries.png&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Tue, 24 Aug 2010 09:55:47 +0000</pubDate>
</item>
<item>
	<title>Fabian Pedregosa: Support for sparse matrices in scikits.learn</title>
	<guid>http://fseoane.net/blog/2010/support-for-sparse-matrices-in-scikitslearn/</guid>
	<link>http://fseoane.net/blog/2010/support-for-sparse-matrices-in-scikitslearn/</link>
	<description>&lt;p&gt;I recently added support for sparse matrices (as defined in&lt;br /&gt;
scipy.sparse) in some classifiers of &lt;a href=&quot;http://scikit-learn.sf.net&quot;&gt;scikits.learn&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;In those classes, the fit method will perform the algorithm without&lt;br /&gt;
converting to a dense representation and will also store parameters in&lt;br /&gt;
an efficient format.&lt;/p&gt;
&lt;p&gt;Right now, the only classese that implements this is SVC and LinearSVC&lt;br /&gt;
in scikits.learn.sparse, although the plan is to add more classes in&lt;br /&gt;
the future. These are capable of taking sparse matrices in the fit()&lt;br /&gt;
method and will also store support vectors as sparse matrices.&lt;/p&gt;
&lt;p&gt;Here is an example. We first create a toy dataset and import relevant&lt;br /&gt;
modules:&lt;/p&gt;
&lt;div class=&quot;codesnip-container&quot;&gt;
&lt;div class=&quot;python codesnip&quot;&gt;In &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;1&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: &lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; scipy.&lt;span class=&quot;me1&quot;&gt;sparse&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: &lt;span class=&quot;kw1&quot;&gt;from&lt;/span&gt; scikits.&lt;span class=&quot;me1&quot;&gt;learn&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;sparse&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; svm&lt;/p&gt;
&lt;p&gt;In &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: X, Y = scipy.&lt;span class=&quot;me1&quot;&gt;sparse&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;csr_matrix&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: clf = svm.&lt;span class=&quot;me1&quot;&gt;SVC&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;kernel=&lt;span class=&quot;st0&quot;&gt;&amp;#8216;linear&amp;#8217;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;now we will fit the model and query some of its parameters:&lt;/p&gt;
&lt;div class=&quot;codesnip-container&quot;&gt;
&lt;div class=&quot;python codesnip&quot;&gt;In &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: clf.&lt;span class=&quot;me1&quot;&gt;fit&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;X, Y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
Out&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: &lt;br /&gt;
SVC&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;kernel=&lt;span class=&quot;st0&quot;&gt;&amp;#8216;linear&amp;#8217;&lt;/span&gt;, C=1.0, probability=0, shrinking=1, eps=0.001,&lt;br /&gt;
&amp;nbsp; cache_size=100.0,&lt;br /&gt;
&amp;nbsp; coef0=0.0,&lt;br /&gt;
&amp;nbsp; gamma=0.0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;
In &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;6&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: clf.&lt;span class=&quot;me1&quot;&gt;support_&lt;/span&gt;&lt;br /&gt;
Out&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;6&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: &lt;br /&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;2&amp;#215;2 sparse matrix of &lt;span class=&quot;kw2&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;#8216;&amp;lt;type &amp;#8216;&lt;/span&gt;numpy.&lt;span class=&quot;me1&quot;&gt;float64&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;#8216;&amp;gt;&amp;#8217;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;with&lt;/span&gt; 1 stored elements &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; Compressed Sparse Row format&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;7&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: clf.&lt;span class=&quot;me1&quot;&gt;coef_&lt;/span&gt;&lt;br /&gt;
Out&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;7&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;: &lt;br /&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;1&amp;#215;2 sparse matrix of &lt;span class=&quot;kw2&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;#8216;&amp;lt;type &amp;#8216;&lt;/span&gt;numpy.&lt;span class=&quot;me1&quot;&gt;float64&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;#8216;&amp;gt;&amp;#8217;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;with&lt;/span&gt; 1 stored elements &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; Compressed Sparse Row format&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;For a more complete example, you can look at &lt;a href=&quot;http://scikit-learn.sourceforge.net/auto_examples/mlcomp_sparse_document_classification.html&quot;&gt;Classification&lt;br /&gt;
of text documents using sparse features, contributed by Olivier Grisel.&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 23 Aug 2010 15:47:38 +0000</pubDate>
</item>
<item>
	<title>William Stein: *-Overflow</title>
	<guid>tag:blogger.com,1999:blog-6365588202025292315.post-3732870939068738602</guid>
	<link>http://sagemath.blogspot.com/2010/08/overflow.html</link>
	<description>I spent some time obsessively browsing &lt;a href=&quot;http://mathoverflow.net/&quot;&gt;http://mathoverflow.net&lt;/a&gt; during the last few days (and posting too), and it is a really awesome site.&amp;nbsp; I found out about it last December, when I visited Berkeley to give a talk, and had lunch with one of the guys that runs the site, but didn't pay much attention to it until recently.&amp;nbsp; It's much more suitable for discussion of &lt;i&gt;research-level mathematics&lt;/i&gt; than general use and development of Sage.      &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://mathoverflow.net/&quot;&gt;Mathoverflow&lt;/a&gt; is interesting in that their comment system supports jsmath with realtime preview, which is something the TinyMCE editor in &lt;a href=&quot;http://sagenb.org/&quot;&gt;the Sage notebook &lt;/a&gt;doesn't do.   It's also something that &lt;a href=&quot;http://stackoverflow.com/&quot;&gt;http://stackoverflow.com&lt;/a&gt; doesn't do, as far as I can tell.    The&amp;nbsp; grad students at Berkeley that organize &lt;a href=&quot;http://mathoverflow.net/&quot;&gt;mathoverflow&lt;/a&gt; probably somehow hacked jsmath into the comment system. &lt;br /&gt;&lt;br /&gt;I was very surprised to learn that Mathoverflow and Stackoverflow (and all the dozens and dozens of stackoverflow-based sites) are closed source.   There is &lt;a href=&quot;http://stackexchange.com/&quot;&gt;a company&lt;/a&gt; that runs stackoverflow and hosts related sites, and keeping their code closed is &lt;a href=&quot;http://meta.stackoverflow.com/questions/14656/the-stackoverflow-source-code&quot;&gt;part of their business model&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;Some people sort of forked something related to stackexchange at some point, and created this:   &lt;a href=&quot;http://wiki.github.com/cnprog/CNPROG/&quot;&gt;CNPROG&lt;/a&gt;, which is fortunately based on Python.&amp;nbsp; There are about&lt;a href=&quot;http://wiki.github.com/cnprog/CNPROG/who-are-using-cnprog&quot;&gt; 20 sites&lt;/a&gt; using CNPROG now, including one for &lt;a href=&quot;http://advice.mechanicalkern.com/&quot;&gt;all questions about the use of Python in science, mathematics, and engineering&lt;/a&gt;.&lt;br /&gt;I tried this site, answering a question about &lt;a href=&quot;http://cython.org/&quot;&gt;Cython&lt;/a&gt;, and it is snappy and clean. &lt;br /&gt;&lt;br /&gt;Perhaps I will add &lt;a href=&quot;http://www.math.union.edu/%7Edpvc/jsMath/&quot;&gt;jsmath&lt;/a&gt; or &lt;a href=&quot;http://www.mathjax.org/&quot;&gt;mathjax&lt;/a&gt; support to cnprog and start another site (http://q.sagemath.org ?), say on using math software as an aid to mathematical research.  The site would not be specific to Sage or restricted to open source.   The FAQ would say that all questions must be of the form: &quot;(How) can I use a computer to compute XYZ, where XYZ should be some sort of advanced mathematical question.&quot;    The emphasis on &quot;advanced&quot; and &quot;research&quot; is that there are already &lt;a href=&quot;http://math.stackexchange.com/&quot;&gt;other sites&lt;/a&gt; about how to do elementary stuff (=people's homework), and it will provide an excuse to keep that out, which will greatly raise the quality.&amp;nbsp;&amp;nbsp; It is, after all, exactly this uncompromising focus on research that makes &lt;a href=&quot;http://mathoverflow.net/&quot;&gt;http://mathoverflow.net&lt;/a&gt; so interesting.&lt;br /&gt;&lt;br /&gt;EDIT: I've now created &lt;a href=&quot;http://ask.sagemath.org/&quot;&gt;http://ask.sagemath.org&lt;/a&gt; which is based on&lt;a href=&quot;http://askbot.org/&quot;&gt; http://askbot.org&lt;/a&gt;, which is in turn based on CNPROG.&amp;nbsp;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/6365588202025292315-3732870939068738602?l=sagemath.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Wed, 18 Aug 2010 16:29:27 +0000</pubDate>
	<author>wstein@gmail.com (William Stein)</author>
</item>
<item>
	<title>Fabian Pedregosa: Flags to debug python C extensions.</title>
	<guid>http://fseoane.net/blog/2010/flags-to-debug-python-c-extensions/</guid>
	<link>http://fseoane.net/blog/2010/flags-to-debug-python-c-extensions/</link>
	<description>&lt;p&gt;I often find myself debugging python C extensions from gdb, but usually some variables are hidden because aggressive optimizations that distutils sets by default. What I did not know, is that you can prevent those optimizations by passing flags -O0 -fno-inline to gcc in keyword extra_compile_args (note: this will only work in GCC). A complete example would look like:&lt;/p&gt;
&lt;div class=&quot;codesnip-container&quot;&gt;
&lt;div class=&quot;python codesnip&quot;&gt;config.&lt;span class=&quot;me1&quot;&gt;add_extension&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;#8216;foo&amp;#8217;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sources=&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;#8216;a.c&amp;#8217;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;co1&quot;&gt;# add this for gdb debug&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;extra_compile_args=&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;#8216;-O0 -fno-inline&amp;#8217;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;and your extension becomes much easier to debug from gdb.&lt;/p&gt;</description>
	<pubDate>Wed, 18 Aug 2010 11:40:51 +0000</pubDate>
</item>
<item>
	<title>Ga&amp;#235;l Varoquaux: Git…</title>
	<guid>http://gael-varoquaux.info/blog/?p=137</guid>
	<link>http://gael-varoquaux.info/blog/?p=137</link>
	<description>&lt;p&gt;No point me launching in a rant against Git, it&amp;#8217;s the future anyhow&amp;#8230; but it&amp;#8217;s the only DVCS that I know with which I routinely loose work, and it is called a feature (I lost work a few times with bzr, but these were bugs)!&lt;/p&gt;</description>
	<pubDate>Tue, 17 Aug 2010 22:08:26 +0000</pubDate>
</item>
<item>
	<title>Fwrap blog: freemalloc</title>
	<guid>http://fortrancython.wordpress.com/?p=80</guid>
	<link>http://fortrancython.wordpress.com/2010/08/17/fwrap-wiki-roadmap/</link>
	<description>&lt;p&gt;FYI, fwrap has a wiki that is slowly filling-in.  There are (or will be) tutorials that guide you through getting everything set-up correctly, FAQs, etc.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://sourceforge.net/apps/trac/fwrap/wiki/WikiStart&quot;&gt;https://sourceforge.net/apps/trac/fwrap/wiki/WikiStart&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Specifically, I just posted a rough roadmap on the fwrap wiki, outlining what fortran features are currently supported and what will be supported in upcoming versions:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://sourceforge.net/apps/trac/fwrap/wiki/FortranSupport&quot;&gt;https://sourceforge.net/apps/trac/fwrap/wiki/FortranSupport&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I commend it to your attention.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/fortrancython.wordpress.com/80/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/fortrancython.wordpress.com/80/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/fortrancython.wordpress.com/80/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/fortrancython.wordpress.com/80/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/fortrancython.wordpress.com/80/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/fortrancython.wordpress.com/80/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/fortrancython.wordpress.com/80/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/fortrancython.wordpress.com/80/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/fortrancython.wordpress.com/80/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/fortrancython.wordpress.com/80/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/fortrancython.wordpress.com/80/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/fortrancython.wordpress.com/80/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/fortrancython.wordpress.com/80/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/fortrancython.wordpress.com/80/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=fortrancython.wordpress.com&amp;amp;blog=7448735&amp;amp;post=80&amp;amp;subd=fortrancython&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 17 Aug 2010 18:10:58 +0000</pubDate>
</item>
<item>
	<title>Matthieu Brucher: Optimization scikit: separation of orthogonally convoluted signals</title>
	<guid>http://matt.eifelle.com/?p=1331</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/f3tNbLr586A/</link>
	<description>&lt;p&gt;&lt;a href=&quot;http://matt.eifelle.com/2010/07/27/genetic-algorithms-in-python/&quot;&gt;My last blog post on optimization&lt;/a&gt; helped me generate orthogonal sequences. Now, I will use those sequences to separate two signals. The basic use case is a linear system with two inputs, one output, and instead of recording the response of one input at a time, one plays both inputs simultaneously with specific sequences so that they can be separated in another process.&lt;br /&gt; &lt;span id=&quot;more-1331&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4&gt;A separation cost function&lt;/h4&gt;&lt;p&gt;In fact the process is really easy. Each input will be convoluted with one sequence generated by last time&amp;#8217;s genetic algorithm. Both sequences are not orthogonal, so the resulting separated signal will have a signal to noise ratio (SNR) probably around the orthogonality amount of the sequences.&lt;/p&gt;&lt;p&gt;The cost function will be the squared error between the recorded signal and the sum of the convolutions of the estimated signals with their associated combs plus a fraction of the sum of the absolute values of the signals. This additional terms can be seen as regularisation, but also the whole function can be interpreted as the likelihood of an error following a Gaussian law and the input signals following Laplacian laws. The function is thus written this way:&lt;/p&gt;&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot; title=&quot;WP-CodeBox HowTo?&quot;&gt;&lt;span&gt;?&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;left2&quot;&gt;Download &lt;a href=&quot;http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=1331&amp;amp;download=source_separation.py&quot;&gt;source_separation.py&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;codebox_clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p13313&quot;&gt;&lt;td class=&quot;code&quot; id=&quot;p1331code3&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;class&lt;/span&gt; Function&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;object&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
  &lt;span&gt;def&lt;/span&gt; &lt;span&gt;__init__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, &lt;span&gt;signal&lt;/span&gt;, combs&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;signal&lt;/span&gt; = &lt;span&gt;signal&lt;/span&gt;
    &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;combs&lt;/span&gt; = combs
    &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;mu&lt;/span&gt; = &lt;span&gt;20000&lt;/span&gt;
&amp;nbsp;
  &lt;span&gt;def&lt;/span&gt; create_estimation&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, x&lt;span&gt;&amp;#41;&lt;/span&gt;:
    length = &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#41;&lt;/span&gt; / &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;.&lt;span&gt;combs&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;return&lt;/span&gt; numpy.&lt;span&gt;convolve&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#91;&lt;/span&gt;:length&lt;span&gt;&amp;#93;&lt;/span&gt;, &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;combs&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;:length&lt;span&gt;&amp;#93;&lt;/span&gt; + numpy.&lt;span&gt;convolve&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#91;&lt;/span&gt;length:&lt;span&gt;&amp;#93;&lt;/span&gt;, &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;combs&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;:length&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
  &lt;span&gt;def&lt;/span&gt; &lt;span&gt;__call__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, x&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;return&lt;/span&gt; numpy.&lt;span&gt;sum&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;.&lt;span&gt;signal&lt;/span&gt; - &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;create_estimation&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;**&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; + numpy.&lt;span&gt;sum&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;numpy.&lt;span&gt;abs&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; / &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;mu&lt;/span&gt;
&amp;nbsp;
  &lt;span&gt;def&lt;/span&gt; gradient&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, x&lt;span&gt;&amp;#41;&lt;/span&gt;:
    error = &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;signal&lt;/span&gt; - &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;create_estimation&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#41;&lt;/span&gt;
    grad = numpy.&lt;span&gt;zeros&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    length = &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#41;&lt;/span&gt; / &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;.&lt;span&gt;combs&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    grad&lt;span&gt;&amp;#91;&lt;/span&gt;:length&lt;span&gt;&amp;#93;&lt;/span&gt; = - &lt;span&gt;2&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; numpy.&lt;span&gt;convolve&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;.&lt;span&gt;combs&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, error&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;:length&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
    grad&lt;span&gt;&amp;#91;&lt;/span&gt;length:&lt;span&gt;&amp;#93;&lt;/span&gt; = - &lt;span&gt;2&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; numpy.&lt;span&gt;convolve&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;.&lt;span&gt;combs&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;, error&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;:length&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;::-&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
    &lt;span&gt;return&lt;/span&gt; grad + numpy.&lt;span&gt;sign&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;x&lt;span&gt;&amp;#41;&lt;/span&gt; / &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;mu&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;Besides the cost, this class also returns the correct analytical gradient (it is not easy to derive, but it is in fact a simple cross correlation between the error each estimated input signal).&lt;/p&gt;&lt;h4&gt;Application&lt;/h4&gt;&lt;p&gt;Now that this is in place, an optimizer can be designed:&lt;/p&gt;&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot; title=&quot;WP-CodeBox HowTo?&quot;&gt;&lt;span&gt;?&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;left2&quot;&gt;Download &lt;a href=&quot;http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=1331&amp;amp;download=source_separation.py&quot;&gt;source_separation.py&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;codebox_clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p13314&quot;&gt;&lt;td class=&quot;code&quot; id=&quot;p1331code4&quot;&gt;&lt;pre class=&quot;python&quot;&gt;  &lt;span&gt;from&lt;/span&gt; scikits.&lt;span&gt;optimization&lt;/span&gt; &lt;span&gt;import&lt;/span&gt; &lt;span&gt;*&lt;/span&gt;
&amp;nbsp;
  fun = Function&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;signal&lt;/span&gt;, combs&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
  mystep = step.&lt;span&gt;FRPRPConjugateGradientStep&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  mylinesearch = line_search.&lt;span&gt;WolfePowellRule&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  mycriterion = criterion.&lt;span&gt;criterion&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;ftol = &lt;span&gt;0.0001&lt;/span&gt;, iterations_max = &lt;span&gt;500&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  myoptimizer = optimizer.&lt;span&gt;StandardOptimizer&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;function = fun,
                                            step = mystep,
                                            line_search = mylinesearch,
                                            criterion = mycriterion,
                                            x0 = numpy.&lt;span&gt;zeros&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;signal&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
  xf = myoptimizer.&lt;span&gt;optimize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;To separate both signals correctly, the optimizer will consists of a Polak-Ribière-Polyak conjugate gradient with a Fletcher-Reeves variant (it always finds the best conjugate factor and has an auto-restart behavior), a Wolfe-Powell line search and the stop criterion will stop the optimization after 500 iterations or if the relative cost doesn&amp;#8217;t vary more than 0.0001.&lt;/p&gt;&lt;p&gt;Now, I&amp;#8217;ve convoluted two signals (drawn for a Laplacian distribution) with two combs (10 impulses each). I&amp;#8217;ve added a small amount of white noise. In the end, with combs not entirely orthogonal and white noise, the SNR may not be lower than 10dB, but with the additional hypothesis on the distribution of the input signals, it might just be enough. The optimization looks like this:&lt;/p&gt;&lt;p&gt;&lt;center&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;As you can see, the crude strating estimate is efficiently corrected but the estimation degrades a the end of the signals. In the end, we have a little more than 10dB, but with other signals, the SNR is lower than 10 dB.&lt;/p&gt;&lt;h4&gt;Conclusion&lt;/h4&gt;&lt;p&gt;With a more complex comb, better SNR would be achieved, but at the cost of longer output signals. It means that sometimes, it&amp;#8217;s better to record each input separately. Of course, if you need very long input sequences, you can use longer orthogonal sequences. You can also combine more than two signals!&lt;/p&gt;&lt;p&gt;As usual, the code may be found on &lt;a href=&quot;http://bazaar.launchpad.net/~matthieu-brucher/%2Bjunk/optimization-tutorials/files/head%3A/tut5/&quot;&gt;Launchpad&lt;/a&gt;.&lt;/p&gt;&lt;form action=&quot;https://www.paypal.com/cgi-bin/webscr&quot; method=&quot;post&quot;&gt; &lt;input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;_xclick&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;business&quot; value=&quot;matthieu.brucher@gmail.com&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;item_name&quot; value=&quot;Buy Me a Coffee!&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;currency_code&quot; value=&quot;USD&quot; /&gt;&lt;span&gt;&lt;strong&gt; Buy Me a Coffee!&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;select id=&quot;amount&quot; name=&quot;amount&quot; class=&quot;&quot;&gt;&lt;option value=&quot;3&quot;&gt;Capuccino - 3$&lt;/option&gt;&lt;option value=&quot;6&quot;&gt;Frappuccino - 6$&lt;/option&gt;&lt;option value=&quot;10&quot;&gt;Hot Chocolate - 10$&lt;/option&gt;&lt;option value=&quot;20&quot;&gt;Expensive Coffee - 20$&lt;/option&gt;&lt;option value=&quot;50&quot;&gt;Alien Coffee - 50$&lt;/option&gt;&lt;/select&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Other Amount:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;amount&quot; size=&quot;10&quot; title=&quot;Other donate&quot; value=&quot;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt; Your Email Address :&lt;/strong&gt;&lt;input type=&quot;hidden&quot; name=&quot;on0&quot; value=&quot;Reference&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;os0&quot; maxlength=&quot;60&quot; /&gt; &lt;br /&gt;&lt;br /&gt; &lt;input type=&quot;hidden&quot; name=&quot;no_shipping&quot; value=&quot;2&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;no_note&quot; value=&quot;1&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;mrb&quot; value=&quot;3FWGC6LFTMTUG&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;bn&quot; value=&quot;IC_Sample&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;return&quot; value=&quot;http://matt.eifelle.com&quot; /&gt;&lt;input type=&quot;image&quot; src=&quot;https://www.paypal.com/en_US/i/btn/x-click-but11.gif&quot; name=&quot;submit&quot; alt=&quot;Make payments with payPal - it's fast, free and secure!&quot; /&gt;&lt;/form&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/S8eIKfrJoyRuJXWpyKD8awm67P4/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/S8eIKfrJoyRuJXWpyKD8awm67P4/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/S8eIKfrJoyRuJXWpyKD8awm67P4/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/S8eIKfrJoyRuJXWpyKD8awm67P4/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/f3tNbLr586A&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 10 Aug 2010 07:18:26 +0000</pubDate>
</item>
<item>
	<title>Fwrap blog: freemalloc</title>
	<guid>http://fortrancython.wordpress.com/?p=77</guid>
	<link>http://fortrancython.wordpress.com/2010/08/08/fwrap-vis-a-vis-f2py/</link>
	<description>&lt;p&gt;Some have asked how fwrap relates to f2py.&lt;/p&gt;
&lt;p&gt;Broadly, fwrap can be seen as an update of f2py for all of Fortran 90/95, addressing the features that f2py does not support at the present time.  My understanding is that the 3rd version of f2py intends to address many of these features, but that version of f2py is far from complete.  This is not intedended as a critique of f2py, merely a brief comparison of the two projects.&lt;/p&gt;
&lt;p&gt;Fwrap focuses on generating Cython wrappers for Fortran code, and the Python-level wrappers come for free, in a sense.  Fwrap uses the Fortran parser&amp;#8211;named &amp;#8216;fparser&amp;#8217;&amp;#8211;that Pearu Peterson (the author of f2py) created for the latest incarnation of f2py.  In contrast to Fwrap using Cython, f2py generates the C extension module directly&amp;#8211;quite an undertaking.  Fwrap focuses on all 3 levels of wrapping: C, Cython and Python; and the C wrappers can be used without any Cython or Python dependency.&lt;/p&gt;
&lt;p&gt;Fwrap generates one more wrapping layer than f2py; this allows fwrap to eventually support every desirable feature in Fortran 90/95 (and, in principle, 2003).&lt;/p&gt;
&lt;p&gt;F2PY has a very nice interface file functionality, and supports comment directives in the fortran source to specify how it is to handle different arguments.  These features are planned for fwrap, but currently it is easier to make &amp;#8216;pythonic&amp;#8217; wrappers with f2py, while fwrap just wraps every argument directly, taking into account the argument&amp;#8217;s intent.&lt;/p&gt;
&lt;p&gt;Fwrap has planned some features that are not in f2py: for instance, a fortan inline module that is similar to scipy&amp;#8217;s weave, user derived types, automatic type discovery, and (way in the future) wrapping a Fortran module in a Cython class.&lt;/p&gt;
&lt;p&gt;Pearu and I are on good terms and we both collaborate to make fparser better along with the other fparser &amp;amp; f2py developers.  F2PY is an impressive project and provides the skeleton for many Python &amp;amp; Fortran projects, most prominently among them being SciPy.&lt;/p&gt;
&lt;p&gt;Fwrap would not exist if f2py had not blazed the trail, and paved over half of it &lt;img src=&quot;http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; /&gt; &lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/fortrancython.wordpress.com/77/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/fortrancython.wordpress.com/77/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/fortrancython.wordpress.com/77/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/fortrancython.wordpress.com/77/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/fortrancython.wordpress.com/77/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/fortrancython.wordpress.com/77/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/fortrancython.wordpress.com/77/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/fortrancython.wordpress.com/77/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/fortrancython.wordpress.com/77/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/fortrancython.wordpress.com/77/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/fortrancython.wordpress.com/77/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/fortrancython.wordpress.com/77/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/fortrancython.wordpress.com/77/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/fortrancython.wordpress.com/77/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=fortrancython.wordpress.com&amp;amp;blog=7448735&amp;amp;post=77&amp;amp;subd=fortrancython&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Sun, 08 Aug 2010 19:42:19 +0000</pubDate>
</item>
<item>
	<title>Fwrap blog: freemalloc</title>
	<guid>http://fortrancython.wordpress.com/?p=73</guid>
	<link>http://fortrancython.wordpress.com/2010/08/07/announcing-the-first-release-of-fwrap/</link>
	<description>&lt;h2&gt;Fwrap v0.1.0&lt;/h2&gt;
&lt;p&gt;I am pleased to announce the first release of Fwrap v0.1.0, a utility for&lt;br /&gt;
wrapping Fortran code in C, Cython and Python.  Fwrap focuses on supporting the&lt;br /&gt;
features of Fortran 90/95, but will work with most well-behaved Fortran 77&lt;br /&gt;
code, too.&lt;/p&gt;
&lt;p&gt;Fwrap is BSD licensed.&lt;/p&gt;
&lt;p&gt;Fwrap is beta-level software; all public APIs and commandline options are&lt;br /&gt;
subject to change.&lt;/p&gt;
&lt;p&gt;Features in the v0.1.0 release:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; Fortran source parsing and automatic wrapper generation;&lt;/li&gt;
&lt;li&gt; Top-level (non-module) Fortran subroutines and functions;&lt;/li&gt;
&lt;li&gt; Supports all intrinsic types (integer, real, complex, logical &amp;amp;&lt;br /&gt;
character);&lt;/li&gt;
&lt;li&gt; Default and non-default intrinsic types properly wrapped;&lt;/li&gt;
&lt;li&gt; Scalar and array arguments supported;&lt;/li&gt;
&lt;li&gt; Supports assumed-shape, assumed-size, and explicit-shape array arguments;&lt;/li&gt;
&lt;li&gt; Intent &amp;#8216;in&amp;#8217;, &amp;#8216;inout&amp;#8217;, &amp;#8216;out&amp;#8217; and no intent arguments supported;&lt;/li&gt;
&lt;li&gt; Automatic docstring generation for extension module and functions;&lt;/li&gt;
&lt;li&gt; Wrappers are portable w.r.t. both Fortran and C compilers.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Upcoming features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; &amp;#8220;Use&amp;#8221; statement support;&lt;/li&gt;
&lt;li&gt; Python &amp;amp; Cython callback support;&lt;/li&gt;
&lt;li&gt; Kind-parameters in type specification;&lt;/li&gt;
&lt;li&gt; Module-level data and parameters;&lt;/li&gt;
&lt;li&gt; User-derived types.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See the README and documentation for requirements, compiler support, etc.&lt;/p&gt;
&lt;h4&gt;Download&lt;/h4&gt;
&lt;p&gt;You can get fwrap from pypi or from its sourceforge download page:&lt;/p&gt;
&lt;p&gt;https://sourceforge.net/projects/fwrap/files/&lt;/p&gt;
&lt;h4&gt;More Info&lt;/h4&gt;
&lt;p&gt;Project homepage, including links to wiki &amp;amp; bug tracker:&lt;/p&gt;
&lt;p&gt;http://fwrap.sourceforge.net/&lt;/p&gt;
&lt;p&gt;Mailing list:&lt;/p&gt;
&lt;p&gt;http://groups.google.com/group/fwrap-users&lt;/p&gt;
&lt;p&gt;Development blog:&lt;/p&gt;
&lt;p&gt;http://fortrancython.wordpress.com/&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/fortrancython.wordpress.com/73/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/fortrancython.wordpress.com/73/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/fortrancython.wordpress.com/73/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/fortrancython.wordpress.com/73/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/fortrancython.wordpress.com/73/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/fortrancython.wordpress.com/73/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/fortrancython.wordpress.com/73/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/fortrancython.wordpress.com/73/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/fortrancython.wordpress.com/73/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/fortrancython.wordpress.com/73/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/fortrancython.wordpress.com/73/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/fortrancython.wordpress.com/73/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/fortrancython.wordpress.com/73/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/fortrancython.wordpress.com/73/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=fortrancython.wordpress.com&amp;amp;blog=7448735&amp;amp;post=73&amp;amp;subd=fortrancython&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Sun, 08 Aug 2010 00:59:29 +0000</pubDate>
</item>
<item>
	<title>Ond&amp;#345;ej &amp;#268;ert&amp;iacute;k: Week Aug 2 - 6</title>
	<guid>tag:blogger.com,1999:blog-6568744196982634289.post-2896505029722157566</guid>
	<link>http://ondrejcertik.blogspot.com/2010/08/week-aug-2-6.html</link>
	<description>This week I essentially only worked on my LLNL poster, which I finally finished about two hours ago. I have created a web page for it:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://certik.github.com/ccms-10-poster/&quot;&gt;http://certik.github.com/ccms-10-poster/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;where you can download pdf, sources, I also put there some relevant info and links.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It turned out to be a lot more work than I expected (well, as usual), but we were very thorough with John and in the process I discovered several bugs in my program, so I am glad we did it. I used to generate all the plots by hand, by manually adjusting all the parameters in the Python script (like atomic number, mesh parameters, element orders, adaptivity parameters, error tolerance and so on). Essentially I had to remember all these parameters for each of the plots (about 10 of them). Then I settled to have a Python dictionary, that holds all the parameters, and then I just pass them to a radial_schroedinger_equation_adapt(params, error_tol=1e-8) function.&lt;br /&gt;&lt;br /&gt;Here are example of the parameters:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    params_hydrogen_p_L = dict(l=0, Z=1, a=0, b=100, el_num=4, el_order=1,&lt;br /&gt;            eig_num=3, mesh_uniform=False, mesh_par1=20, adapt_type=&quot;p&quot;,&lt;br /&gt;            eqn_type=&quot;R&quot;)&lt;br /&gt;    params_hydrogen_p_U = dict(l=0, Z=1, a=0, b=100, el_num=4, el_order=2,&lt;br /&gt;            eig_num=3, mesh_uniform=True, adapt_type=&quot;p&quot;, eqn_type=&quot;R&quot;)&lt;br /&gt;    params_hydrogen_hp_U = dict(l=0, Z=1, a=0, b=100, el_num=4, el_order=2,&lt;br /&gt;            eig_num=3, mesh_uniform=True, adapt_type=&quot;hp&quot;, eqn_type=&quot;R&quot;)&lt;br /&gt;    params_hydrogen_h_U = dict(l=0, Z=1, a=0, b=100, el_num=4, el_order=6,&lt;br /&gt;            eig_num=3, mesh_uniform=True, adapt_type=&quot;romanowski&quot;,&lt;br /&gt;            eqn_type=&quot;rR&quot;)&lt;br /&gt;&lt;br /&gt;    params_silver_p_L = dict(l=0, Z=47, a=0, b=150, el_num=4, el_order=13,&lt;br /&gt;            eig_num=50, mesh_uniform=False, mesh_par1=35, adapt_type=&quot;p&quot;,&lt;br /&gt;            eqn_type=&quot;R&quot;)&lt;br /&gt;    params_silver_hp_L = dict(l=0, Z=47, a=0, b=150, el_num=4, el_order=13,&lt;br /&gt;            eig_num=50, mesh_uniform=False, mesh_par1=35, adapt_type=&quot;hp&quot;,&lt;br /&gt;            eqn_type=&quot;R&quot;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I mean, this is kind of obvious if you think about it, but for some reason I didn't do that at all at the beginning, because I thought --- I'll just run this once and I am done with it. But I had to run it like 20x, e.g. regenerating he plots, then creating a table about meshes, then redoing the table after changing the error tolerance, and so on.&lt;br /&gt;&lt;br /&gt;Besides that I also got permission to release my code, so I'll go over it in the coming days and generate nice patches against Hermes1D.&lt;br /&gt;&lt;br /&gt;Also in the process of creating the poster, I played a lot with p-FEM, uniform-p-FEM, hp-FEM and h-FEM and I will keep playing with that. It's clear to me now, that our current Hermes1D is not optimal. Especially the convergence of hp-FEM and p-FEM (as it is implemented right now) greatly depends on the initial mesh.&lt;br /&gt;&lt;br /&gt;Nevertheless, even with the above limitations, hp-FEM seems to be really good if you don't a-priori know anything about the problem/mesh. One should not make any deep conclusions in 1D (it might be a bit different in 2D and 3D, and also I only did couple test problems), but from my experience so far, hp-FEM is a really good choice, if you just want to solve the problem and get a decent convergence (way better than h-FEM, and in general about the same as uniform-p-FEM with optimized mesh).&lt;br /&gt;&lt;br /&gt;Another conclusion is that uniform-p-FEM (also called spectral element method), if you optimize the mesh for the problem, is very fast. All you have to do is increase the polynomial order and it goes very straight on the convergence graphs, it's very hard to beat. Also, and that I would like to write in the coming days, the algorithm for optimizing the mesh is really simple: just solve it with high &quot;p&quot;, then play with the mesh parameters (for logarithmic mesh, there are only 2 parameters --- number of elements, and a ratio of first vs. last element), so that the eigenvalues (that one is interested in) are converged (with given accuracy) and optimize it wrt DOFs. The algorithm can also &quot;look&quot; at the convergence graphs and make sure it's steep enough. For atomic problems, my experience shows that the logarithmic mesh is good enough (as long as you optimize it). The advantage is that you do this once, and then (for close enough potentials in the Schroedinger equation), you just increase &quot;p&quot;, and it's very robust and fast (no need for reference mesh, or trial refinements and so on).&lt;br /&gt;&lt;br /&gt;When I get back to Reno, we'll do more research on hp-FEM with Pavel and I think this is not the last word to say. We need to review how we choose the candidates for eigenvectors, especially &quot;p&quot; vs &quot;hp&quot; and make it more robust. We'll see.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/6568744196982634289-2896505029722157566?l=ondrejcertik.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Fri, 06 Aug 2010 19:27:19 +0000</pubDate>
	<author>noreply@blogger.com (Ondřej Čertík)</author>
</item>
<item>
	<title>Fwrap blog: freemalloc</title>
	<guid>http://fortrancython.wordpress.com/?p=69</guid>
	<link>http://fortrancython.wordpress.com/2010/08/05/fortran-cuda/</link>
	<description>&lt;p&gt;PGI has some &lt;em&gt;very&lt;/em&gt; nice CUDA support in the latest version of their fortran compiler.  &lt;a href=&quot;http://www.pgroup.com/lit/articles/insider/v1n3a2.htm&quot;&gt;Here&amp;#8217;s the article.&lt;/a&gt; [www.pgroup.com]  This may be old news to some of you, but I&amp;#8217;m impressed.  Hopefully CUDA support is in the pipeline for the other fortran vendors as well, and something of a standard can emerge from this.&lt;/p&gt;
&lt;p&gt;My first impression is that this is an ideal sweet spot, allowing the usage of nice high-level fortran array expressions on the host when convenient, and dropping into CUDA code where speed is a must.  Granted the host-device bandwith is painfully slow, so there is a significant overhead, but ideally it would allow incremental speedups, all within fortran.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m glad to see Fortran adapting to the latest technology, as it has done every generation or so; brings to mind the quip:&lt;/p&gt;
&lt;p&gt;&amp;#8220;What language will they be using 30 years from now?&amp;#8221;&lt;/p&gt;
&lt;p&gt;&amp;#8220;I don&amp;#8217;t know, but they&amp;#8217;ll &lt;em&gt;call&lt;/em&gt; it &amp;#8216;Fortran&amp;#8217;.&amp;#8221;&lt;/p&gt;
&lt;p&gt;And yet the standard is still backwards compatible with code from almost 35 years ago.  AFAICT, it&amp;#8217;s the combination of adaptibility and backwards compatibility that keeps Fortran around.&lt;/p&gt;
&lt;p&gt;Now if they would only get better I/O syntax, named goto labels (not &amp;#8216;assign 10 to n&amp;#8217;, more like C&amp;#8217;s goto), etc&amp;#8230;&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/fortrancython.wordpress.com/69/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/fortrancython.wordpress.com/69/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/fortrancython.wordpress.com/69/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/fortrancython.wordpress.com/69/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/fortrancython.wordpress.com/69/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/fortrancython.wordpress.com/69/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/fortrancython.wordpress.com/69/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/fortrancython.wordpress.com/69/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/fortrancython.wordpress.com/69/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/fortrancython.wordpress.com/69/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/fortrancython.wordpress.com/69/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/fortrancython.wordpress.com/69/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/fortrancython.wordpress.com/69/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/fortrancython.wordpress.com/69/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=fortrancython.wordpress.com&amp;amp;blog=7448735&amp;amp;post=69&amp;amp;subd=fortrancython&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Thu, 05 Aug 2010 22:24:56 +0000</pubDate>
</item>
<item>
	<title>Matthieu Brucher: Book review: Masterminds of Programming</title>
	<guid>http://matt.eifelle.com/?p=1322</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/RZOQcpMfrVQ/</link>
	<description>&lt;p&gt;When twenty or so langage creators are put together to make a book, it can only be interesting. It&amp;#8217;s a good revealer of character, as they tend to open their heart. In fact I think that&amp;#8217;s exactly what happened in this book.&lt;br /&gt; &lt;span id=&quot;more-1322&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4&gt;Content and opinions&lt;/h4&gt;&lt;p&gt;I won&amp;#8217;t make the list of the chosen langages. They are taken from the successful ones, in terms of quality as well as fame, which means that some are less known than others. Each chapter is very different, and, as I&amp;#8217;ve said, very revealing.&lt;/p&gt;&lt;p&gt;Depending on the interviewed, the addressed topics are different. For some authors, you get questions and answers very close to their langages. For others, you have some feedback on how they see the programming field and its future evolution. Some will tell you how much their langage is great and that is a shame it is not more used or that it could replace almost everything. Other will tell you that they fill their langage slipped through their hands.&lt;/p&gt;&lt;p&gt;There is no single line of code, it&amp;#8217;s really a thoughts book, and this is the point of the book: you don&amp;#8217;t get advice on how you will write code or design your application. You get inner reasons for some langages and their success. You get leads for the future of your program, how langages may evolve and on what you may focus your attention. Unfortunately, the chapter I almost liked the most is the last one (on Eiffel). It&amp;#8217;s funny that in this precise chapter, Bertrand Meyer talks about the treasures he found in the last chapter of &lt;u&gt;Structured Programming&lt;/u&gt; (Dijkstra &lt;em&gt;et al&lt;/em&gt;).&lt;/p&gt;&lt;h4&gt;Conclusion&lt;/h4&gt;&lt;p&gt;From a cultural point of view, this book is a gold mine. For an ego point of view, this book is a revealer. All things considered, a lot of things can be learnt by reading this book on the philosophical approach of some langages.&lt;/p&gt;&lt;div&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://r.popshops.com/r/Rk1EZVF4UXFrNi9UditqWGZBbXcyZ1M5ZXpoNFJSYjdRZHlDd2c2VHJDST0K&quot;&gt;&lt;img src=&quot;http://images.barnesandnoble.com/images/40870000/40871068.JPG&quot; border=&quot;0&quot; alt=&quot;Masterminds of Programming: Conversations with the Creators of Major Programming Languages (Theory in Practice (O'Reilly) Series)&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://r.popshops.com/r/Rk1EZVF4UXFrNi9UditqWGZBbXcyZ1M5ZXpoNFJSYjdRZHlDd2c2VHJDST0K&quot;&gt;Masterminds of Programming: Conversations with the Creators of Major Programming Languages (Theory in Practice (O&amp;#8217;Reilly) Series)&lt;/a&gt;&lt;br /&gt; Price: $34.19&lt;/div&gt;&lt;div class=&quot;subcolumns&quot;&gt;&lt;div&gt;&lt;div&gt; &lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/0596515170/masbl03-20&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://ecx.images-amazon.com/images/I/51lQmSOdOlL._SL75_.jpg&quot; width=&quot;57&quot; height=&quot;75&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/0596515170/masbl03-20&quot; target=&quot;_blank&quot;&gt;Masterminds of Programming: Conversations with the Creators of Major Programming Languages (Theory in Practice (O&amp;#8217;Reilly))&lt;/a&gt; (Paperback)&lt;br /&gt; &lt;span&gt;by &lt;strong&gt;Federico Biancuzzi, Chromatic&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; ISBN: 0596515170&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Price:&lt;/strong&gt; &lt;span&gt;USD 26.39&lt;/span&gt;&lt;br /&gt; &lt;strong&gt;53 used &amp;#038; new&lt;/strong&gt; available from &lt;span&gt;USD 4.96&lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;img src=&quot;http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/stars-4.gif&quot; class=&quot;asa_rating_stars&quot; /&gt; | 4 | 11&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/Ek8ZcPwWlZ0turBWNshqn-IW6EQ/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/Ek8ZcPwWlZ0turBWNshqn-IW6EQ/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/Ek8ZcPwWlZ0turBWNshqn-IW6EQ/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/Ek8ZcPwWlZ0turBWNshqn-IW6EQ/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/RZOQcpMfrVQ&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 03 Aug 2010 07:13:15 +0000</pubDate>
</item>
<item>
	<title>Ga&amp;#235;l Varoquaux: Software design for maintainability</title>
	<guid>http://gael-varoquaux.info/blog/?p=136</guid>
	<link>http://gael-varoquaux.info/blog/?p=136</link>
	<description>&lt;p&gt;I have just spent the best part of my Sunday fixing a bug that turned out being a &lt;a href=&quot;https://svn.enthought.com/enthought/changeset/25699/&quot;&gt;seemingly-trivial two-liner&lt;/a&gt;. Such unpleasant experiences are all too frequent, and weight a lot on my view of code design.&lt;/p&gt;
&lt;h2&gt;My stance on code design&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;http://www.techpin.com/wp-content/uploads/2010/01/cool-car-drawing-5.jpg&quot; alt=&quot;&quot; width=&quot;240&quot; align=&quot;right&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I call &lt;em&gt;code design&lt;/em&gt; the process of designing the architecture of a piece of software: what are the objects it uses? how do they interact? how is the information passed around?&amp;#8230;&lt;/p&gt;
&lt;p&gt;My view of code design and software engineering has progressively evolved to favor &lt;strong&gt;extreme simplicity&lt;/strong&gt; over sophistication. I believe that a good programmer should know &lt;a href=&quot;http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29&quot;&gt;design patterns&lt;/a&gt;, &lt;a href=&quot;http://gael-varoquaux.info/computers/python_advanced/index.html&quot;&gt;powerful language features&lt;/a&gt;, &lt;a href=&quot;http://scipy2010.blogspot.com/2010/06/tutorials-day-1-advanced-numpy.html&quot;&gt;libraries dark corners&lt;/a&gt;, and &lt;em&gt;not use them unless absolutely necessary&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;Some rules of thumb&lt;/h2&gt;
&lt;p&gt;Here are some rules that I apply nowadays when writing code that I would like to last (I am aware that some of them go against well-advertised best practices).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Keep it as simple a possible, really!&lt;/strong&gt; Experimental results have shown that the tractability of a code base goes  down as the square of the number of interactions, and thus much quicker than the number of lines in a project. Each time you add a line, think about it: can you make simpler? If not you&amp;#8217;ll have to find resources to maintain your project as fixing bugs or adding features will grow harder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Design for the 80% usecases.&lt;/strong&gt; In the same vein, a small decrease in the requirements can make your project much simpler &lt;a href=&quot;http://ieeexplore.ieee.org/Xplore/login.jsp?url=http%3A%2F%2Fieeexplore.ieee.org%2Fiel5%2F32%2F35909%2F01702600.pdf%3Farnumber%3D1702600&amp;amp;authDecision=-203&quot;&gt;[Woodfield1979]&lt;/a&gt;. Corner cases and minor usecases should not make the whole project complex and hard to maintain. If you can, give up on what is bringing in complexity. If you cannot, isolate it, and don&amp;#8217;t let it sit at the core of your design.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Don&amp;#8217;t design for the future.&lt;/strong&gt; Again the same core idea: don&amp;#8217;t start planing for all the usecases, and all the difficulties that you haven&amp;#8217;t encountered, you will most certainly design wrong, and chances are that you&amp;#8217;ll add complexity that you do not use. Design simple, design cleanly and refactor as you go, based on concrete problems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Don&amp;#8217;t be clever.&lt;/strong&gt; Each time you do a clever trick, whoever has to read and maintain this code will have to understand it (that person may be you, in a few years). Chances are that they&amp;#8217;ll get it wrong and start by loosing a lot of time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Repeating yourself may actually be OK.&lt;/strong&gt; This is a case of &lt;em&gt;practicality beats purity&lt;/em&gt;. Repeating code is really a bad thing in software design, because it leads to an increased number of lines to debug, and tends to hinder reusability. However, adding complexity in order to save a few lines of duplicated code will cost you more in the long run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use objects sparingly.&lt;/strong&gt; Object are great, but are they always need? An object with a single method &lt;em&gt;eval&lt;/em&gt; can probably simply be implemented by a function. The limitation of objects is that they all have a different behavior. As a result, the users and maintainers of your codebase will first have to understand how all your classes interact before understanding your code. This also means that there is a lot of benefit in making many different classes that have the same interface.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avoid abstractions and levels of indirection.&lt;/strong&gt; The more levels of code piled on top one of the other, the more layers your maintainer is going to have to inspect to find were the bug might be. An abstraction hides another object or algorithm. To debug code, chances are that all the black boxes will first have to be opened.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Coding for others to debug&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;http://inhabitat.com/files/2010/01/auto-graveyard-1.jpg&quot; alt=&quot;&quot; width=&quot;400&quot; align=&quot;right&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&amp;#8220;Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.&amp;#8221;   -  Brian W. Kernighan&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;You may think that I am overemphasizing simplicity at the cost of functionality. Well, think about the future of your code. The net is full of unmaintained and abandoned code. If you want your project to grow and have a future, you will probably need people to help you. For a given purpose, the easiest the code is to read and debug, the more chances you will have to pick momentum.&lt;/p&gt;
&lt;hr /&gt;Some external references I like (about software engineering, rather than debugging):
&lt;ul&gt;
&lt;li&gt;Titus Brown:  &lt;a href=&quot;http://ivory.idyll.org/blog/sep-07/not-sucking-v2&quot;&gt; Writing (Python) Code that Doesn&amp;#8217;t Suck&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Peter Norvig: &lt;a href=&quot;http://norvig.com/21-days.html&quot;&gt; Teach yourself programming in 10 years&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Paul Stachour and David Collier-Brown: &lt;a href=&quot;http://cacm.acm.org/magazines/2009/11/48444-you-dont-know-jack-about-software-maintenance/fulltext&quot;&gt;You Don&amp;#8217;t Know Jack About Software Maintenance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Greg Wilson: &lt;a href=&quot;http://software-carpentry.org/&quot;&gt;Software carpentry: a course in software engineering&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
	<pubDate>Sun, 01 Aug 2010 22:47:19 +0000</pubDate>
</item>
<item>
	<title>Fwrap blog: freemalloc</title>
	<guid>http://fortrancython.wordpress.com/?p=61</guid>
	<link>http://fortrancython.wordpress.com/2010/07/31/features-everywhere-and-a-basic-example/</link>
	<description>&lt;p&gt;In the past 2 weeks, we&amp;#8217;ve been able to put in some major front-facing features &amp;#8212; features that make fwrapped python modules friendly (or, at least, friendlier) and discoverable.&lt;/p&gt;
&lt;p&gt;The most significant features for users are module- and function-level docstrings, but there are many more features you&amp;#8217;ll like.&lt;/p&gt;
&lt;p&gt;For this trivial fortran function:&lt;/p&gt;
&lt;pre class=&quot;brush: plain; wrap-lines: false;&quot;&gt;
function one_arg(a)
    implicit none
    ! Automatic type discovery: the C type correspondances
    ! will be automatically determined at compile-time.
    integer :: one_arg
    ! Assumed-shape arrays handled seamlessly
    real(kind=8), dimension(:, : ), intent(inout) :: a

    a = 1.61803399_8
    ! bonus if you know 1.618... without googling
    one_arg = 42

end function
&lt;/pre&gt;
&lt;p&gt;Fwrapping it:&lt;/p&gt;
&lt;pre class=&quot;brush: bash; wrap-lines: false;&quot;&gt;
$ fwrapc source.f90 --build \
--name=one_arg --fcompiler=gnu95 \
--f90exec=/usr/bin/gfortran-4.3 \
-L/usr/lib/gcc/x86_64-linux-gnu/4.3.2 -lgfortran
&lt;/pre&gt;
&lt;p&gt;(Admittedly the commandline can get kinda long, but the &lt;code&gt;-L, -l&lt;/code&gt; and &lt;code&gt;--f90exec&lt;/code&gt; options can be set to environment options &lt;code&gt;$LDFLAGS&lt;/code&gt; and &lt;code&gt;$F90&lt;/code&gt;, resp.  The &lt;code&gt;fwrapc&lt;/code&gt; command needs to know where to find the fortran compiler and how to link in the fortran runtime libraries.)&lt;/p&gt;
&lt;p&gt;This will generate a million files in &lt;code&gt;./one_arg&lt;/code&gt;, including an extension module, &lt;code&gt;./one_arg/one_arg.so&lt;/code&gt;.  All those other files are useful if and when you want to use the wrappers from C or Cython.  For now we&amp;#8217;ll look at using the code from Python. Importing that extension module, we see some interesting stuff:&lt;/p&gt;
&lt;pre class=&quot;brush: plain; wrap-lines: false;&quot;&gt;
$ cd one_arg
$ ipython
Python 2.5.2 (r252:60911, Jan 24 2010, 17:44:40)
Type &amp;quot;copyright&amp;quot;, &amp;quot;credits&amp;quot; or &amp;quot;license&amp;quot; for more information.

IPython 0.10 -- An enhanced Interactive Python.
?         -&amp;gt; Introduction and overview of IPython's features.
%quickref -&amp;gt; Quick reference.
help      -&amp;gt; Python's own help system.
object?   -&amp;gt; Details about 'object'. ?object also works, ?? prints more.

In [1]: import one_arg

In [2]: one_arg?
Type:		module
Base Class:	&amp;lt;type 'module'&amp;gt;
String Form:	&amp;lt;module 'one_arg' from 'one_arg.so'&amp;gt;
Namespace:	Interactive
File:		/home/ksmith/Devel/fwrap/fwrap-dev/testdir/one_arg/one_arg.so
Docstring:
    The one_arg module was generated with Fwrap v0.1.0dev_a0bf087f24a0+.

    Below is a listing of functions and data types.
    For usage information see the function docstrings.

    Functions
    ---------
    one_arg(...)

    Data Types
    ----------
    fw_character
    fwi_integer
    fwi_npy_intp
    fwr_real_8

In [3]:
&lt;/pre&gt;
&lt;p&gt;You&amp;#8217;ll notice a list of functions and data types in the &lt;code&gt;one_arg&lt;/code&gt; module.  The datatypes &lt;code&gt;fwr_real_8&lt;/code&gt; and &lt;code&gt;fwi_integer&lt;/code&gt; correspond to the function argument and return value types, resp. (automatic type-discovery, like I mentioned).&lt;/p&gt;
&lt;p&gt;We can take a look at the &lt;code&gt;one_arg.one_arg()&lt;/code&gt; docstring:&lt;/p&gt;
&lt;pre class=&quot;brush: plain; wrap-lines: false;&quot;&gt;
In [3]: one_arg.one_arg?
Type:		builtin_function_or_method
Base Class:	&amp;lt;type 'builtin_function_or_method'&amp;gt;
String Form:	&amp;lt;built-in function one_arg&amp;gt;
Namespace:	Interactive
Docstring:
    one_arg(a) -&amp;gt; (fw_ret_arg, a,)

    Parameters
    ----------
    a : fwr_real_8, 2D array, dimension(:, : ), intent inout

    Returns
    -------
    fw_ret_arg : fwi_integer, intent out
    a : fwr_real_8, 2D array, dimension(:, : ), intent inout

In [4]:
&lt;/pre&gt;
&lt;p&gt;It tells us the function signature, the argument types and the return tuples.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s kick the tires:&lt;/p&gt;
&lt;pre class=&quot;brush: plain; wrap-lines: false;&quot;&gt;
In [4]: one_arg.one_arg([[1,2,3], [4,5,6]])
Out[4]:
(42,
 array([[ 1.61803399,  1.61803399,  1.61803399],
       [ 1.61803399,  1.61803399,  1.61803399]]))
&lt;/pre&gt;
&lt;p&gt;And we find that the fortran function return value is the first element of the return tuple, and the array is the second.  In this case, we passed in a python list, and fwrap made an internal copy seeing that it wasn&amp;#8217;t compatible with the type and ordering of the fortran dummy argument.  If we pass in an array of the proper ordering and type, no copy will be made, and it will be modified in-place (there will be options to have finer control over this behavior, including warnings or exceptions raised if you don&amp;#8217;t want any copies made, ever):&lt;/p&gt;
&lt;pre class=&quot;brush: plain; wrap-lines: false;&quot;&gt;
In [5]: import numpy as np

In [6]: a = np.empty((5,5), dtype=one_arg.fwr_real_8, order='F')

In [7]: one_arg.one_arg(a)
Out[7]:
(42,
 array([[ 1.61803399,  1.61803399,  1.61803399,  1.61803399,  1.61803399],
       [ 1.61803399,  1.61803399,  1.61803399,  1.61803399,  1.61803399],
       [ 1.61803399,  1.61803399,  1.61803399,  1.61803399,  1.61803399],
       [ 1.61803399,  1.61803399,  1.61803399,  1.61803399,  1.61803399],
       [ 1.61803399,  1.61803399,  1.61803399,  1.61803399,  1.61803399]]))

In [8]: (ret, a_ret) = one_arg.one_arg(a)

In [9]: a_ret is a
Out[9]: True
&lt;/pre&gt;
&lt;p&gt;So &lt;code&gt;a_ret&lt;/code&gt; and &lt;code&gt;a&lt;/code&gt; are the same python object, no copying took place!&lt;/p&gt;
&lt;p&gt;I hope this was instructive.  A release is coming soon!&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/fortrancython.wordpress.com/61/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/fortrancython.wordpress.com/61/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/fortrancython.wordpress.com/61/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/fortrancython.wordpress.com/61/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/fortrancython.wordpress.com/61/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/fortrancython.wordpress.com/61/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/fortrancython.wordpress.com/61/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/fortrancython.wordpress.com/61/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/fortrancython.wordpress.com/61/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/fortrancython.wordpress.com/61/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/fortrancython.wordpress.com/61/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/fortrancython.wordpress.com/61/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/fortrancython.wordpress.com/61/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/fortrancython.wordpress.com/61/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=fortrancython.wordpress.com&amp;amp;blog=7448735&amp;amp;post=61&amp;amp;subd=fortrancython&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Sat, 31 Jul 2010 19:23:32 +0000</pubDate>
</item>
<item>
	<title>David Cournapeau: cournape</title>
	<guid>http://cournape.wordpress.com/?p=238</guid>
	<link>http://cournape.wordpress.com/2010/08/01/recent-progress-on-bento-build-numpy/</link>
	<description>&lt;p&gt;I have spent the last few days on a relatively big feature for bento: recursive package description. The idea is to be able to simply describe packages in a deeply nested hierarchy without having to write long paths, and to split complicated packages descriptions into several files.&lt;/p&gt;
&lt;p&gt;At the bento.info level, the addition is easy:&lt;/p&gt;
&lt;pre class=&quot;brush: bash;&quot;&gt;
Subento: numpy/core, numpy/lib ...
&lt;/pre&gt;
&lt;p&gt;It took me more time to figure out a way to do it in the hook file. I ended up with a recurse decorator:&lt;/p&gt;
&lt;pre class=&quot;brush: python;&quot;&gt;
@recurse([&amp;quot;numpy/core/bscript&amp;quot;, &amp;quot;numpy/lib/bscript&amp;quot;])
@post_configure
def some_func(ctx):
    ....
&lt;/pre&gt;
&lt;p&gt;I am not sure it is the right solution yet, but it works for now. My first idea was to simply use a recurse function attached to hook contexts (the ctx argument), but I did not find a good way to guarantee an execution order (declaration order == execution order), and it was a bit unintuitive to integrate both hook decorator and the recurse together.&lt;/p&gt;
&lt;p&gt;The reason why I tackle this now is that bento is at a stage where it need to be used on &amp;#8220;real&amp;#8221; builds to get a feeling of what works and what does not. The target is numpy and hopefully later scipy. Although I still hope to integrate waf or scons in bento as the canonical way of building numpy/scipy with bento, this also gives a good test for yaku (my simple build system).&lt;/p&gt;
&lt;p&gt;It took me less than half a day to port the scons scripts to bento/yaku. A full build, unnoptimized build of numpy with clang is less than 10 seconds. A no-op build is ~ 150 ms, but as yaku does not have all the infrastructure for header dependency tracking yet, the number for no-op build is rather meaningless.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/cournape.wordpress.com/238/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/cournape.wordpress.com/238/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/cournape.wordpress.com/238/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/cournape.wordpress.com/238/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/cournape.wordpress.com/238/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/cournape.wordpress.com/238/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/cournape.wordpress.com/238/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/cournape.wordpress.com/238/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/cournape.wordpress.com/238/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/cournape.wordpress.com/238/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/cournape.wordpress.com/238/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/cournape.wordpress.com/238/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/cournape.wordpress.com/238/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/cournape.wordpress.com/238/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=cournape.wordpress.com&amp;amp;blog=2210763&amp;amp;post=238&amp;amp;subd=cournape&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Sat, 31 Jul 2010 18:33:27 +0000</pubDate>
</item>
<item>
	<title>Fabian Pedregosa: July in Paris</title>
	<guid>http://fseoane.net/blog/2010/july-in-paris/</guid>
	<link>http://fseoane.net/blog/2010/july-in-paris/</link>
	<description>&lt;p&gt;One of the best things of spending summer in Paris: its parcs (here, with friends @ Parc Montsouris).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/fseoane/4842146900/&quot; title=&quot;Con Julia en Montsouris por Fabian Pedregosa, en Flickr&quot;&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4103/4842146900_953f961d64.jpg&quot; width=&quot;375&quot; height=&quot;500&quot; alt=&quot;Con Julia en Montsouris&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Thu, 29 Jul 2010 22:11:41 +0000</pubDate>
</item>
<item>
	<title>Matthieu Brucher: Genetic algorithms in Python</title>
	<guid>http://matt.eifelle.com/?p=1308</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/eJl2-tf11bA/</link>
	<description>&lt;p&gt;Although I&amp;#8217;m fond of numerical optimization through gradients, &amp;#8230; there are some times where a global optimization is much more powerfull. For instance, I have to generate two sequences/combs that are orthogonal and for which their autocorrelation is almost an impulse. The two combs have a fixed number of impulse, so it&amp;#8217;s a perfect job for genetic algorithms.&lt;br /&gt; &lt;span id=&quot;more-1308&quot;&gt;&lt;/span&gt;&lt;br /&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Genetic_algorithm&quot;&gt;Genetic algorithms&lt;/a&gt; are a global optimization technique. The parameters are encoded in a genome, and then different populations are grown. The fittest individuals survive and give new individuals. The usual implementation in Python is &lt;a href=&quot;http://pyevolve.sf.net&quot;&gt;PyEvolve&lt;/a&gt;, a pure Python package that isn&amp;#8217;t depended on anything except if you want to save and plot populations.&lt;/p&gt;&lt;h4&gt;Creating a genome and a cost function&lt;/h4&gt;&lt;p&gt;So my goal is to minimize crosscorrelation and autocorrelation, safe for the middle value of autocorrelation. I won&amp;#8217;t use a fixed-size sequence, I will encode in the genome the distance between two impulses. This will allow for a really small genome with a lot of possibilities.&lt;/p&gt;&lt;p&gt;For this purpose, I create a class named &lt;strong&gt;OrthogonalSequences&lt;/strong&gt;:&lt;/p&gt;&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot; title=&quot;WP-CodeBox HowTo?&quot;&gt;&lt;span&gt;?&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;left2&quot;&gt;Download &lt;a href=&quot;http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=1308&amp;amp;download=GA.py&quot;&gt;GA.py&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;codebox_clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p13087&quot;&gt;&lt;td class=&quot;code&quot; id=&quot;p1308code7&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;class&lt;/span&gt; OrthogonalSequences&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;object&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
  &lt;span&gt;def&lt;/span&gt; &lt;span&gt;__init__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, size, number&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;size&lt;/span&gt; = size
    &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;number&lt;/span&gt; = number
    &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;genome_length&lt;/span&gt; = size &lt;span&gt;*&lt;/span&gt; number
&amp;nbsp;
  @&lt;span&gt;staticmethod&lt;/span&gt;
  &lt;span&gt;def&lt;/span&gt; convert_slice_to_time&lt;span&gt;&amp;#40;&lt;/span&gt;chromosome&lt;span&gt;&amp;#41;&lt;/span&gt;:
    &lt;span&gt;&amp;quot;&amp;quot;&amp;quot;&amp;quot;
    Converts a chromosome in a time sequence
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;quot;
    total = numpy.cumsum(chromosome)
    array = numpy.zeros(total[-1]+1)
    array[total] = 1
    array[0] = 1
    return array
&amp;nbsp;
  def evaluate(self, chromosomes):
    &amp;quot;&lt;/span&gt;&lt;span&gt;&amp;quot;&amp;quot;&amp;quot;
    Evaluate the cost (square of error) of the genome by evaluating cross- and autocorrelation.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;quot;
    value = 0
    for i in range(self.number):
      slice_i = self.convert_slice_to_time(chromosomes[i * self.size:(i+1) * self.size])
      value += .1 * len(slice_i)
      for j in range(i, self.number):
        slice_j = self.convert_slice_to_time(chromosomes[j * self.size:(j+1) * self.size])
        correlation = numpy.correlate(slice_i, slice_j, mode = &amp;quot;&lt;/span&gt;full&lt;span&gt;&amp;quot;)
        if (i == j):
          correlation[len(slice_i)-1] -= self.size
&amp;nbsp;
        value += numpy.sum(correlation ** 2)
&amp;nbsp;
    return value&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;In fact this class will only be used to evaluate a genome. As I have two combs (and more if you&amp;#8217;d like), I need to pass this information to the evaluation function, and thus nothing is more easy than Python for this. I&amp;#8217;ve also added a small factor that adds a cost for lengthy combs.&lt;/p&gt;&lt;h4&gt;Setting up the optimizer&lt;/h4&gt;&lt;p&gt;Now, the only thing remaining is to set all objects and launch the optimization:&lt;/p&gt;&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot; title=&quot;WP-CodeBox HowTo?&quot;&gt;&lt;span&gt;?&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;left2&quot;&gt;Download &lt;a href=&quot;http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=1308&amp;amp;download=GA.py&quot;&gt;GA.py&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;codebox_clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p13088&quot;&gt;&lt;td class=&quot;code&quot; id=&quot;p1308code8&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;if&lt;/span&gt; __name__ == &lt;span&gt;&amp;quot;__main__&amp;quot;&lt;/span&gt;:
  &lt;span&gt;from&lt;/span&gt; pyevolve &lt;span&gt;import&lt;/span&gt; G1DList, GSimpleGA, Consts
  &lt;span&gt;import&lt;/span&gt; &lt;span&gt;sys&lt;/span&gt;
&amp;nbsp;
  size = &lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;1&lt;/span&gt; &lt;span&gt;else&lt;/span&gt; &lt;span&gt;10&lt;/span&gt;
  size -= &lt;span&gt;1&lt;/span&gt;
  number = &lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;2&lt;/span&gt; &lt;span&gt;else&lt;/span&gt; &lt;span&gt;2&lt;/span&gt;
  rangemax = &lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;3&lt;/span&gt; &lt;span&gt;else&lt;/span&gt; &lt;span&gt;100&lt;/span&gt;
  generations = &lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;4&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;4&lt;/span&gt; &lt;span&gt;else&lt;/span&gt; &lt;span&gt;50&lt;/span&gt;
  population = &lt;span&gt;int&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;5&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;len&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;sys&lt;/span&gt;.&lt;span&gt;argv&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;5&lt;/span&gt; &lt;span&gt;else&lt;/span&gt; &lt;span&gt;100&lt;/span&gt;
&amp;nbsp;
  genome = G1DList.&lt;span&gt;G1DList&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;number&lt;span&gt;*&lt;/span&gt;size&lt;span&gt;&amp;#41;&lt;/span&gt;
  sequences = OrthogonalSequences&lt;span&gt;&amp;#40;&lt;/span&gt;size, number&lt;span&gt;&amp;#41;&lt;/span&gt;
  ga = GSimpleGA.&lt;span&gt;GSimpleGA&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;genome&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
  genome.&lt;span&gt;setParams&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;rangemin=&lt;span&gt;1&lt;/span&gt;, rangemax=rangemax&lt;span&gt;&amp;#41;&lt;/span&gt;
  genome.&lt;span&gt;evaluator&lt;/span&gt;.&lt;span&gt;set&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;sequences.&lt;span&gt;evaluate&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
  ga.&lt;span&gt;setMinimax&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;Consts.&lt;span&gt;minimaxType&lt;/span&gt;&lt;span&gt;&amp;#91;&lt;/span&gt;&lt;span&gt;&amp;quot;minimize&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#93;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
  ga.&lt;span&gt;setPopulationSize&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;population&lt;span&gt;&amp;#41;&lt;/span&gt;
  ga.&lt;span&gt;setElitism&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;True&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  ga.&lt;span&gt;setGenerations&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;generations&lt;span&gt;&amp;#41;&lt;/span&gt;
  ga.&lt;span&gt;evolve&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;freq_stats = generations/&lt;span&gt;10&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;print&lt;/span&gt; ga.&lt;span&gt;bestIndividual&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;h4&gt;Results&lt;/h4&gt;&lt;p&gt;Now the result is the following for 2 sequences of 10 impulses:&lt;/p&gt;&lt;pre&gt;Gen. 1 (2.00%): Max/Min/Avg Fitness(Raw) [436.73(387.20)/317.81(349.20)/363.94(363.94)]
Gen. 5 (10.00%): Max/Min/Avg Fitness(Raw) [417.89(375.20)/340.39(345.20)/348.24(348.24)]
Gen. 10 (20.00%): Max/Min/Avg Fitness(Raw) [419.21(379.20)/339.65(345.20)/349.34(349.34)]
Gen. 15 (30.00%): Max/Min/Avg Fitness(Raw) [417.72(377.20)/341.16(345.20)/348.10(348.10)]
Gen. 20 (40.00%): Max/Min/Avg Fitness(Raw) [419.40(375.20)/337.80(345.20)/349.50(349.50)]
Gen. 25 (50.00%): Max/Min/Avg Fitness(Raw) [419.86(389.20)/341.55(345.20)/349.88(349.88)]
Gen. 30 (60.00%): Max/Min/Avg Fitness(Raw) [418.25(381.20)/341.41(345.20)/348.54(348.54)]
Gen. 35 (70.00%): Max/Min/Avg Fitness(Raw) [418.08(375.20)/340.08(345.20)/348.40(348.40)]
Gen. 40 (80.00%): Max/Min/Avg Fitness(Raw) [418.42(375.20)/339.53(345.20)/348.68(348.68)]
Gen. 45 (90.00%): Max/Min/Avg Fitness(Raw) [418.80(381.20)/340.76(345.20)/349.00(349.00)]
Gen. 50 (100.00%): Max/Min/Avg Fitness(Raw) [417.94(371.20)/338.92(345.20)/348.28(348.28)]
Total time elapsed: 2.478 seconds.
- GenomeBase
        Score:                   345.200000
        Fitness:                 338.919595

        Slot [Evaluator] (Count: 1)
                Name: evaluate
        Slot [Initializator] (Count: 1)
                Name: G1DListInitializatorInteger
                Doc:  Integer initialization function of G1DList

   This initializator accepts the *rangemin* and *rangemax* genome parameters.

        Slot [Mutator] (Count: 1)
                Name: G1DListMutatorSwap
                Doc:  The mutator of G1DList, Swap Mutator
        Slot [Crossover] (Count: 1)
                Name: G1DListCrossoverSinglePoint
                Doc:  The crossover of G1DList, Single Point

   .. warning:: You can't use this crossover method for lists with just one element.

- G1DList
        List size:       18
        List:            [36, 48, 1, 11, 95, 37, 34, 38, 25, 10, 29, 64, 19, 11, 62, 68, 7, 15]
&lt;/pre&gt;&lt;p&gt;Here are the visual results for this optimization:&lt;/p&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;center&gt;&lt;div id=&quot;attachment_1314&quot; class=&quot;wp-caption aligncenter&quot;&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/comb0.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/comb0-300x226.png&quot; alt=&quot;&quot; title=&quot;Comb 0&quot; width=&quot;300&quot; height=&quot;226&quot; class=&quot;size-medium wp-image-1314&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;The first comb&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&lt;div id=&quot;attachment_1315&quot; class=&quot;wp-caption aligncenter&quot;&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/comb1.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/comb1-300x226.png&quot; alt=&quot;&quot; title=&quot;Comb 1&quot; width=&quot;300&quot; height=&quot;226&quot; class=&quot;size-medium wp-image-1315&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;The second comb&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;center&gt;&lt;div id=&quot;attachment_1316&quot; class=&quot;wp-caption aligncenter&quot;&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/correlations.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/correlations-300x226.png&quot; alt=&quot;&quot; title=&quot;Correlations between the combs&quot; width=&quot;300&quot; height=&quot;226&quot; class=&quot;size-medium wp-image-1316&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Correlations between the combs&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;They are not perfect, far from it, but remember that they are only combs with positive impulses. This means that you can&amp;#8217;t get a perfect result. An almost-perfect result would be that the crosscorrelation is below 1, but with only one value of 2, it&amp;#8217;s still pretty good.&lt;/p&gt;&lt;h4&gt;Before the end&lt;/h4&gt;&lt;p&gt;The process is very fast for 2 sequences of 10 impulses. If you add more sequences and more impulses, the computation time will rise fastly, but PyEvolve has now the ability to use the &lt;strong&gt;multiprocessing&lt;/strong&gt; module, which means it can do parallel optimizations now.&lt;/p&gt;&lt;p&gt;PyEvolve can do much more, I only barely scratch the surface of its capablities, but I hope this example will make you try this package.&lt;/p&gt;&lt;form action=&quot;https://www.paypal.com/cgi-bin/webscr&quot; method=&quot;post&quot;&gt; &lt;input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;_xclick&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;business&quot; value=&quot;matthieu.brucher@gmail.com&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;item_name&quot; value=&quot;Buy Me a Coffee!&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;currency_code&quot; value=&quot;USD&quot; /&gt;&lt;span&gt;&lt;strong&gt; Buy Me a Coffee!&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;select id=&quot;amount&quot; name=&quot;amount&quot; class=&quot;&quot;&gt;&lt;option value=&quot;3&quot;&gt;Capuccino - 3$&lt;/option&gt;&lt;option value=&quot;6&quot;&gt;Frappuccino - 6$&lt;/option&gt;&lt;option value=&quot;10&quot;&gt;Hot Chocolate - 10$&lt;/option&gt;&lt;option value=&quot;20&quot;&gt;Expensive Coffee - 20$&lt;/option&gt;&lt;option value=&quot;50&quot;&gt;Alien Coffee - 50$&lt;/option&gt;&lt;/select&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Other Amount:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;amount&quot; size=&quot;10&quot; title=&quot;Other donate&quot; value=&quot;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt; Your Email Address :&lt;/strong&gt;&lt;input type=&quot;hidden&quot; name=&quot;on0&quot; value=&quot;Reference&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;os0&quot; maxlength=&quot;60&quot; /&gt; &lt;br /&gt;&lt;br /&gt; &lt;input type=&quot;hidden&quot; name=&quot;no_shipping&quot; value=&quot;2&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;no_note&quot; value=&quot;1&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;mrb&quot; value=&quot;3FWGC6LFTMTUG&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;bn&quot; value=&quot;IC_Sample&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;return&quot; value=&quot;http://matt.eifelle.com&quot; /&gt;&lt;input type=&quot;image&quot; src=&quot;https://www.paypal.com/en_US/i/btn/x-click-but11.gif&quot; name=&quot;submit&quot; alt=&quot;Make payments with payPal - it's fast, free and secure!&quot; /&gt;&lt;/form&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/C1NxKpQx29VZkDocO8H1xLbxhVQ/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/C1NxKpQx29VZkDocO8H1xLbxhVQ/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/C1NxKpQx29VZkDocO8H1xLbxhVQ/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/C1NxKpQx29VZkDocO8H1xLbxhVQ/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/eJl2-tf11bA&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 27 Jul 2010 07:04:23 +0000</pubDate>
</item>
<item>
	<title>EuroSciPy 2010: Euroscipy 2010 is over: please fill in the feedback form!</title>
	<guid>http://www.euroscipy.org/blogentry/3788</guid>
	<link>http://www.euroscipy.org/blogentry/3788</link>
	<description>&lt;p&gt;If you attended Euroscipy 2010 (tutorials and/or conference), we're very interested in getting your feedback on the event. We have set up an anonymous feedback survey on &lt;a class=&quot;reference&quot; href=&quot;http://spreadsheets.google.com/viewform?formkey=dGpqVGRBN1VHdEMxZVJmTW9paG5ycWc6MQ&quot;&gt;http://spreadsheets.google.com/viewform?formkey=dGpqVGRBN1VHdEMxZVJmTW9paG5ycWc6MQ&lt;/a&gt;. It will take you only a couple of minutes to answer a dozen of questions on the tutorials, the talks, the practical organization, your wishlist for Euroscipy 2011, etc.&lt;/p&gt;
&lt;p&gt;Up to now, 35 people have filled in the form (many thanks to them!). If you have not yet filled in the feedback survey (there were 170+ participants to Euroscipy 2010!), make your voice heard now!&lt;/p&gt;</description>
	<pubDate>Sat, 24 Jul 2010 13:28:00 +0000</pubDate>
</item>
<item>
	<title>Ga&amp;#235;l Varoquaux: Sprint Scikit learn in Paris</title>
	<guid>http://gael-varoquaux.info/blog/?p=135</guid>
	<link>http://gael-varoquaux.info/blog/?p=135</link>
	<description>&lt;p&gt;We are organizing a coding sprint in Paris on the &lt;a href=&quot;http://scikit-learn.sourceforge.net/&quot;&gt;scikit learn&lt;/a&gt;, &lt;strong&gt;machine learning in Python&lt;/strong&gt;. The goal of this sprint is to set the API and the general coding guidelines of the scikit to be able to tackle many different statistical learning problems in a consistent framework.&lt;/p&gt;
&lt;p&gt;This is why we would like to have people with different problems, applications, and backgrounds to pitch in.&lt;/p&gt;
&lt;p&gt;It will be a two-days sprint. Everyone is welcome, so just fill in the &lt;a href=&quot;http://www.doodle.com/4cqxnhuq5rr4qzn5&quot;&gt;doodle&lt;/a&gt;, so that we can choose the date?&lt;/p&gt;
&lt;p&gt;And do not hesitate to suggest some topics that you would like to be addressed during the sprint, and to discuss them on the &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/scikit-learn-general&quot;&gt;mailing-list&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://parietal.saclay.inria.fr/Members/vincent-michel&quot;&gt;Vincent Michel&lt;/a&gt; is organizing the sprint. If you have questions about the sprint, you are welcomed to contact me, but please do put him in Cc to.&lt;/p&gt;</description>
	<pubDate>Fri, 23 Jul 2010 13:31:31 +0000</pubDate>
</item>
<item>
	<title>Matthieu Brucher: Book review: Hacking Roomba: ExtremeTech</title>
	<guid>http://matt.eifelle.com/?p=1295</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/dRurjajGhHA/</link>
	<description>&lt;p&gt;I&amp;#8217;ve recently bought a fourth generation &lt;a href=&quot;http://www.irobot.com/&quot;&gt;Roomba&lt;/a&gt;, which is a vacuum cleaning robot. I bought this brand because it is well-known and has a good history of hackable robots. So the next step was to figure out how to hack it, and hence this book.&lt;br /&gt; &lt;span id=&quot;more-1295&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4&gt;Content and opinions&lt;/h4&gt;&lt;p&gt;The book is split in three parts with progress hacking solutions. It is to be mentioned that it is dedicated to hacking the third generation, but the interface should be the same, although some instructions may have changed. Perhaps a new edition of the book may be needed.&lt;/p&gt;&lt;p&gt;iRobot had the good idea of opening their pets to hackers. It is done through a serial interface called ROI. The first encompasses the creation (or the buying) of a connector between a PC and the Roomba. There are several solutions, from a simple serial cable to a Bluetooth interface. Once you have a connector, you need to learn and use the interface to make the robot move and feel. Each captor and motor is explained as well as how it can be interacted with. The main examples are given through a Java library (I would have prefered a Python library, of course).&lt;/p&gt;&lt;p&gt;The second part is perhaps the least interesting. It starts with making an application to steer the robot. It is done with &lt;a href=&quot;http://www.processing.org/&quot;&gt;Processing&lt;/a&gt;, an obscur language that runs on the JVM. &lt;a href=&quot;http://www.infoworld.com/d/developer-world/top-five-scripting-languages-the-jvm-855&quot;&gt;Why not one of the top five script language on it&lt;/a&gt;? You may then use the inner beeper to make some music. Indeed, it can be fun, but it&amp;#8217;s also not that easy, even with the help of the book. More fun is making art drawings with addition of pens sticked on the Roomba. I was a big fan of these kind of drawngs when I was young. The last chapter exposes the Roomba as a big input device such as a mouse. Of course, it can help doing some sports&amp;#8230;&lt;/p&gt;&lt;p&gt;The last part is about using additional platforms to make a more complicated robot. First, you may connect it to the Internet to steer it from the other end of the world, the next step being using WiFi. Then, you may upgrade its brain with a classic Linux board, adding a camera, &amp;#8230; OK, this is fun, but it&amp;#8217;s not a cleaner anymore. It begins to be even very ugly and not that autonomous unless you stick a big battery pack. But I have to be agree on some aspects of the mod: it&amp;#8217;s a good basis for building one&amp;#8217;s custom robot. But you may find a skeletton for less (or not).&lt;/p&gt;&lt;h4&gt;Conclusion&lt;/h4&gt;&lt;p&gt;I intend to keep my Roomba as a vacuum cleaner, not a complete robot with a wifi router on top of it. Still, it is interesting to know that you can do a lot with it, and first of all with a simple serial cable or a Bluetooth connection.&lt;/p&gt;&lt;div&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://r.popshops.com/r/a0ExSGx1YUhML0JZWGQ3dnhrK0FkZG4rM2I2MWNic2V0UStmbHE0ZlRLYz0K&quot;&gt;&lt;img src=&quot;http://images.textbooks.com/TextbookInfo/Covers/0470072717.gif&quot; border=&quot;0&quot; alt=&quot;Hacking Roomba&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://r.popshops.com/r/a0ExSGx1YUhML0JZWGQ3dnhrK0FkZG4rM2I2MWNic2V0UStmbHE0ZlRLYz0K&quot;&gt;Hacking Roomba&lt;/a&gt;&lt;br /&gt; Price: $20.22&lt;br /&gt; By Kurt &amp;#8211; John Wiley &amp;amp; Sons, Inc. (00) &amp;#8211; Paperback &amp;#8211; ISBN 10 0470072717 &amp;#8211; ISBN 13 9780470072714&lt;/div&gt;&lt;div class=&quot;subcolumns&quot;&gt;&lt;div&gt;&lt;div&gt; &lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/B0015DCQI0/masbl03-20&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://ecx.images-amazon.com/images/I/512d%2BgqfCrL._SL75_.jpg&quot; width=&quot;60&quot; height=&quot;75&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/B0015DCQI0/masbl03-20&quot; target=&quot;_blank&quot;&gt;Hacking Roomba: ExtremeTech&lt;/a&gt; (Paperback)&lt;br /&gt; &lt;span&gt;by &lt;strong&gt;Tod E. Kurt&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; ISBN:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Price:&lt;/strong&gt; &lt;span&gt; &amp;#8212;&lt;/span&gt;&lt;br /&gt; &lt;strong&gt;22 used &amp;#038; new&lt;/strong&gt; available from &lt;span&gt;USD 30.00&lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;img src=&quot;http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/stars-4.5.gif&quot; class=&quot;asa_rating_stars&quot; /&gt; | 4.5 | 7&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/pqh7y5FBF-NC8-BqGBGAJq-9Ees/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/pqh7y5FBF-NC8-BqGBGAJq-9Ees/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/pqh7y5FBF-NC8-BqGBGAJq-9Ees/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/pqh7y5FBF-NC8-BqGBGAJq-9Ees/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/dRurjajGhHA&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 20 Jul 2010 06:44:16 +0000</pubDate>
</item>
<item>
	<title>Fwrap blog: freemalloc</title>
	<guid>http://fortrancython.wordpress.com/?p=58</guid>
	<link>http://fortrancython.wordpress.com/2010/07/16/milestone/</link>
	<description>&lt;p&gt;Fwrap sucessfully wraps upwards of 97% of the more than 1500 routines in netlib&amp;#8217;s LAPACK.  Oh yeah.  Granted this is pretty much all F77 code, but it works.&lt;/p&gt;
&lt;p&gt;The remaining 3% are related to a trivial feature, namely dimension(0:N) style array declarations that will be supported very soon.&lt;/p&gt;
&lt;p&gt;Much work has gone into the front end recently.  The commandline options are taking their final shape and I&amp;#8217;ll be getting some improved documentation in the README tomorrow.  Feel free to take it out for a spin.&lt;/p&gt;
&lt;p&gt;To try out fwrap from the mercurial repo, see http://fwrap.sourceforge.net/ for instructions and dependencies (numpy, cython &amp;amp; a &amp;#8220;modern-enough&amp;#8221; Fortran 90 compiler).  Let me know any problems you may have.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/fortrancython.wordpress.com/58/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/fortrancython.wordpress.com/58/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/fortrancython.wordpress.com/58/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/fortrancython.wordpress.com/58/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/fortrancython.wordpress.com/58/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/fortrancython.wordpress.com/58/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/fortrancython.wordpress.com/58/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/fortrancython.wordpress.com/58/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/fortrancython.wordpress.com/58/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/fortrancython.wordpress.com/58/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/fortrancython.wordpress.com/58/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/fortrancython.wordpress.com/58/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/fortrancython.wordpress.com/58/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/fortrancython.wordpress.com/58/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=fortrancython.wordpress.com&amp;amp;blog=7448735&amp;amp;post=58&amp;amp;subd=fortrancython&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Sat, 17 Jul 2010 05:28:51 +0000</pubDate>
</item>
<item>
	<title>Ga&amp;#235;l Varoquaux: Simple object signatures</title>
	<guid>http://gael-varoquaux.info/blog/?p=134</guid>
	<link>http://gael-varoquaux.info/blog/?p=134</link>
	<description>&lt;h1&gt;A &lt;i&gt;signature&lt;/i&gt; pattern&lt;/h1&gt;
&lt;p&gt;
There are many libraries around to specify what I call a &lt;i&gt;&amp;#8217;signature&amp;#8217;&lt;/i&gt;  for an object, in other words a list of attributes that define its parameter set. I have heavily used &lt;a href=&quot;http://code.enthought.com/projects/traits&quot;&gt;Enthought&amp;#8217;s Traits library&lt;/a&gt; for this purpose, but the concept is fairly general and can be found &lt;i&gt;eg&lt;/i&gt; in ORMs (Object Relational Mappers) or web frameworks.
&lt;/p&gt;
&lt;p&gt;
Specification of this interface of parameters may be used to answer a variety of needs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Typing&lt;/strong&gt;: in the case of an ORM, to generate UIs, or for better error management, it may be desirable to have some control on the types of certain attributes of an object. In this case, specifying the signature corresponds to laying out a &lt;strong&gt;data model&lt;/strong&gt; for the object.
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reactive programming&lt;/strong&gt;: using properties to react to changes to attributes, one can fully specify the API of an object in terms of these attributes. This gives a message-passing like programming style that can be very well suited to parallel-computing in particular because it can easily be made thread-safe.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Signatures for statistical learning objects&lt;/h1&gt;
&lt;p&gt;Recently, I considered the &lt;i&gt;signature&lt;/i&gt; pattern in a new context. In the &lt;a href=&quot;http://scikit-learn.sourceforge.net/&quot;&gt;scikit-learn&lt;/a&gt;, we are interested in statistical learning. This entails fitting models to data and often tuning parameters to select a model that fits best (a problem called &lt;i&gt;model selection&lt;/i&gt;). Each of our models is an object that implements a couple of key methods to fit to the data and to apply to new data (&lt;i&gt;fit&lt;/i&gt; and &lt;i&gt;predict&lt;/i&gt;).
&lt;/p&gt;
&lt;p&gt;
The approach that we are currently taking for model selection is (more or less) to generate a list of models with different parameters and fit and  test them on the data.&lt;/p&gt;
&lt;p&gt;A very nice feature would be to find out the parameters to vary simply by inspecting the objects, and such a desire recently got us  &lt;a href=&quot;http://sourceforge.net/mailarchive/forum.php?thread_name=201007050958.16199.matthieu.perrot%40cea.fr&amp;#038;forum_name=scikit-learn-general&quot;&gt;discussing&lt;/a&gt; of defining &lt;i&gt;signatures&lt;/i&gt; for our objects. I must confess that I am a bit weary as this means either depending on a  signature library, or building one. We don&amp;#8217;t want to grow our dependencies, and most signature-definition code that I know involve meta-programming tricks to avoid code duplication.
&lt;/p&gt;
&lt;h1&gt;Solving the simple problem: avoiding type checking&lt;/h1&gt;
&lt;p&gt;
Today, I had to bite the bullet, because we were in a situation in which we had to instantiate new models from the existing one during model selection. For technical reasons, using a &lt;i&gt;copy.copy&lt;/i&gt; to create these new models was not a great idea, and it was better to have the minimal list of parameters required. Here come signatures again.
&lt;/p&gt;
&lt;p&gt;
After a bit of messing around with the code, I realized that typing information was useless, and most probably harmful, to our immediate goals and that I just needed the names of the relevant attributes. I finally settled down to the following solution (which might still change):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All parameters need to be specified as keyword arguments of the &lt;i&gt;__init__&lt;/i&gt;. The &lt;i&gt;__init__&lt;/i&gt; may not have positional arguments or &amp;#8216;*&amp;#8217; arguments. Attributes on the objects have the same names as the &lt;i&gt;__init__&lt;/i&gt; parameters.
&lt;/li&gt;
&lt;li&gt;A simple base class, with couple of methods relying on a simple use of the &lt;i&gt;inspect&lt;/i&gt; module to find the signature of the &lt;i&gt;__init__&lt;/i&gt;.
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;pre&gt;
class BaseEstimator(object):
    @classmethod
    def _get_param_names(cls):
        args, varargs, kw, default = inspect.getargspec(cls.__init__)
        assert varargs is None, (
            'scikit learn estimators should always specify their '
            'parameters in the signature of their init (no varargs).'
            )
        # Remove 'self'
        args.pop(0)
        return args

    def _get_params(self):
        out = dict()
        for key in self._get_param_names():
            out[key] = getattr(self, key)
        return out

    def _set_params(self, **params):
        valid_params = self._get_param_names()
        for key, value in params.iteritems():
            assert key in valid_params, (&amp;#8217;Invalid parameter %s &amp;#8216;
                &amp;#8216;for estimator %s&amp;#8217; %
                (key, self.__class__.__name__))
            setattr(self, key, value)
&lt;/pre&gt;
&lt;p&gt;
The full code can be seen &lt;a href=&quot;http://gael-varoquaux.info/blog/wp-content/uploads/2010/base_estimator_py&quot;&gt;here&lt;/a&gt; and adds a bit more features, such as a clever &lt;i&gt;__repr__&lt;/i&gt;.
&lt;/p&gt;
&lt;p&gt;
What I like about this solution is that it (almost) does not use metaprograming, and avoids code duplication without forcing any specific pattern on the developer subclassing &lt;i&gt;BaseEstimator&lt;/i&gt;.
&lt;/p&gt;
&lt;h1&gt;The next step&lt;/h1&gt;
&lt;p&gt;
This approach solves my immediate problem, but not the bigger one of finding what values can the different parameters take when varied for model selection. Of course this second problem is much more complicated, and maybe it is not worth solving it: the framework could very easily be bringing in more problems than it solves.
&lt;/p&gt;
&lt;p&gt;
However, it seems that a fairly easy way of specifying possible values for parameters would be to decorate the &lt;i&gt;__init__&lt;/i&gt;, giving the possible parameters to be tested during the model selection:
&lt;/p&gt;
&lt;pre&gt;
    @cv_params(l1=np.logspace(1e-4, 1, 10))
    def __init__(self, l1=.5, fit_intercept=True)
	# ...
&lt;/pre&gt;
&lt;p&gt;
All the decorator has to do is to store the information in an attribute attached to the &lt;i&gt;__init__&lt;/i&gt; (and probably to check that the parameters it was given are valid arguments, in order to raise errors early). Methods on the class can later inspect this information for model selection, or GUI building (data-model specification will probably require some typing language, rather than a simple list of possible parameters).
&lt;/p&gt;
&lt;p&gt;
Once again, here we would be avoiding the difficulty of specifying type information in a non restrictive way, but avoiding a problem that we don&amp;#8217;t have to solve is probably a good idea.&lt;/p&gt;</description>
	<pubDate>Fri, 16 Jul 2010 22:31:59 +0000</pubDate>
</item>
<item>
	<title>SciPy 2010: SciPy 2010 Review</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-826253844622944795</guid>
	<link>http://scipy2010.blogspot.com/2010/07/scipy-2010-review.html</link>
	<description>&lt;div id=&quot;__ss_4773883&quot;&gt;&lt;strong&gt;&lt;a href=&quot;http://www.slideshare.net/enthought/scipy-2010-review&quot; title=&quot;SciPy 2010 Review&quot;&gt;SciPy 2010 Review&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Download the video from &lt;a href=&quot;http://www.enthought.com/training/webinars.php&quot;&gt;enthought.com&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-826253844622944795?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Fri, 16 Jul 2010 14:35:10 +0000</pubDate>
	<author>noreply@blogger.com (Amenity Applewhite)</author>
</item>
<item>
	<title>EuroSciPy 2010: EuroSciPy 2010 is over</title>
	<guid>http://www.euroscipy.org/blogentry/3739</guid>
	<link>http://www.euroscipy.org/blogentry/3739</link>
	<description>&lt;img align=&quot;right&quot; alt=&quot;http://www.euroscipy.org/image/3737?vid=download&quot; class=&quot;align-right&quot; src=&quot;http://www.euroscipy.org/image/3737?vid=download&quot; /&gt;
&lt;p&gt;EuroSciPy 2010 was a fun conference to organize and we think we can call over 150 participants a success.&lt;/p&gt;
&lt;p&gt;Thank you to every delegate and speaker that joined us to face the heat.&lt;/p&gt;
&lt;p&gt;Thank you to Ecole Normale Supérieure for hosting us.&lt;/p&gt;
&lt;p&gt;Read about the &lt;a class=&quot;reference&quot; href=&quot;http://www.euroscipy.org/card/post-euroscipy2010&quot;&gt;reports&lt;/a&gt; and send us yours if you want it added to the list.&lt;/p&gt;
&lt;p&gt;EuroSciPy 2011 will be in Paris again. We hope to see you there!&lt;/p&gt;</description>
	<pubDate>Tue, 13 Jul 2010 19:56:00 +0000</pubDate>
</item>
<item>
	<title>Ga&amp;#235;l Varoquaux: Euroscipy 2010: code, science, and a lot of fun</title>
	<guid>http://gael-varoquaux.info/blog/?p=133</guid>
	<link>http://gael-varoquaux.info/blog/?p=133</link>
	<description>&lt;p&gt;&lt;a href=&quot;http://www.euroscipy.org/conference/euroscipy2010&quot;&gt;Euroscipy 2010&lt;/a&gt;, the third European conference for the use of Python in science, is just over, and I think it was a great success.&lt;br /&gt;
&lt;h1&gt;Euroscipy in numbers&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4118/4779625445_0e783484cd_m_d.jpg&quot; align=&quot;right&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The attendance this year was huge: there was a grand total of 160 who came to EuroScipy, with 140 that came only to the tutorials, and 130 only the conference. This up by almost a factor of 3 compared to last year&amp;#8217;s&lt;br /&gt;
EuroScipy, more than last year&amp;#8217;s SciPy conference in Passadena, and almost as much as this year&amp;#8217;s SciPy conference in Austin that hosted 180 person. We had people coming from 16 country, and as far as New Zealand, the US, or Turkey. Research lab, education, and industry (small to large companies) were all well represented, with approximately a third of the delegates coming from the industry. Similarly, many different scientific field were discussed, ranging from landscape ecology to pure math.
&lt;/p&gt;
&lt;p&gt;There were 2 tutorial tracks with 10 tutorial slots in each track. We had 2 keynotes from Hans Petter Langtangen and Konrad Hinsen. With regards to the contributed talks, the conference this year was highly selective. We received 52 propositions. We unfortunately could accept only 30 of them, which corresponds to an acceptance rate of 58%. Finally, we had 18 &lt;a href=&quot;http://www.euroscipy.org/talk/937&quot;&gt;lightning talks&lt;/a&gt;.&lt;/p&gt;
&lt;h1&gt;A warm and friendly atmosphere&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4097/4774499149_5dda469dc2_m.jpg&quot; align=&quot;right&quot; /&gt;&lt;/p&gt;
&lt;p&gt; As an organizer, I was really pleased to find out how much people were relaxed and friendly. This certainly facilitates discussions during the breaks. And the ambiance was undoubtedly warm: 140 people with laptops in a room without air conditioning in the Paris summer :). &lt;/p&gt;
&lt;p&gt;Of course during the evenings, many people met to continue the passionate discussions in restaurants and bars.
&lt;/p&gt;
&lt;h1&gt;Trends I noticed&lt;/h1&gt;
&lt;p&gt;What one remembers from a conference is obviously biased by personal interests. With that disclaimer, here are the recurrent and important topics that I noticed, both in the talks, but also in the coffee break discussions:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Parallel computing&lt;/strong&gt;, in particular making it easy to do parallel computing.&lt;br /&gt;
&lt;a href=&quot;http://www.euroscipy.org/talk/2011&quot;&gt;Konrad&amp;#8217;s keynote&lt;/a&gt; had many interesting directions to explore. (talks: &lt;a href=&quot;http://www.euroscipy.org/talk/2009&quot;&gt;Playdoh&lt;/a&gt;, &lt;a href=&quot;http://www.euroscipy.org/talk/1686&quot;&gt;DANA&lt;/a&gt;).
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code generation&lt;/strong&gt;. In the various conferences I have been to recently, I heard much talking about symbolic manipulation of numerical problems to generate optimal computing kernels (talks: &lt;a href=&quot;http://www.euroscipy.org/talk/1657&quot;&gt;Efficient computation tutorial&lt;/a&gt;,  &lt;a href=&quot;http://www.euroscipy.org/talk/1666&quot;&gt;Theano&lt;/a&gt;, &lt;a href=&quot;http://www.euroscipy.org/talk/2045&quot;&gt;Algorithmic Differentiation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data management&lt;/strong&gt;, with problems such as provenance tracking for reproducibility (talks: &lt;a href=&quot;http://www.euroscipy.org/talk/1960&quot;&gt;Sumatra&lt;/a&gt;, &lt;a href=&quot;http://www.euroscipy.org/talk/880&quot;&gt;Knowledge management tutorial&lt;/a&gt;).
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally installation problems of scientific tools were the subject of many discussions, as each year. One thing that I did notice, is that people stopped simply blaming each others and acknowledged that nobody knew how to fix the problem. Somebody even pointed out that installing any major scientific code was not a piece of cake. Hans Petter and others said that they had solved the problem by relying on a virtual machine and Ubuntu.
&lt;/p&gt;
&lt;p&gt;Konrad has also &lt;a href=&quot;http://khinsen.wordpress.com/2010/07/12/euroscipy-2010/&quot;&gt;blogged&lt;/a&gt;, giving his own view of the conference.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4097/4778812305_9217c5d3c2_m.jpg&quot; align=&quot;right&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Thanks&lt;/h1&gt;
&lt;p&gt;The conference could happen only because of the help of many people. First we need to thank our sponsors: &lt;a href=&quot;http://www.enthought.com&quot;&gt;Enthought&lt;/a&gt;, &lt;a href=&quot;http://www.python-academy.com/&quot;&gt;Python Academy&lt;/a&gt;, &lt;a href=&quot;http://www.pytables.org&quot;&gt;Pytables&lt;/a&gt;, and especially our host &lt;a href=&quot;http://www.ens.fr&quot;&gt;Ecole Normale Supérieure&lt;/a&gt;, which not only provided us with the rooms, but also made sure that everything was going well with the sound system, the projection, or the access to the building. With regards to organization and planing, Nicolas and I received a lot of help from &lt;a href=&quot;http://www.saint-gobain-recherche.com/svi/en/emmanuelle_gouillart.html&quot;&gt; Emmanuelle Gouillart&lt;/a&gt;.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</description>
	<pubDate>Tue, 13 Jul 2010 16:31:40 +0000</pubDate>
</item>
<item>
	<title>Matthieu Brucher: Dimensionality reduction: Refactoring the manifold module</title>
	<guid>http://matt.eifelle.com/?p=1290</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/7A1EtG3xcx8/</link>
	<description>&lt;p&gt;It&amp;#8217;s been a while since I last blogged about manifold learning. I don&amp;#8217;t think I&amp;#8217;ll add much in terms of algorithms to the scikit, but now that a clear API is being defined (&lt;a href=&quot;http://sourceforge.net/apps/trac/scikit-learn/wiki/ApiDiscussion&quot;&gt;http://sourceforge.net/apps/trac/scikit-learn/wiki/ApiDiscussion&lt;/a&gt;), it&amp;#8217;s time for the manifold module to comply to it. Also, documentation will be enhanced and some dependencies will be removed.&lt;/p&gt;&lt;p&gt;I&amp;#8217;ve started a branch available on &lt;a href=&quot;http://github.com/mbrucher/scikit-learn&quot;&gt;github.com&lt;/a&gt;, and I will some examples in the scikit as well. I may explain them here, but I won&amp;#8217;t rewrite what is already published. A future post will explain the changes, and I hope that interested people will understand the modifications and apply them to my former posts. It&amp;#8217;s just that I don&amp;#8217;t have much time to change everything&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/WP5TPWHAArLGNzZbm0q4WMPLWT4/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/WP5TPWHAArLGNzZbm0q4WMPLWT4/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/WP5TPWHAArLGNzZbm0q4WMPLWT4/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/WP5TPWHAArLGNzZbm0q4WMPLWT4/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/7A1EtG3xcx8&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 13 Jul 2010 07:05:40 +0000</pubDate>
</item>
<item>
	<title>NeuralEnsemble: Photos from CodeJam4</title>
	<guid>tag:blogger.com,1999:blog-73903413139568172.post-2730416450259124279</guid>
	<link>http://neuralensemble.blogspot.com/2010/07/photos-from-codejam4.html</link>
	<description>&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/73903413139568172-2730416450259124279?l=neuralensemble.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 13 Jul 2010 00:21:35 +0000</pubDate>
	<author>noreply@blogger.com (eilif)</author>
</item>
<item>
	<title>Fwrap blog: freemalloc</title>
	<guid>http://fortrancython.wordpress.com/?p=53</guid>
	<link>http://fortrancython.wordpress.com/2010/07/12/quick-update/</link>
	<description>&lt;p&gt;It&amp;#8217;s been a while.  You&amp;#8217;re wondering what&amp;#8217;s been happening with fwrap.&lt;/p&gt;
&lt;p&gt;Thanks to a sprint at SciPy 2010, fwrap is quickly gaining parity with f2py.  Fwrap doesn&amp;#8217;t yet have interface files working (and it won&amp;#8217;t for the first release); neither does it support &amp;#8216;common&amp;#8217; blocks.  I&amp;#8217;ve been focusing on F77-style function &amp;amp; subroutine functionality.&lt;/p&gt;
&lt;p&gt;The main Fortran features currently supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All intrinsic scalar datatypes, including with literal integer kind parameters&lt;/li&gt;
&lt;li&gt;Arrays of intrinsic types &amp;amp; literal kind params.&lt;/li&gt;
&lt;li&gt;All dimension declarations (assumed shape, assumed size, explicit shape)&lt;/li&gt;
&lt;li&gt;Runtime array dimension checking&lt;/li&gt;
&lt;li&gt;Automatic type discovery&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Fwrap has a pretty good testsuite in place, both unittests &amp;amp; integration tests.  They&amp;#8217;re run frequently to ensure no regressions are introduced.&lt;/p&gt;
&lt;p&gt;Kyle Mandli helped improve fwrap&amp;#8217;s commandline interface during the fwrap sprint at SciPy 2010.  Those changesets have yet to be merged with the main repo, but when they are it will be a *big* improvement, and move fwrap much closer to the 0.1 release.  He also added logging functionality to fwrap and fparser &amp;#8212; another big improvement.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been throwing some fairly big F77 (clawpack, lapack) and F90 (a UW-Madison inertial confinement simulation; thanks, Matt!) codebases at fparser to thresh out glaring bugs, and thus far I&amp;#8217;ve been pleased.  No major problems, although I&amp;#8217;d very much like to figure out how to test the AST generated by fparser for correctness.  Not sure how to do that yet.&lt;/p&gt;
&lt;p&gt;Anyway, just a quick update.  Stay tuned!&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/fortrancython.wordpress.com/53/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/fortrancython.wordpress.com/53/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/fortrancython.wordpress.com/53/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/fortrancython.wordpress.com/53/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/fortrancython.wordpress.com/53/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/fortrancython.wordpress.com/53/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/fortrancython.wordpress.com/53/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/fortrancython.wordpress.com/53/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/fortrancython.wordpress.com/53/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/fortrancython.wordpress.com/53/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/fortrancython.wordpress.com/53/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/fortrancython.wordpress.com/53/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/fortrancython.wordpress.com/53/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/fortrancython.wordpress.com/53/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=fortrancython.wordpress.com&amp;amp;blog=7448735&amp;amp;post=53&amp;amp;subd=fortrancython&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Mon, 12 Jul 2010 17:22:54 +0000</pubDate>
</item>
<item>
	<title>NeuralEnsemble: Sumatra 0.2 released</title>
	<guid>tag:blogger.com,1999:blog-73903413139568172.post-1365922316231040501</guid>
	<link>http://neuralensemble.blogspot.com/2010/07/sumatra-02-released.html</link>
	<description>&lt;span class=&quot;Apple-style-span&quot;&gt;We would like to announce the release of version 0.2 of &lt;a href=&quot;http://neuralensemble.org/trac/sumatra&quot;&gt;Sumatra&lt;/a&gt;, a tool for automated tracking of simulations and computational analyses so as to be able to easily replicate them at a later date.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;The main changes are:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;expanded the focus from just simulations to any command-line driven computation, e.g. analyses, graphing. This simply involved changes to the documentation and some renaming, e.g. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SimProject&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; is now just &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Project&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;RecordStore&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;s can now contain records from multiple projects and multiple users. This makes it possible to keep all your records in a single database, and for different people to collaborate on the same project.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;added support for the &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;a href=&quot;http://git-scm.com/&quot;&gt;Git&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; version control system. Sumatra requires your code to be stored in a version control system to ensure reproducibility, and now supports Git, &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;a href=&quot;http://subversion.tigris.org/&quot;&gt;Subversion&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; and &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;a href=&quot;http://mercurial.selenic.com/&quot;&gt;Mercurial&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;removed the concept of record group&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;s, since grouping can easily be achieved using tags.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Sumatra can now pass the record label to your main script, by appending it either to the command line or to the parameter file. This is very useful for separating the output files of different experiments into their own directories such that Sumatra can correctly link to them.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;you can now tag a simulation/analysis at the same time you run it, using &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;smt run&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;, rather than having to remember to do this afterwards with &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;smt tag&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;added a &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;@capture&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; decorator, to make it easier to use Sumatra in your own Python scripts.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;the web interface will now display the contents of any CSV files generated during your experiment as an HTML table.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;added &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;ConfigParserParameterSet&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;. If you pass parameters to your simulation/analysis in a separate file, then Sumatra can store these parameters for future searching, provided it understands &amp;nbsp;the parameter file format. The new class adds support for parameters stored in &lt;a href=&quot;http://docs.python.org/library/configparser.html&quot;&gt;ConfigParser&lt;/a&gt;-style files (the existing supported formats are simple one-per-line key=value files and hierarchical, JSON-like&lt;a href=&quot;http://neuralensemble.org/trac/NeuroTools/wiki/parameters&quot;&gt; NeuroTools parameter sets&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Sumatra 0.2 may be downloaded from the&amp;nbsp;&lt;a href=&quot;http://software.incf.org/software/sumatra/home/download/&quot;&gt;INCF Software Center&lt;/a&gt;&amp;nbsp;or from&amp;nbsp;&lt;a href=&quot;http://pypi.python.org/pypi/Sumatra/&quot;&gt;PyPI&lt;/a&gt;.&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/73903413139568172-1365922316231040501?l=neuralensemble.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Sat, 10 Jul 2010 09:52:34 +0000</pubDate>
	<author>noreply@blogger.com (Andrew Davison)</author>
</item>
<item>
	<title>Enthought: Fast Numpy/Protobuf Deserialization Example</title>
	<guid>http://blog.enthought.com/?p=455</guid>
	<link>http://blog.enthought.com/python/numpy/fast-numpyprotobuf-deserialization-example/</link>
	<description>&lt;p&gt;In my last post I wrote about how I was able to improve protobuf deserialization using a C++ extension. I&amp;#8217;ve boiled down the code to its essence to show how I did it. Rather than zip everything up in a file, the code is short enough to show in its entirety.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s the simplified protobuf message which is used to represent a time series as 2 arrays:&lt;/p&gt;
&lt;pre class=&quot;brush: python&quot;&gt;
package timeseries;

message TimeSeries {
    repeated double times = 2;
    repeated double values = 3;
}
&lt;/pre&gt;
&lt;p&gt;I then wrote a test app in Python and C++ to provide a benchmark. Here is the Python version:&lt;/p&gt;
&lt;pre class=&quot;brush: python&quot;&gt;
import numpy
import time_series_pb2

def write_test():
    ts = time_series_pb2.TimeSeries()
    for i in range(10000000):
        ts.times.append(i)
        ts.values.append(i*10.0)

    import time
    start = time.time();

    f = open(&amp;quot;ts.bin&amp;quot;, &amp;quot;wb&amp;quot;)
    f.write(ts.SerializeToString())
    f.close()

    print time.time() - start

def read_test():
    ts = time_series_pb2.TimeSeries()

    import time
    start = time.time();

    f = open(&amp;quot;ts.bin&amp;quot;, &amp;quot;rb&amp;quot;)
    ts.ParseFromString(f.read())
    f.close()

    t = numpy.array(ts.times._values)
    v = numpy.array(ts.values._values)

    print &amp;#039;Read time:&amp;#039;, time.time() - start
    print &amp;quot;Read time series of length %d&amp;quot; % len(ts.times)

if __name__ == &amp;quot;__main__&amp;quot;:
    import sys
    if len(sys.argv) &amp;lt; 2:
        print &amp;quot;usage:   %s &amp;lt;--read&amp;gt; | &amp;lt;--write&amp;gt;&amp;quot; % sys.argv[0]

    if sys.argv[1] == &amp;quot;--read&amp;quot;:
        read_test()
    else:
        write_test()
&lt;/pre&gt;
&lt;p&gt;I will spare you the C++ standalone code, since it was only a stepping stone. Instead here is the C++ extension, with 2 exposed methods, one which deserializes a string and the other which operates on a file.&lt;/p&gt;
&lt;pre class=&quot;brush: c++&quot;&gt;
#include &amp;lt;fcntl.h&amp;gt;

#include &amp;lt;Python.h&amp;gt;
#include &amp;lt;numpy/arrayobject.h&amp;gt;
#include &amp;lt;google/protobuf/io/coded_stream.h&amp;gt;
#include &amp;lt;google/protobuf/io/zero_copy_stream_impl_lite.h&amp;gt;
#include &amp;lt;google/protobuf/io/zero_copy_stream_impl.h&amp;gt;

#include &amp;quot;time_series.pb.h&amp;quot;

static PyObject* construct_numpy_arrays(timeseries::TimeSeries* ts)
{
    // returns a tuple (t,v) where t and v are double arrays of the same length

    PyObject* data_tuple = PyTuple_New(2);

    long array_size = ts-&amp;gt;times_size();
    double* times = new double[array_size];
    double* values = new double[array_size];

    // the data must be copied because the tsid will go away and its mutable data
    // will too
    memcpy(times, ts-&amp;gt;times().data(), ts-&amp;gt;times_size()*sizeof(double));
    memcpy(values, ts-&amp;gt;values().data(), ts-&amp;gt;values_size()*sizeof(double)); 

    // put the arrays into numpy array objects
    npy_intp dims[1] = {array_size};
    PyObject* time_array = PyArray_SimpleNewFromData(1, dims, PyArray_DOUBLE, times);
    PyObject* value_array = PyArray_SimpleNewFromData(1, dims, PyArray_DOUBLE, values);

    PyTuple_SetItem(data_tuple, 0, time_array);
    PyTuple_SetItem(data_tuple, 1, value_array);

    return data_tuple;
}

static PyObject* TimeSeries_load(PyObject* self, PyObject* args)
{
    char* filename = NULL;

    if (! PyArg_ParseTuple(args, &amp;quot;s&amp;quot;, &amp;amp;filename))
    {
        return NULL;
    }

    timeseries::TimeSeries ts;

    int fd = open(filename, O_RDONLY);
    google::protobuf::io::FileInputStream fs(fd);
    google::protobuf::io::CodedInputStream coded_fs(&amp;amp;fs);
    coded_fs.SetTotalBytesLimit(500*1024*1024, -1);
    ts.ParseFromCodedStream(&amp;amp;coded_fs);
    fs.Close();
    close(fd);

    return construct_numpy_arrays(&amp;amp;ts);
}

static PyObject* TimeSeries_deserialize(PyObject* self, PyObject* args)
{
    int buffer_length;
    char* serialization = NULL;

    if (! PyArg_ParseTuple(args, &amp;quot;t#&amp;quot;, &amp;amp;serialization, &amp;amp;buffer_length))
    {
        return NULL;
    }
    google::protobuf::io::ArrayInputStream input(serialization, buffer_length);

    google::protobuf::io::CodedInputStream coded_fs(&amp;amp;input);
    coded_fs.SetTotalBytesLimit(500*1024*1024, -1);

    timeseries::TimeSeries ts;
    ts.ParseFromCodedStream(&amp;amp;coded_fs);
    return construct_numpy_arrays(&amp;amp;ts);
}

static PyMethodDef TSMethods[] = {
    {&amp;quot;load&amp;quot;, TimeSeries_load, METH_VARARGS, &amp;quot;loads a TimeSeries from a file&amp;quot;},
    {&amp;quot;deserialize&amp;quot;, TimeSeries_deserialize, METH_VARARGS, &amp;quot;loads a TimeSeries from a string&amp;quot;}
};

#ifndef PyMODINIT_FUNC  /* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
PyMODINIT_FUNC inittimeseries(void)
{
    import_array();
    (void) Py_InitModule(&amp;quot;timeseries&amp;quot;, TSMethods);
}
&lt;/pre&gt;
&lt;p&gt;Calling the exension from python is trivial:&lt;/p&gt;
&lt;pre class=&quot;brush: python&quot;&gt;
import time
import timeseries
start = time.time()
t, v = timeseries.load(&amp;#039;ts.bin&amp;#039;)
print &amp;quot;read and converted to numpy array in %f&amp;quot; % (time.time()-start)
print &amp;quot;timeseries contained %d values&amp;quot; % len(v)
&lt;/pre&gt;</description>
	<pubDate>Wed, 07 Jul 2010 19:17:49 +0000</pubDate>
</item>
<item>
	<title>Titus Brown: A memory efficient way to remove low-abundance k-mers from large (metagenomic?) DNA data sets</title>
	<guid>http://ivory.idyll.org/blog/2010/07/07/kmer-filtering</guid>
	<link>http://ivory.idyll.org/blog/jul-10/kmer-filtering</link>
	<description>&lt;div class=&quot;document&quot;&gt;
&lt;p&gt;I've spent the last few weeks working on a simple solution to a
challenging problem in DNA sequence assembly, and I think we've got a
nice simple theoretical solution with an actual implementation.  I'd
be interested in comments!&lt;/p&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;introduction&quot; name=&quot;introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Briefly, the algorithmic challenge is this:&lt;/p&gt;
&lt;p&gt;We have a bunch of DNA sequences in (let's say) FASTA format,&lt;/p&gt;
&lt;pre class=&quot;literal-block&quot;&gt;
&amp;gt;850:2:1:1145:4509/1
CCGAGTCGTTTCGGAGGGACCCCGCCATCATACTCGGGGAATTCATCTGAAAGCATGATCATAGAGTCACCGAGCA
&amp;gt;850:2:1:1145:4509/2
AGCCAAGAGCACCCCAGCTATTCCTCCCGGACTTCATAACGTAACGGCCTACCTCGCCATTAAGACTGCGGCGGAG
&amp;gt;850:2:1:1145:14575/1
GACGCAAAAGTAATCGTTTTTTGGGAACATGTTTTCATCCTGATCATGTTCCTGCCGATTCTGATCTCGCGACTGG
&amp;gt;850:2:1:1145:14575/2
TAACGGGCTGAATGTTCAGGACCACGTTTACTACCGTCGGGTTGCCATACTTCAACGCCAGCGTGAAAAAGAACGT
&amp;gt;850:2:1:1145:2219/1
GAAGACAGAGTGGTCGAAAGCTATCAGACGCGATGCCTAACGGCATTTTGTAGGGCGTCTGCGTCAGACGCCAACC
&amp;gt;850:2:1:1145:2219/2
GAAGGCGGGTAATGTCCGACAAACATTTGACGTCAAAGCCGGCTTTTTTGTAGTGGGTTTGACTCTTTCGCTTCCG
&amp;gt;850:2:1:1145:5660/1
GATGGCGTCGTCCGGGTGCCCTGGTGGAAGTTGCGGGGATGCGGATTCATCCGGGACGCGCAGACGCAGGCGGTGG
&lt;/pre&gt;
&lt;p&gt;and we want to pre-filter these sequences so that only sequences
containing high-abundance DNA words of length k (&amp;quot;k-mers&amp;quot;),
remain. For example, given a set of DNA sequences, we might want to
remove any sequence that does not contain a k-mer present at least 5
times in the entire data set.&lt;/p&gt;
&lt;p&gt;This is very straightforward to do for small numbers of sequences, or
for small k.  Unfortunately, we are increasingly confronted by data sets
containing 250 million sequences (or more), and we would like to be
able to do this for large k (k &amp;gt; 20, at least).&lt;/p&gt;
&lt;p&gt;You can break the problem down into two basic steps: first,
counting k-mers; and second, filtering sequences based on those k-mer
counts.  It's not immediately obvious how you would parallelize this
task: the counting should be very quick (basically, it's I/O
bound) while the filtering is going to rely on wide-reaching lookups
that aren't localized to any subset of k-mer space.&lt;/p&gt;
&lt;p&gt;tl; dr? we've developed a way to do this for arbitrary k, in linear
time and constant memory, efficiently utilizing as many computers as
you have available.  It's open source and works today, but, uhh, could
use some documentation...&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;digression-the-bioinformatics-motivation&quot; name=&quot;digression-the-bioinformatics-motivation&quot;&gt;Digression: the bioinformatics motivation&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;(You can skip this if you're not interested in the biological motivation ;)&lt;/p&gt;
&lt;p&gt;What we &lt;em&gt;really&lt;/em&gt; want to do with this kind of data is assemble it,
using a &lt;a class=&quot;reference&quot; href=&quot;http://en.wikipedia.org/wiki/De_Bruijn_graph&quot;&gt;De Bruijn graph approach&lt;/a&gt; a la &lt;a class=&quot;reference&quot; href=&quot;http://genome.cshlp.org/content/18/5/821.full&quot;&gt;Velvet&lt;/a&gt;, &lt;a class=&quot;reference&quot; href=&quot;http://www.bcgsc.ca/platform/bioinfo/software/abyss&quot;&gt;ABySS&lt;/a&gt;, or
&lt;a class=&quot;reference&quot; href=&quot;http://soap.genomics.org.cn/soapdenovo.html&quot;&gt;SOAPdenovo&lt;/a&gt;.
However, De Bruijn graphs all rely on building a graph of overlapping
k-mers in memory, which means that their memory usage scales as a
function of the number of unique k-mers.  This is good in general, but
Bad in certain circumstances -- in particular, whenever the data set
you're trying to assemble has a lot of genomic novelty.  (See &lt;a class=&quot;reference&quot; href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/20211242&quot;&gt;this
fantastic review&lt;/a&gt; and
my &lt;a class=&quot;reference&quot; href=&quot;http://ged.msu.edu/angus/files/lecture5-assembly.pdf&quot;&gt;assembly lecture&lt;/a&gt; for some
background here.)&lt;/p&gt;
&lt;p&gt;One particular circumstance in which De Bruijn graph-based assemblers
flail is in &lt;a class=&quot;reference&quot; href=&quot;http://en.wikipedia.org/wiki/Metagenomics&quot;&gt;metagenomics&lt;/a&gt;, the isolation and
sequencing of genetic material from &amp;quot;the wild&amp;quot;, e.g.  soil or the
human gut.  This is largely because the diversity of bacteria present
in soil is so huge (although the relatively high error rate of
next-gen platforms doesn't help).&lt;/p&gt;
&lt;p&gt;Prefiltering can help reduce this memory usage by removing erroneous
sequences as well as not-so-useful sequences.  First, any sequence
arising as the result of a sequencing error is going to be extremely
rare, and abundance filtering will remove those.  Second, genuinely
&amp;quot;rare&amp;quot; (shallowly-sequenced) sequences will generally not contribute
much to the assembly, and so removing them is a good heuristic for
reducing memory usage.&lt;/p&gt;
&lt;p&gt;We are currently playing with dozens (probably hundreds, soon) of gigabytes
of metagenomic data, and we really need to do this prefiltering in order
to have a chance at getting a useful assembly out of it.&lt;/p&gt;
&lt;p&gt;It's worth noting that this is in no way an original thought: in
particular, the Beijing Genome Institute (BGI) did this kind of
prefiltering in their landmark Human Microbiome paper (&lt;a class=&quot;reference&quot; href=&quot;http://www.nature.com/nature/journal/v464/n7285/full/nature08821.html&quot;&gt;ref&lt;/a&gt;).
We want to do it, too, and the BGI wasn't obliging enough to give
us source code (booooooo hisssssssssssssss).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;existing-approaches&quot; name=&quot;existing-approaches&quot;&gt;Existing approaches&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Existing approaches are inadequate to our needs, as far as we can tell
from a literature survey and private conversations.  Everyone seems
to rely on big-RAM machines, which are nice if you have them, but shouldn't
be necessary.&lt;/p&gt;
&lt;p&gt;There are two basic approaches.&lt;/p&gt;
&lt;p&gt;First, you can build a large table in memory, and then map k-mers into
it.  This involves writing a simple hash function that converts DNA
words into numbers.  However, this approach scales poorly with k: for
example, there are 4**k unique DNA sequences of length k (or roughly
(4**k) / 2 + (4**(k/2))/2, considering reverse complements).  So the table
for k=17 needs 4**17 entries -- that's 17 gb at 1 byte per counter,
which stretches the memory of cheaply available commodity hardware.
And we want to use bigger k than 17 -- most assemblers will be more
effective for longer k, because it's more specific.  (We've been using
k values between 30 and 70 for our assemblies, and we'd like to filter
on the same k.)&lt;/p&gt;
&lt;p&gt;Second, you can observe that k-mer space (for sufficiently large k) is
likely to be quite sparsely occupied -- after all, there's only so
many actual 30-mers present in a 100gb data set! So, you can do
something clever like use a tree representation of k-mers and then
attach counters to the end nodes of the tree (see, for example,
&lt;a class=&quot;reference&quot; href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/18976482&quot;&gt;tallymer&lt;/a&gt;.  The
problem here that you need to use pointers to connect nodes in the
tree, which means that while the tree size is going to scale with the
amount of novel k-mers -- ok! -- it's going to have a big constant in
front of it -- bad!.  In our experience this has been prohibitive for
real metagenomic data filtering.&lt;/p&gt;
&lt;p&gt;These seem to be the two dominant approaches, although if you don't
need to actually &lt;em&gt;count&lt;/em&gt; the k-mers but only assess presence or
absence, you can use something like a &lt;a class=&quot;reference&quot; href=&quot;http://en.wikipedia.org/wiki/Bloom_filter&quot;&gt;Bloom filter&lt;/a&gt; -- for example, see
&lt;a class=&quot;reference&quot; href=&quot;http://bioinformatics.oxfordjournals.org/cgi/content/full/26/13/1595&quot;&gt;Classification of DNA sequences using a Bloom filter&lt;/a&gt;,
which uses Bloom filters to look for novel sequences (the exact
opposite of what we want to do here!).  References to other approaches
welcome...&lt;/p&gt;
&lt;p&gt;Note that you really, really, really want to avoid disk access by
keeping everything in memory.  These are ginormous data sets and we
would like to be able to quickly explore different parameters and
methods of sequence selection.  So we want to come up with a good counting
scheme for k-mers that involves relatively small amounts of memory and
as little disk access as possible.&lt;/p&gt;
&lt;p&gt;I think this is a really fun kind of problem, actually.  The more
clever you are, the more likely you are to come up with a completely
inappropriate data structure, given the amount of data and the basic
algorithmic requirements.  It demands KISS!  Read on...&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;an-approximate-approach-to-counting&quot; name=&quot;an-approximate-approach-to-counting&quot;&gt;An approximate approach to counting&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;So, we've come up with a solution that scales with the amount of
genomic novelty, and efficiently uses your available memory.  It can
also make effective use of multiple computers (although not multiple
processors).  What is this magic approach?&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;reference&quot; href=&quot;http://en.wikipedia.org/wiki/Hash_table&quot;&gt;Hash tables&lt;/a&gt;.  Yep.  Map
k-mers into a fixed-size table (presumably one about as big as your
available memory), and have the table entries be counters for k-mer
abundance.&lt;/p&gt;
&lt;p&gt;This is an obvious solution, except for one problem: collisions.  The
big problem with hash tables is that you're going to have collisions,
wherein multiple k-mers are mapped into a single counting bin.  Oh
noes!  The traditional way to deal with this is to keep track of each
k-mer individually -- e.g. when there's a collision, use some sort of
data structure (like a linked list) to track the actual k-mers that
mapped to a particular bin.  But now you're stuck with using gobs of
memory to keep these structures around, because each collision
requires a new pointer of some sort.  It may be possible to get around
this efficiently, but I'm not smart enough to figure out how.&lt;/p&gt;
&lt;p&gt;Instead of becoming smarter, I reconfigured my brain to look at the problem
differently.  (Think Different?)&lt;/p&gt;
&lt;p&gt;The big realization here is that collisions &lt;strong&gt;may not matter&lt;/strong&gt; all
that much.  Consider the situation where you're filtering on a maximum
abundance of 5 -- that is, you want at least one k-mer in each
sequence to be present five or more times across the data set.  Well,
if you look at the hash bin for a specific k-mer and see the number
&lt;strong&gt;4&lt;/strong&gt;, you immediately know that whether or not there are any
collisions, that particular k-mer isn't present five or more times,
and can be discarded!  That is, the count for a particular hash bin is
the sum of the (non-negative) individual counts for k-mers mapping to
that bin, and hence that sum is an upper bound on any individual
k-mer's abundance.&lt;/p&gt;
&lt;img alt=&quot;http://ivory.idyll.org/permanent/kmer-hashtable.png&quot; src=&quot;http://ivory.idyll.org/permanent/kmer-hashtable.png&quot; /&gt;
&lt;p&gt;The tradeoff is false positives: as k-mer space fills up, the hash
table is going to be hit by more and more collisions.  In turn, more
of the k-mers are going to be falsely reported as being over the
minimum abundance, and more of the sequences will be kept.  You can
deal with this partly by doing iterative filtering with different
prime hash table sizes, but that will be of limited utility if you
have a really saturated hash table.&lt;/p&gt;
&lt;p&gt;Note that the counting and filtering is still O(N), while the false
positives grow as a function of k-mer space occupancy -- which is to
say that the more diversity you have in your data, the more trouble
you're in.  That's going to be a problem no matter the approach, however.&lt;/p&gt;
&lt;p&gt;You can see a simple example of approximate and iterative filtering
here, for k=15 (a k-mer space of approximately 1 billion) and hash
table sizes ranging from 50m to 100m.  The curves all approach the
correct final number of reads (which we can calculate exactly, for
this data set) but some take longer than others.  (The code for this
is &lt;a class=&quot;reference&quot; href=&quot;http://github.com/ctb/khmer/blob/master/scripts/ctb-iterative-bench-2.py&quot;&gt;here&lt;/a&gt;.)&lt;/p&gt;
&lt;img alt=&quot;http://ivory.idyll.org/permanent/kmer-filtering-iterative.png&quot; src=&quot;http://ivory.idyll.org/permanent/kmer-filtering-iterative.png&quot; /&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;making-use-of-multiple-computers&quot; name=&quot;making-use-of-multiple-computers&quot;&gt;Making use of multiple computers&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;While I was working out the details of the (really simple) approximate
counting approach, I was bugged by my inability to make effective use
of all the juicy computers to which I have access.  I don't have many
&lt;em&gt;big&lt;/em&gt; computers, but I do have lots of medium sized computers with
memory in the ~10-20 gb range.  How can I use them?&lt;/p&gt;
&lt;p&gt;This is not a pleasantly parallel problem, for at least two reasons.
First, it's I/O bound -- reading the DNA sequences in takes more time
than breaking them down into k-mers and counting them.  And since it's
really memory bound -- you want to use the biggest hash table possible
to minimize collisions
-- it doesn't seem like using multiple processors on a single machine
will help.  Second, the hash table is going to be too big to
effectively share between computers: 10-20 gb of data per computer is
too much to send over the network.  So what do we do?&lt;/p&gt;
&lt;p&gt;I was busy explaining to &lt;a class=&quot;reference&quot; href=&quot;http://en.wikipedia.org/wiki/Charles_Ofria&quot;&gt;a colleague&lt;/a&gt; that this was
impossible -- always a useful way for me to solve problems ;) -- when
it hit me that you could use &lt;em&gt;multiple chassis&lt;/em&gt; (RAM + CPU + disk) to
decrease the false positive rate with only a small amount of
communication overhead.  Basically, my approach is to partition k-mer
space into Z subsets (one for each chassis) and have each computer count
only the k-mers that fall into their partition.  Then, after the
counting stage, each chassis records a max k-mer abundance per
partition per sequence, and communicates &lt;em&gt;that&lt;/em&gt; to a central
node.  This central node in turn calculates the max k-mer abundance
across all partitions.&lt;/p&gt;
&lt;p&gt;The partitioning trick is a more general form of the specific 'prefix'
approach -- that is, separately count and get max abundances/sequence
for all k-mers starting with 'A', then 'C', then 'G', and then 'T'.
For each sequence you will then have four values (the max
abundance/sequence for k-mers start with 'A', 'C', 'G', and 'T'),
which can be cheaply stored on disk or in memory.  Now you can do a
single-pass integration and figure out what sequences to keep.&lt;/p&gt;
&lt;p&gt;This approach effectively multiplies your working
memory by a factor of Z, decreasing your false positive rate
equivalently - no mean feat!&lt;/p&gt;
&lt;img alt=&quot;http://ivory.idyll.org/permanent/kmer-hashtable-par.png&quot; src=&quot;http://ivory.idyll.org/permanent/kmer-hashtable-par.png&quot; /&gt;
&lt;img alt=&quot;http://ivory.idyll.org/permanent/kmer-filter-process-2.png&quot; src=&quot;http://ivory.idyll.org/permanent/kmer-filter-process-2.png&quot; /&gt;
&lt;p&gt;The communication load is significant but not prohibitive: replicate a
read-only sequence data set across Z computers, and then communicate
max values (1 byte for each sequence) back -- 50-500 mb of data per
filtering round.  The result of each filtering round can be returned
to each node as a readmask against the already-replicated initial
sequence set, with one bit per sequence for ignore or process.  You can
even do it on a single computer, with a local hard drive, in multiple
iterations.&lt;/p&gt;
&lt;p&gt;You can see a simple in-memory implementation of this approach &lt;a class=&quot;reference&quot; href=&quot;http://github.com/ctb/khmer/blob/master/python/khmer/split.py&quot;&gt;here&lt;/a&gt;,
and some tests &lt;a class=&quot;reference&quot; href=&quot;http://github.com/ctb/khmer/blob/master/python/test_split.py&quot;&gt;here&lt;/a&gt;.
I've implemented this using readmask tables and min/max tables (serializable
data structures) more generally, too; see &amp;quot;the actual code&amp;quot;, below.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;similar-approaches&quot; name=&quot;similar-approaches&quot;&gt;Similar approaches&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;By allowing for false positives, I've effectively turned the hash
table into a probabilistic data structure.  The closest analog I've
seen is the &lt;a class=&quot;reference&quot; href=&quot;http://en.wikipedia.org/wiki/Bloom_filter&quot;&gt;Bloom filter&lt;/a&gt; which records
presence/absence information using multiple hash functions for
arbitrary k.  The hash approach outlined above devolves into a
maximally efficient Bloom filter for fixed k when only
presence/absence information is recorded.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;the-actual-code&quot; name=&quot;the-actual-code&quot;&gt;The actual code&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Theory and practice are the same, in theory.  In practice, of course,
they differ.  A whole host of minor interface and implementation
design decisions needed to be made.  The result can be seen at the
'khmer' project, here: &lt;a class=&quot;reference&quot; href=&quot;http://github.com/ctb/khmer&quot;&gt;http://github.com/ctb/khmer&lt;/a&gt;.  It's slim on
documentation, but there are some example scripts and a reasonable
amount of tests.  It requires nothing but Python 2.6 and a compiler;
nose if you want to run the tests.&lt;/p&gt;
&lt;p&gt;The implementation is in C++ with a Python wrapper, much like the
paircomp and motility software packages.&lt;/p&gt;
&lt;p&gt;It will filter 1m 70-mer sequences in about 45 seconds, and 80 million sequences
in less than an hour, on a 3 GHz Xeon with 16 gbs of RAM.&lt;/p&gt;
&lt;p&gt;Right now it's limited to k &amp;lt;= 32, because we encode each DNA k-mer in
a 64-bit 'long long'.&lt;/p&gt;
&lt;p&gt;You can see an exact filtering script here:
&lt;a class=&quot;reference&quot; href=&quot;http://github.com/ctb/khmer/blob/master/scripts/filter-exact.py&quot;&gt;http://github.com/ctb/khmer/blob/master/scripts/filter-exact.py&lt;/a&gt; .  By
varying the hash table size (second arg to new_hashtable) you can turn
it into an &lt;em&gt;inexact&lt;/em&gt; filtering script quite easily.&lt;/p&gt;
&lt;p&gt;Drop me a note if you want help using the code, or a specific example.
We're planning to write documentation, doctests, examples, robust
command line scripts, etc. prior to publication, but for now we're
primarily trying to use it.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;other-uses&quot; name=&quot;other-uses&quot;&gt;Other uses&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;It has not escaped our notice that you can use this approach for a bunch of
other k-mer based problems, such as repeat discovery and calculating abundance
distributions... but right now we're focused on actually using it for
filtering metagenomic data sets prior to assembly.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;acks&quot; name=&quot;acks&quot;&gt;Acks&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;I talked a fair bit with Prof. Rich Enbody about this approach, and he
did a wonderful job of double-checking my intuition.  Jason Pell and
Qingpeng Zhang are co-authors on this project; in particular, Jason
helped write the C++ code, and Qingpeng has been working with k-mers
in general and tallymer in specific on some other projects, and
provided a lot of background help.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot;&gt;
&lt;h1&gt;&lt;a id=&quot;conclusions&quot; name=&quot;conclusions&quot;&gt;Conclusions&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;We've taken a previously hard problem and made it practically
solvable: we can filter ~88m sequences in a few hours on a
single-processor computer with only 16gb of RAM.  This seems useful.&lt;/p&gt;
&lt;p&gt;Our main challenge now is to come up with a better hashing function.
Our current hash function is not uniform, even for a
uniform distribution of k-mers, because of the way it handles reverse
complements.&lt;/p&gt;
&lt;p&gt;The approach scales reasonably nicely.  Doubling the amount of data
doubles the compute time.  However, if you have double the novelty,
you'll need to do double the partitions to keep the same false
positive rate, in which case you quadruple the compute time.  So it's
O(N^2) for the worst case (unending novelty) but should be something
better for real-world cases.  That's what we'll be looking at over
the next few months.&lt;/p&gt;
&lt;p&gt;I haven't done enough background reading to figure out if our approach
is particularly novel, although in the space of bioinformatics it seems
to be reasonably so.  That's less important than actually solving our
problem, but it would be nice to punch the &amp;quot;publication&amp;quot; ticket if possible.
We're thinking of writing it up and sending it to BMC Bioinformatics,
although suggestions are welcome.&lt;/p&gt;
&lt;p&gt;It would be particularly ironic if the first publication from my lab
was this computer science-y, given that I have no degrees in CS and
am in the CS department by kind of a fluke of the hiring process ;).&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
	<pubDate>Wed, 07 Jul 2010 15:09:20 +0000</pubDate>
</item>
<item>
	<title>Matthieu Brucher: QtVST: a Chamberlin Variable Filter</title>
	<guid>http://matt.eifelle.com/?p=1251</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/GXW3XSNs5Ew/</link>
	<description>&lt;p&gt;After &lt;a href=&quot;http://matt.eifelle.com/2010/03/02/fixing-the-qtagain-plugin/&quot;&gt;my last post on QtAgain&lt;/a&gt;, I&amp;#8217;ve decided to test a few simple digital filters. I&amp;#8217;ve tried to make them as generic as possible, and with a VST interface.&lt;br /&gt; &lt;span id=&quot;more-1251&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4&gt;A templated Chamberlin filter&lt;/h4&gt;&lt;p&gt;A Chamberlin filter is a IIR (Infinite Impulse Response) filter, and it is possible to make it output high-, band- or low-pass signals. It has only two parameters that are independent.&lt;/p&gt;&lt;p&gt;The equations are very simple:&lt;br /&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/equations.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/equations.png&quot; alt=&quot;&quot; title=&quot;Chamberlin Equations&quot; class=&quot;aligncenter size-full wp-image-1279&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;Each of the series is either the low-pass, the band-pass or the high-pass output.&lt;/p&gt;&lt;p&gt;There are some factors that are pre-computed:&lt;br /&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/factors.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/07/factors.png&quot; alt=&quot;&quot; title=&quot;Digital Factors&quot; class=&quot;aligncenter size-full wp-image-1280&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;The first is a function of the &lt;strong&gt;C&lt;/strong&gt;ut frequency and the &lt;strong&gt;S&lt;/strong&gt;ampling frequency, a &amp;#8220;numerical frequency&amp;#8221;. The second one is the numerical attenuation, between 0 and 2.&lt;/p&gt;&lt;p&gt;This is an excerpt of the actual code, I&amp;#8217;ve only displayed the relevant code.&lt;/p&gt;&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot; title=&quot;WP-CodeBox HowTo?&quot;&gt;&lt;span&gt;?&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;left2&quot;&gt;Download &lt;a href=&quot;http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=1251&amp;amp;download=variable_filter.h&quot;&gt;variable_filter.h&lt;/a&gt;&lt;/span&gt;&lt;div class=&quot;codebox_clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p125110&quot;&gt;&lt;td class=&quot;code&quot; id=&quot;p1251code10&quot;&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span&gt;template&lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;class&lt;/span&gt; Data_Type&lt;span&gt;&amp;gt;&lt;/span&gt;
&lt;span&gt;class&lt;/span&gt; VariableFilter
&lt;span&gt;&amp;#123;&lt;/span&gt;
&lt;span&gt;public&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;
  &lt;span&gt;typedef&lt;/span&gt; Data_Type DataType&lt;span&gt;;&lt;/span&gt;
&amp;nbsp;
  &lt;span&gt;void&lt;/span&gt; process&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;const&lt;/span&gt; DataType&lt;span&gt;*&lt;/span&gt; in, DataType&lt;span&gt;*&lt;/span&gt; out, &lt;span&gt;unsigned&lt;/span&gt; &lt;span&gt;long&lt;/span&gt; nb_samples&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#123;&lt;/span&gt;
    &lt;span&gt;for&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;unsigned&lt;/span&gt; &lt;span&gt;long&lt;/span&gt; i &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; i &lt;span&gt;&amp;lt;&lt;/span&gt; nb_samples&lt;span&gt;;&lt;/span&gt; &lt;span&gt;++&lt;/span&gt;i&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;&amp;#123;&lt;/span&gt;
      yh &lt;span&gt;=&lt;/span&gt; in&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; yl &lt;span&gt;-&lt;/span&gt; numerical_attenuation &lt;span&gt;*&lt;/span&gt; yb&lt;span&gt;;&lt;/span&gt;
      yb &lt;span&gt;=&lt;/span&gt; numerical_frequency &lt;span&gt;*&lt;/span&gt; yh &lt;span&gt;+&lt;/span&gt; yb&lt;span&gt;;&lt;/span&gt;
      yl &lt;span&gt;=&lt;/span&gt; numerical_frequency &lt;span&gt;*&lt;/span&gt; yb &lt;span&gt;+&lt;/span&gt; yl&lt;span&gt;;&lt;/span&gt;
      &lt;span&gt;if&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;selected &lt;span&gt;==&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
      &lt;span&gt;&amp;#123;&lt;/span&gt;
        out&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; yl&lt;span&gt;;&lt;/span&gt;
      &lt;span&gt;&amp;#125;&lt;/span&gt;
      &lt;span&gt;else&lt;/span&gt; &lt;span&gt;if&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;selected &lt;span&gt;==&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
      &lt;span&gt;&amp;#123;&lt;/span&gt;
        out&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; yb&lt;span&gt;;&lt;/span&gt;
      &lt;span&gt;&amp;#125;&lt;/span&gt;
      &lt;span&gt;else&lt;/span&gt;
      &lt;span&gt;&amp;#123;&lt;/span&gt;
        out&lt;span&gt;&amp;#91;&lt;/span&gt;i&lt;span&gt;&amp;#93;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; yh&lt;span&gt;;&lt;/span&gt;
      &lt;span&gt;&amp;#125;&lt;/span&gt;
    &lt;span&gt;&amp;#125;&lt;/span&gt;
  &lt;span&gt;&amp;#125;&lt;/span&gt; 
&amp;nbsp;
&lt;span&gt;protected&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;
  &lt;span&gt;void&lt;/span&gt; compute_factors&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#123;&lt;/span&gt;
    numerical_frequency &lt;span&gt;=&lt;/span&gt; &lt;span&gt;2&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; std&lt;span&gt;::&lt;/span&gt;&lt;span&gt;sin&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;M_PI &lt;span&gt;*&lt;/span&gt; cutoff_frequency &lt;span&gt;/&lt;/span&gt; sampling_frequency&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
    numerical_attenuation &lt;span&gt;=&lt;/span&gt; &lt;span&gt;2&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; attenuation&lt;span&gt;;&lt;/span&gt;
  &lt;span&gt;&amp;#125;&lt;/span&gt;
&lt;span&gt;&amp;#125;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;Now, I&amp;#8217;ve written a simple GUI for this plugin.&lt;/p&gt;&lt;h4&gt;GUI with Qt&lt;/h4&gt;&lt;p&gt;I&amp;#8217;ve used the QtAgain skeletton to wrap the filter and to make it available to &lt;a href=&quot;http://matt.eifelle.com/2010/03/09/annoucement-pyvst-0-1/&quot;&gt;PyVST&lt;/a&gt;. It&amp;#8217;s really easy to add other parameters to the skeletton, so I will not write everything here again. There are three parameters, 2 numerical ones, and one three-state variable.&lt;/p&gt;&lt;p&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/editor.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/editor-300x102.png&quot; alt=&quot;&quot; title=&quot;Chamberlin editor&quot; width=&quot;300&quot; height=&quot;102&quot; class=&quot;aligncenter size-medium wp-image-1274&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;&lt;h4&gt;Results&lt;/h4&gt;&lt;p&gt;I&amp;#8217;ve recorded the filter&amp;#8217;s outputs for 6kHz as central frequency, and an attenuation factor of .3. The output signal was generated from a random signal, and then an FFT was performed on the inputs and the outputs and displayed.&lt;/p&gt;&lt;p&gt;Note: I didn&amp;#8217;t convert the scale to dB.&lt;/p&gt;&lt;p&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/HighPass.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/HighPass-300x172.png&quot; alt=&quot;&quot; title=&quot;High Pass&quot; width=&quot;300&quot; height=&quot;172&quot; class=&quot;aligncenter size-medium wp-image-1273&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;br /&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/BandPass.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/BandPass-300x172.png&quot; alt=&quot;&quot; title=&quot;Band Pass&quot; width=&quot;300&quot; height=&quot;172&quot; class=&quot;aligncenter size-medium wp-image-1276&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;br /&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/LowPass.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/LowPass-300x172.png&quot; alt=&quot;&quot; title=&quot;Low Pass&quot; width=&quot;300&quot; height=&quot;172&quot; class=&quot;aligncenter size-medium wp-image-1275&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;As you may have noted, the filter amplifies the signal near the central frequency for each output for the attenuation I&amp;#8217;ve selected. The issue is that selecting a higher one has also an impact on the stability of the filter at higher frequencies. The sum of the numerical attenuation and the numerical frequency should always be inferior to 2.&lt;/p&gt;&lt;h4&gt;Conclusion&lt;/h4&gt;&lt;p&gt;This numerical is really simple to implement, and it has few parameters. The dark side of this filter is that is not always stable and the central frequency seems to be always amplified. Other filters can be better balanced.&lt;/p&gt;&lt;p&gt;The code is available on &lt;a href=&quot;https://code.launchpad.net/~matthieu-brucher/+junk/QtVST&quot;&gt;Launchpad&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/UIA7N1qzkOFhqiBTuIt6tcOFZqo/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/UIA7N1qzkOFhqiBTuIt6tcOFZqo/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/UIA7N1qzkOFhqiBTuIt6tcOFZqo/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/UIA7N1qzkOFhqiBTuIt6tcOFZqo/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/GXW3XSNs5Ew&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 06 Jul 2010 07:17:52 +0000</pubDate>
</item>
<item>
	<title>Titus Brown: Teaching scientists how to use computers - hub &amp; spokes</title>
	<guid>http://ivory.idyll.org/blog/2010/07/05/swc-hub-spokes</guid>
	<link>http://ivory.idyll.org/blog/jul-10/swc-hub-spokes</link>
	<description>&lt;div class=&quot;document&quot;&gt;
&lt;p&gt;After my recent &lt;a class=&quot;reference&quot; href=&quot;http://ivory.idyll.org/blog/jun-10/ngs-course-postmortem&quot;&gt;next-gen sequencing course&lt;/a&gt;, which
was supposed to tie into the whole &lt;a class=&quot;reference&quot; href=&quot;http://software-carpentry.org/&quot;&gt;software carpentry (SWC) effort&lt;/a&gt; but didn't really succeed in doing
so the first time through, I started thinking about the Right Way to
tie in the SWC material.  In particular, how do you both motivate
scientists to look at the SWC material, and (re)direct people to the
appropriate places?&lt;/p&gt;
&lt;p&gt;It's not clear that a Plan is in place.  Greg Wilson seems to assume
that scientists will find at least some of the material immediately
obviously usable, but I think he's targetted at a more sophisticated
population of users -- physicists and the like.  My experience with
bioinformaticians, however, is that they either come from straight
biology backgrounds (with little or no computational background and
rather limited on-the-job training), straight computation backgrounds
(with very little biology), or physics (gonzo programming skills, but
no biology).  The latter fit neatly into the SWC fold, but they (we ;)
are rare in biology.  I think computer scientists and biologists are
going to need guidance to dive into SWC at an early enough time for it
to be the most rewarding.&lt;/p&gt;
&lt;p&gt;So, what's a good model for SWC to guide scientists from multiple
disciplines into the appropriate material?  It's obviously not going
to be possible to have Greg et al. tailor the SWC material to individual
subgroups -- he doesn't know much (any ;) biology, for example.  I don't
have the time, patience, or skillset to integrate my next-gen notes
into his SWC material, either.  So, instead, I propose the hub &amp;amp; spokes
model!&lt;/p&gt;
&lt;img alt=&quot;http://ivory.idyll.org/permanent/hub-spokes.png&quot; src=&quot;http://ivory.idyll.org/permanent/hub-spokes.png&quot; /&gt;
&lt;p&gt;Here, the &amp;quot;hub&amp;quot; is the SWC material, and the spokes are all of the
individual disciplines.&lt;/p&gt;
&lt;p&gt;Basically, the idea is that individual sites (like my own ANGUS site
on next-gen sequencing, &lt;a class=&quot;reference&quot; href=&quot;http://ged.msu.edu/angus/&quot;&gt;http://ged.msu.edu/angus/&lt;/a&gt;) will develop their
own field-specific content, and then link from that content into the
SWC notes.  This way the experts with feet in both fields can link
appropriately, and Greg only has to worry about making the central
content general -- which he's already doing quite well, I think.  Yes,
It's more work than asking Greg to do it, but frankly I'm going to be
happy with a kick-ass central SWC site to which I can link -- right
now it's dismayingly challenging to teach students why this stuff
matters and how to learn it.&lt;/p&gt;
&lt;p&gt;From the psychosocial perspective, it's a great fit.  Students can get
hands on tutorials on how to do X, Y, and Z in their own field -- and
then connect into the SWC material to learn the background, or
additional computational techniques in support of it.  Motivation first!&lt;/p&gt;
&lt;p&gt;What do we need SWC to do to support this?  Not much -- basically, the
central SWC notes need to be stable enough (with permalinks) that I
can link into them from my own site(s) and not have to worry about the
links becoming broken or (worse) silently migrating in topic.  There
are other solutions (wholesale incorporation of SWC into my own notes,
for example) but I think the permalink idea is the most
straightforward.  Oh, and we should have a Greg-gets-hit-by-a-bus plan,
too; at some point he's going to move on from SWC (perhaps when his
lovely wife decide she's had enough and he needs to stop obsessing over
it, or perhaps under more dire circumstances ;( and it would be good to
know who holds the domain and site keys.&lt;/p&gt;
&lt;p&gt;Thoughts?  Comments?&lt;/p&gt;
&lt;p&gt;--titus&lt;/p&gt;
&lt;/div&gt;</description>
	<pubDate>Tue, 06 Jul 2010 03:12:24 +0000</pubDate>
</item>
<item>
	<title>EuroSciPy 2010: Euroscipy tutorials: practical information</title>
	<guid>http://www.euroscipy.org/blogentry/3644</guid>
	<link>http://www.euroscipy.org/blogentry/3644</link>
	<description>&lt;img align=&quot;right&quot; alt=&quot;http://farm3.static.flickr.com/2726/4351345406_aa4e0c0f9a_m_d.jpg&quot; class=&quot;align-right&quot; src=&quot;http://farm3.static.flickr.com/2726/4351345406_aa4e0c0f9a_m_d.jpg&quot; /&gt;
&lt;p&gt;The tutorials are closing in, here are a few practical details!&lt;/p&gt;
&lt;div class=&quot;section&quot; id=&quot;venue-and-schedule&quot;&gt;
&lt;h3&gt;&lt;a&gt;Venue and schedule&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The conference will take place at the Ecole Normale Superieure (ENS), 45
rue d'Ulm, 75005 Paris. The registration desk will be located in front of
the Dussane room where the Advanced tutorials will also be given. All
participants should first check in at the registration desk, which will
be opened from 8.15 on Thursday 8th. We expect 140 participants to show
up, so please arrive well before the the first tutorial at 9.00! The
introduction tutorials will be given in a different building (Jules
Ferry room, 29 rue d'Ulm, 75005 Paris) but all participants should go
first to the registration desk in front of the Dussane room.&lt;/p&gt;
&lt;p&gt;To reach the Dussane room, enter the main building of the Ecole Normale
Supérieure, and take the corridor on your left.&lt;/p&gt;
&lt;p&gt;There will be some wifi access in the Dussane room (although we don't
know how it will stand up to dozens of computers connecting at the same
time), but not in the Jules Ferry room.&lt;/p&gt;
&lt;p&gt;All coffee breaks will take place in front of the Dussane room.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;pre-requisites&quot;&gt;
&lt;h3&gt;&lt;a&gt;Pre-requisites&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As most tutorials will be hands-on, you need to install all the required
software on your computer before next Thursday. For the introduction
tutorials, a list of required softwares and Python modules (Python,
Ipython, NumPy, SciPy, Matplotlib) is given on
&lt;a class=&quot;reference&quot; href=&quot;http://www.euroscipy.org/conference/euroscipy2010&quot;&gt;http://www.euroscipy.org/conference/euroscipy2010&lt;/a&gt;, together with links to
distributions (&lt;a class=&quot;reference&quot; href=&quot;http://www.pythonxy.com/&quot;&gt;Python(x,y)&lt;/a&gt; and &lt;a class=&quot;reference&quot; href=&quot;http://www.enthought.com/products/epd.php&quot;&gt;EPD&lt;/a&gt;) that install all these packages at
once (and many others). For Windows users, we recommend installing one of
these distributions. Would you install Python(x,y), make sure to install
the full version. If you are using Linux, all these modules are packaged
for most Linux distributions and can be installed in a few clicks with
the package manager.&lt;/p&gt;
&lt;p&gt;If you have problems installing the software, you may contact us for
help, but please try first to get help around you or browsing the
Internet, as we expect to be quite overwhelmed as the conference is
closing in. Nevertheless, it will a save a lot of time if everybody
arrives with a laptop well setup, so don't hesitate to ask questions.&lt;/p&gt;
&lt;p&gt;For the advanced track, please check on the tutorials description if
other packages or softwares are mentioned (Mayavi, SymPy, PyTables,
Cython, etc.), and if so, install them in addition to the base packages
listed above (or check if they come with your scientific Python distribution).&lt;/p&gt;
&lt;p&gt;Also try to take a computer with a long battery lifetime, as we won't be
able to plug more than a fraction of the computers at the same time.
(Yes, we do have some extension cables, but the electrical circuits of
the rooms are not sized to supply power to 80 laptops at the same time).&lt;/p&gt;
&lt;p&gt;For any questions, please write to &lt;a class=&quot;reference&quot; href=&quot;mailto:info&amp;#64;euroscipy.org&quot;&gt;info&amp;#64;euroscipy.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We are looking forward to seeing you next Thursday!&lt;/p&gt;
&lt;div&gt;&lt;a href=&quot;http://www.flickr.com/photos/saneboy/4351345406/&quot;&gt;photography&lt;/a&gt; under CC by Valentin Ottone&lt;/div&gt;&lt;/div&gt;</description>
	<pubDate>Sun, 04 Jul 2010 23:17:00 +0000</pubDate>
</item>
<item>
	<title>David Cournapeau: cournape</title>
	<guid>http://cournape.wordpress.com/?p=231</guid>
	<link>http://cournape.wordpress.com/2010/07/02/231/</link>
	<description>&lt;p&gt;I have just released bento 0.0.3 (see &lt;a href=&quot;http://cournape.wordpress.com/2010/06/07/bento-ext-toydist-whats-coming-for-0-0-3&quot;&gt;here&lt;/a&gt; for details).&lt;/p&gt;
&lt;p&gt;The release is available on &lt;a href=&quot;http://github.com/cournape/Bento/downloads&quot;&gt;github&lt;/a&gt;&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/cournape.wordpress.com/231/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/cournape.wordpress.com/231/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/cournape.wordpress.com/231/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/cournape.wordpress.com/231/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/cournape.wordpress.com/231/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/cournape.wordpress.com/231/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/cournape.wordpress.com/231/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/cournape.wordpress.com/231/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/cournape.wordpress.com/231/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/cournape.wordpress.com/231/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/cournape.wordpress.com/231/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/cournape.wordpress.com/231/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/cournape.wordpress.com/231/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/cournape.wordpress.com/231/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=cournape.wordpress.com&amp;amp;blog=2210763&amp;amp;post=231&amp;amp;subd=cournape&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Fri, 02 Jul 2010 02:56:11 +0000</pubDate>
</item>
<item>
	<title>SciPy 2010: Travis Oliphant announces...</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-6092708856322832690</guid>
	<link>http://scipy2010.blogspot.com/2010/07/travis-oliphant-announces.html</link>
	<description>(reposted from the &lt;a href=&quot;http://blog.enthought.com/?p=432&quot;&gt;Enthought blog&lt;/a&gt;)&lt;br /&gt;&lt;a href=&quot;http://farm5.static.flickr.com/4119/4752318542_48399a5d20.jpg&quot;&gt;&lt;img alt=&quot;Travis announces project to extend NumPy/SciPy to .Net&quot; height=&quot;375&quot; src=&quot;http://farm5.static.flickr.com/4119/4752318542_48399a5d20.jpg&quot; title=&quot;NumPy/SciPy to .Net&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;(photo: &lt;a href=&quot;http://www.flickr.com/photos/pivanov/4752318542/&quot;&gt;Paul Ivanov&lt;/a&gt;)&lt;br /&gt;Travis Oliphant, President of &lt;a href=&quot;http://www.enthought.com/&quot;&gt;Enthought, Inc.&lt;/a&gt;, kicked off today's SciPy 2010 Day 2 with a great keynote talk. He told the story of his own path to Python, filling his slides with the faces and work of other developers, scientists, and mathematicians —  inspiration, teachers, and collaborators. He explained how his academic trajectory, from electrical engineering, through a brief affair with neuroscience, to a biomedical engineering PhD, both drove and competed with his work creating NumPy. &lt;br /&gt;Last, but not least, Travis closed his talk with rather large announcement: Enthought has undertaken the extension of NumPy and SciPy to the .NET framework. For details on the project refer to the &lt;a href=&quot;http://www.enthought.com/media/SciPyNumPyDotNet.pdf&quot;&gt;official release&lt;/a&gt;.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-6092708856322832690?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Fri, 02 Jul 2010 02:27:39 +0000</pubDate>
	<author>noreply@blogger.com (Amenity Applewhite)</author>
</item>
<item>
	<title>Enthought: Fast Protocol Buffers in Python</title>
	<guid>http://blog.enthought.com/?p=449</guid>
	<link>http://blog.enthought.com/python/numpy/fast-protocol-buffers-in-python/</link>
	<description>&lt;p&gt;A couple of years ago I worked on a project which needed to transport a large dataset over the wire. I looked at a number of technologies, and Google Protocol Buffers looked very interesting. Over the past week, I&amp;#8217;ve been asked about my experience a couple of times, so I hope this provides a little bit of insight into how to use Protocol Buffers in Python when performance matters.&lt;/p&gt;
&lt;p&gt;I wrote a little test case to model the serialization of the data I wanted to send, a list of 100 pairs of arrays, where each array contained 250,000 elements. The raw data size was &lt;strong&gt;381 MB&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;First, I ran the pure python test: the write took &lt;strong&gt;83 seconds&lt;/strong&gt;, the read took &lt;strong&gt;202 seconds&lt;/strong&gt;. Not good.&lt;/p&gt;
&lt;p&gt;Next I tested the same data in C++: the write took &lt;strong&gt;4.4 seconds&lt;/strong&gt; and the read took &lt;strong&gt;2.8 seconds&lt;/strong&gt;. Impressive.&lt;/p&gt;
&lt;p&gt;The obvious path then was to write the serialization code in C++ and expose it through an extension point. The read function, including putting all of the data into numpy arrays now takes &lt;strong&gt;7.5 seconds&lt;/strong&gt;. I only needed the read function from Python, but the write function should take about the same time.&lt;/p&gt;</description>
	<pubDate>Thu, 01 Jul 2010 22:02:57 +0000</pubDate>
</item>
<item>
	<title>Enthought: Travis Oliphant announces…</title>
	<guid>http://blog.enthought.com/?p=432</guid>
	<link>http://blog.enthought.com/python/scipy/travis-oliphant-announces/</link>
	<description>&lt;p&gt;&lt;div class=&quot;wp-caption alignnone&quot;&gt;&lt;a href=&quot;http://farm5.static.flickr.com/4119/4752318542_48399a5d20.jpg&quot;&gt;&lt;img alt=&quot;Travis announces project to extend NumPy/SciPy to .Net&quot; src=&quot;http://farm5.static.flickr.com/4119/4752318542_48399a5d20.jpg&quot; title=&quot;NumPy/SciPy to .Net&quot; width=&quot;500&quot; height=&quot;375&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Travis announces project to extend NumPy/SciPy to .Net&lt;/p&gt;&lt;/div&gt; Travis Oliphant kicked off today&amp;#8217;s SciPy 2010 Day 2 with a great keynote talk. He told the story of his own path to Python, filling his slides with the faces and work of other developers, scientists, and mathematicians —  inspiration, teachers, and collaborators. He explained how his academic trajectory, from electrical engineering, through a brief affair with neuroscience, to a biomedical engineering PhD, both drove and competed with his work creating NumPy.&lt;br /&gt;
Last, but not least, Travis closed his talk with rather large announcement: Enthought has undertaken the extension of NumPy and SciPy to the .NET framework. For details on the project refer to the &lt;a href=&quot;http://www.enthought.com/media/SciPyNumPyDotNet.pdf&quot;&gt;official release&lt;/a&gt;.  &lt;/p&gt;</description>
	<pubDate>Thu, 01 Jul 2010 20:58:20 +0000</pubDate>
	<author>amenity@enthought.com</author>
</item>
<item>
	<title>Enthought: SciPy 2010 underway!</title>
	<guid>http://blog.enthought.com/?p=434</guid>
	<link>http://blog.enthought.com/python/scipy/scipy-2010-underway/</link>
	<description>&lt;p&gt;&lt;div class=&quot;wp-caption alignnone&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/irees/4750743647/&quot;&gt;&lt;img alt=&quot;Everyone minus Ian, the most valiant photographer!&quot; src=&quot;http://farm5.static.flickr.com/4140/4750743647_3799ee6068.jpg&quot; title=&quot;SciPy 2010&quot; width=&quot;500&quot; height=&quot;332&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Everyone minus Ian, the most valiant photographer!&lt;/p&gt;&lt;/div&gt;We were thrilled to host SciPy 2010 in Austin this year. Everyone seems to be enjoying the cool weather (so what if it’s borne of thunderstorms?) and the plush conference center/hotel (even if we had to retrain their A/V team).&lt;br /&gt;
After two days of immensely informative &lt;a href=&quot;https://conference.scipy.org/scipy2010/tutorials.html&quot;&gt;Tutorials&lt;/a&gt;, the General Session began yesterday with speaker &lt;a href=&quot;http://www.dabeaz.com/&quot;&gt;Dave Beazley&amp;#8217;s&lt;/a&gt; awesome keynote on Python concurrency. In addition to the solid line-up of talks at the main conference, we had two very well-attended specialized tracks: &lt;a href=&quot;http://www.delltechcenter.com/page/And+now+for+something+completely+different…++Enthought+Python’s+Flying+Circus&quot;&gt;Glen Otero&lt;/a&gt;, chaired the Bioinformatics track, while &lt;a href=&quot;http://briangranger.blogspot.com/&quot;&gt;Brian Granger&lt;/a&gt; and &lt;a href=&quot;http://www.picloud.com/&quot;&gt;Ken Elkabany&lt;/a&gt; coordinated the Parallel Processing &amp;#038; Cloud Computing talks. The day then closed with a conference reception and guacamole-fueled Birds of a Feather sessions.&lt;br /&gt;
&lt;a href=&quot;http://www.flickr.com/photos/irees/4751294178/&quot; title=&quot;SciPy 2010 by wools, on Flickr&quot;&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4139/4751294178_f8e4049bc4.jpg&quot; width=&quot;500&quot; height=&quot;332&quot; alt=&quot;SciPy 2010&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Thu, 01 Jul 2010 20:28:16 +0000</pubDate>
	<author>amenity@enthought.com</author>
</item>
<item>
	<title>SciPy 2010: SciPy 2010 underway!</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-5774311681037732907</guid>
	<link>http://scipy2010.blogspot.com/2010/07/scipy-2010-underway.html</link>
	<description>(reposted from the &lt;a href=&quot;http://blog.enthought.com/?p=434&quot;&gt;Enthought blog&lt;/a&gt;)&lt;br /&gt;We were thrilled to host SciPy 2010 in Austin this year. Everyone seems to be enjoying the cool weather (so what if it’s borne of thunderstorms?) and the plush conference center/hotel (even if we had to retrain their A/V team). &lt;br /&gt;After two days of immensely informative &lt;a href=&quot;https://conference.scipy.org/scipy2010/tutorials.html&quot;&gt;Tutorials&lt;/a&gt;, the General Session began yesterday with speaker &lt;a href=&quot;http://www.dabeaz.com/&quot;&gt;Dave Beazley's&lt;/a&gt; awesome keynote on Python concurrency. In addition to the solid line-up of talks at the main conference, we had two very well-attended specialized tracks: &lt;a href=&quot;http://www.delltechcenter.com/page/And+now+for+something+completely+different…++Enthought+Python’s+Flying+Circus&quot;&gt;Glen Otero&lt;/a&gt;, chaired the Bioinformatics track, while &lt;a href=&quot;http://briangranger.blogspot.com/&quot;&gt;Brian Granger&lt;/a&gt; and &lt;a href=&quot;http://www.picloud.com/&quot;&gt;Ken Elkabany&lt;/a&gt; coordinated the Parallel Processing &amp;amp; Cloud Computing talks. The day then closed with a conference reception and guacamole-fueled Birds of a Feather sessions. &lt;br /&gt;&lt;a href=&quot;http://www.flickr.com/photos/irees/4751294178/&quot; title=&quot;SciPy 2010 by wools, on Flickr&quot;&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4139/4751294178_f8e4049bc4.jpg&quot; width=&quot;500&quot; height=&quot;332&quot; alt=&quot;SciPy 2010&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-5774311681037732907?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Thu, 01 Jul 2010 15:23:53 +0000</pubDate>
	<author>noreply@blogger.com (Amenity Applewhite)</author>
</item>
<item>
	<title>SciPy 2010: SciPy 2010 Group Photo</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-5702632490417050003</guid>
	<link>http://scipy2010.blogspot.com/2010/07/scipy-2010-group-photo.html</link>
	<description>&lt;a href=&quot;http://www.flickr.com/photos/irees/4750743647/&quot; title=&quot;SciPy 2010 Group Photo&quot;&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4140/4750743647_3799ee6068.jpg&quot; width=&quot;500&quot; height=&quot;332&quot; alt=&quot;DSC_9860&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It took a couple attempts to find a good location for such a large group photo -- but fortunately the conference is only a block or two from the entrance to the beautiful University of Texas Austin campus! Thankyou to everyone for being patient while we moved from spot to spot. You can download large (1024 x 680) and original (4256 x 2828) files on the &lt;a href=&quot;http://www.flickr.com/photos/irees/4750743647/sizes/l/in/photostream/&quot;&gt;photo page.&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-5702632490417050003?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Thu, 01 Jul 2010 14:46:56 +0000</pubDate>
	<author>noreply@blogger.com (Ian Rees)</author>
</item>
<item>
	<title>SciPy 2010: SciPy 2010: Basic Tutorials -- IPython and virtualenv</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-732014143236477989</guid>
	<link>http://scipy2010.blogspot.com/2010/06/scipy-2010-basic-tutorials-ipython-and.html</link>
	<description>The basic tutorials at SciPy were well-taught and allowed someone unfamiliar with numpy, scipy, and ipython (like me!) to get up to speed and productive very quickly.  I now feel confident with the new tools in my python toolbox.  Thanks!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I use virtualenv extensively to control my python site-packages environment.  This allows me to experiment with different versions of the python packages I use, including repository sources, without polluting or corrupting my system's overall python environment.  It's a great tool and easy to use, at least in the Red Hat and Debian-based Linux systems I use daily.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, one thing I discovered was that ipython unfortunately did not work properly in my virtualenv'ed python environments.   Regardless if I had activated a virtualenv environment, ipython always used the system site packages only.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In order for virtualenv to do it's magic in creating a virtual python environment, it relocates python (so that the python path, etc. are set correctly).  For example, if there is a virtualenv in the directory &quot;~/dev/pyenv&quot;, &quot;which python&quot; will return &quot;~/dev/pyenv/bin/python&quot; if that virtualenv is active.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The problem is that the shebang in the ipython script (/usr/bin/ipython on my system) points to the system python, not the virtualenv one.  So whenever ipython is executed, it will use the system python, not the virtualenv one.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are a number of ways to address this.  One could &quot;easy_install ipython&quot; in every virtualenv where ipython is desired.   This seems excessive, and redundant in virtualenv's where the system site packages are included.  Note, you'll still need to &quot;pip install ipython&quot; in virtualenv's without the system site packages included (--no-site-packages option) as that creates a clean and empty python environment with nothing previously installed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One could instead edit the ipython script to shebang &quot;python&quot;, removing the absolute path.  Then, when ipython is executed, it will use whatever python command is in the path.  But if ipython is upgraded, that edit could be lost.  It also directly changes a system package, which is generally not preferred.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Therefore, the best solution is to is just bypass the shebang by running &quot;python /usr/bin/ipython&quot; rather than just &quot;ipython&quot;.  This way, the shebang will be ignored, and the path's python will get run.  This will be the system python if not in a virtualenv environment, or the virtualenv's python if active.   However, remembering to type &quot;python /usr/bin/ipython&quot; instead of &quot;ipython&quot; is a pain.  An alias in .bash_aliases like &quot;alias ipython='python /usr/bin/ipython'&quot; is the answer here.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hopefully this helps others who want to use ipython in their virtualenv environments.  I am looking forward to using these new tools and hear all the cool things people are using python for at the conference proper tomorrow and Thursday.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With this, ipython will work perfectly in both system and virtualenv environments.&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-732014143236477989?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 29 Jun 2010 21:06:00 +0000</pubDate>
	<author>noreply@blogger.com (Eric Floehr)</author>
</item>
<item>
	<title>SciPy 2010: SciPy 2010: Tutorials Day 2 - Mayavi</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-1187377978145180522</guid>
	<link>http://scipy2010.blogspot.com/2010/06/scipy-2010-tutorials-day-2-mayavi.html</link>
	<description>Prabhu Ramachandran is delivering an overview of &lt;a href=&quot;http://code.enthought.com/projects/mayavi/&quot;&gt;Mayavi 2&lt;/a&gt; and some of the finer points of &lt;a href=&quot;http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab.html&quot;&gt;mlab&lt;/a&gt; in particular.  The first exercise was a quick Lorenz attractor visualization (which I got mostly right on the first try).  &lt;code&gt;&lt;a href=&quot;http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#quiver3d&quot;&gt;mlab.quiver3d&lt;/a&gt;&lt;/code&gt; provides a nice one-liner to pop up a view of the data.  Here's a video of the result (with a little tweaking of parameters through the nice UI that comes up).&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-1187377978145180522?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 29 Jun 2010 16:06:25 +0000</pubDate>
	<author>noreply@blogger.com (Travis)</author>
</item>
<item>
	<title>SciPy 2010: SciPy 2010: Tutorials Day 2 - Traits/TraitsUI</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-2303440950297988954</guid>
	<link>http://scipy2010.blogspot.com/2010/06/scipy-2010-tutorials-day-2.html</link>
	<description>&lt;a href=&quot;http://3.bp.blogspot.com/_3SMSqEHAuEQ/TCpUU9i_f_I/AAAAAAAAAnk/LWBm_0A2Dys/s1600/IMG_2817.jpg&quot;&gt;&lt;img src=&quot;http://3.bp.blogspot.com/_3SMSqEHAuEQ/TCpUU9i_f_I/AAAAAAAAAnk/LWBm_0A2Dys/s200/IMG_2817.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5488291814999818226&quot; /&gt;&lt;/a&gt;Corran Webster of Enthought presented a session on &lt;a href=&quot;http://code.enthought.com/projects/traits/&quot;&gt;Traits&lt;/a&gt; in the afternoon.  In particular, he covered &lt;a href=&quot;http://code.enthought.com/projects/traits_gui/&quot;&gt;TraitsUI&lt;/a&gt; with some detail.  Good hands-on exercises resulted in a nice GUI for manipulating data in just a few minutes.  It's good to see how this library is incrementally improving.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;img src=&quot;http://1.bp.blogspot.com/_3SMSqEHAuEQ/TCpVGn2yKuI/AAAAAAAAAns/w0JzNYQEIGE/s200/Picture+10.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5488292668170709730&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-2303440950297988954?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 29 Jun 2010 14:20:24 +0000</pubDate>
	<author>noreply@blogger.com (Travis)</author>
</item>
<item>
	<title>SciPy 2010: Tutorials Day 1 Cont'd #2: HPC with Python</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-7650222260765275853</guid>
	<link>http://scipy2010.blogspot.com/2010/06/tutorials-day-1-contd-2-hpc-with-python.html</link>
	<description>&lt;a href=&quot;http://4.bp.blogspot.com/_W2DrRJQaWUM/TCocS5F4ygI/AAAAAAAAABk/bWM79i2Qa10/s1600/06282010145.jpg&quot;&gt;&lt;img src=&quot;http://4.bp.blogspot.com/_W2DrRJQaWUM/TCocS5F4ygI/AAAAAAAAABk/bWM79i2Qa10/s320/06282010145.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5488230206793107970&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_W2DrRJQaWUM/TCpJLpV0zvI/AAAAAAAAABs/VSBogtdzDxg/s1600/max_speedup.png&quot;&gt;&lt;img src=&quot;http://3.bp.blogspot.com/_W2DrRJQaWUM/TCpJLpV0zvI/AAAAAAAAABs/VSBogtdzDxg/s320/max_speedup.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5488279560329154290&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.calpoly.edu/~phys/faculty_pages/bgranger.html&quot;&gt;Brian Granger&lt;/a&gt; answers questions at the end of an &lt;i&gt;excellent&lt;/i&gt; 4 hour tutorial yesterday on doing parallel computing in Python. Brian started by covering the painful but often overlooked realities of Amdahl’s Law - namely the fact that the maximum speedup is bounded by the fraction of parallel code (see the figure, taken from the tutorial with permission). &lt;br /&gt;&lt;br /&gt;After that, attendees were taken on a whirlwind tour through the lands of &lt;a href=&quot;http://www.cython.org/&quot;&gt;Cython&lt;/a&gt;, &lt;a href=&quot;http://docs.python.org/library/threading.html&quot;&gt;Threading&lt;/a&gt; and &lt;a href=&quot;http://docs.python.org/library/multiprocessing.html&quot;&gt;Multiprocessing&lt;/a&gt; modules of the python standard library (with the requisite discussion of &lt;a href=&quot;http://www.dabeaz.com/GIL/&quot;&gt;the GIL&lt;/a&gt;), interactive parallel usage of IPython using &lt;a href=&quot;http://ipython.scipy.org/doc/nightly/html/parallel/parallel_process.html&quot;&gt;ipcluster&lt;/a&gt;,  PiCloud's &lt;a href=&quot;http://www.picloud.com/&quot;&gt;cloud package&lt;/a&gt;, with brief overviews of &lt;a href=&quot;http://mpi4py.scipy.org/&quot;&gt;Mpi4Py&lt;/a&gt;, and &lt;a href=&quot;http://github.com/ellisonbg/pyzmq&quot;&gt;PyZMQ&lt;/a&gt;, the python wrappers for &lt;a href=&quot;http://www.zeromq.org/&quot;&gt;ØMQ&lt;/a&gt; (Brian pointed to &lt;a href=&quot;http://nichol.as/zeromq-an-introduction&quot;&gt;this blog post by Nicholas Peil&lt;/a&gt; for more on ØMQ)&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-7650222260765275853?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 29 Jun 2010 13:50:48 +0000</pubDate>
	<author>noreply@blogger.com (Paul Ivanov)</author>
</item>
<item>
	<title>Matthieu Brucher: Optimization scikit: a conjugate-gradient optimization</title>
	<guid>http://matt.eifelle.com/?p=1254</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/vDBq41JcUk8/</link>
	<description>&lt;p&gt;In my &lt;a href=&quot;http://matt.eifelle.com/2010/04/27/optimization-scikit-a-gradient-based-optimization/&quot;&gt;last post about optimization&lt;/a&gt;, I&amp;#8217;ve derived my function analytically. Sometimes, it&amp;#8217;s not as easy. Sometimes also, a simple gradient optimization is not enough.&lt;/p&gt;&lt;p&gt;scikits.optimization has a special class for handling numerical differentiation, and several tools for conjugate gradients.&lt;br /&gt; &lt;span id=&quot;more-1254&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4&gt;Numerical Differentiation&lt;/h4&gt;&lt;p&gt;Differentiation is accomplished through helper class. The new function has to be derived from of two classes,&lt;br /&gt; &lt;strong&gt;ForwardFiniteDifferences&lt;/strong&gt; or &lt;strong&gt;CenteredFiniteDifferences&lt;/strong&gt;. In these classes, gradient and Hessian are computed based on the actual cost function. You may also override the gradient so that only the Hessian is numerically computed.&lt;/p&gt;&lt;p&gt;A single parameter, &lt;strong&gt;difference&lt;/strong&gt;, is the delta that will be applied on each parameter to compute the derivatives. This number is arbitrally fixed, and may be changed in numerical differentiation fails.&lt;/p&gt;&lt;p&gt;Here is what a weighted sinc function looks like (the weights are given by &lt;strong&gt;self.a&lt;/strong&gt;):&lt;/p&gt;&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot; title=&quot;WP-CodeBox HowTo?&quot;&gt;&lt;span&gt;?&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;left&quot;&gt;&lt;a href=&quot;javascript:;&quot;&gt;View Code&lt;/a&gt; PYTHON&lt;/span&gt;&lt;div class=&quot;codebox_clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p125413&quot;&gt;&lt;td class=&quot;code&quot; id=&quot;p1254code13&quot;&gt;&lt;pre class=&quot;python&quot;&gt;&lt;span&gt;from&lt;/span&gt; scikits.&lt;span&gt;optimization&lt;/span&gt;.&lt;span&gt;helpers&lt;/span&gt; &lt;span&gt;import&lt;/span&gt; ForwardFiniteDifferences
&amp;nbsp;
&lt;span&gt;class&lt;/span&gt; Function&lt;span&gt;&amp;#40;&lt;/span&gt;ForwardFiniteDifferences&lt;span&gt;&amp;#41;&lt;/span&gt;:
  &lt;span&gt;def&lt;/span&gt; &lt;span&gt;__init__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;:
    ForwardFiniteDifferences.&lt;span&gt;__init__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;self&lt;/span&gt;.&lt;span&gt;a&lt;/span&gt; = numpy.&lt;span&gt;array&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;, &lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;def&lt;/span&gt; &lt;span&gt;__call__&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;, x&lt;span&gt;&amp;#41;&lt;/span&gt;:
    t = numpy.&lt;span&gt;sqrt&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;numpy.&lt;span&gt;sum&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;self&lt;/span&gt;.&lt;span&gt;a&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; x&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;**&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;return&lt;/span&gt; -numpy.&lt;span&gt;sinc&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;numpy.&lt;span&gt;pi&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;h4&gt;Conjugate Gradient&lt;/h4&gt;&lt;p&gt;Conjugate gradient is an optimization technique that uses the new gradient as well as the last descent direction or gradient to create a new descent direction. Besides this, the line search must have some properties. You don&amp;#8217;t need an exact one, but it must obey some rules, known as the Wolfe-Powell rules. There are two formulations, both available in the scikit. I suggest you read some of the reference book I give at the end of the topic to choose the right line search, as well as the appropriate conjugate gradient.&lt;/p&gt;&lt;p&gt;Besides the well-known Fletcher Reeves conjugate gradient, there are several other factors that can be used, as the Polak-Ribière-Polyak that can also be combined with Fletcher-Reeves one to form what is perhaps the best formulation. The different available conjugate gradients are available in the documentation.&lt;/p&gt;&lt;h4&gt;Application&lt;/h4&gt;&lt;p&gt;OK, let&amp;#8217;s see what it can do. I&amp;#8217;ve assembled a Fletcher-Reeves conjugate gradient with Wolfe-Powell rules line search.&lt;/p&gt;&lt;div class=&quot;wp_codebox_msgheader&quot;&gt;&lt;span class=&quot;right&quot;&gt;&lt;sup&gt;&lt;a href=&quot;http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples&quot; target=&quot;_blank&quot; title=&quot;WP-CodeBox HowTo?&quot;&gt;&lt;span&gt;?&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;left&quot;&gt;&lt;a href=&quot;javascript:;&quot;&gt;View Code&lt;/a&gt; PYTHON&lt;/span&gt;&lt;div class=&quot;codebox_clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;wp_codebox&quot;&gt;&lt;table&gt;&lt;tr id=&quot;p125414&quot;&gt;&lt;td class=&quot;code&quot; id=&quot;p1254code14&quot;&gt;&lt;pre class=&quot;python&quot;&gt;mystep = step.&lt;span&gt;FRConjugateGradientStep&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
mylinesearch = line_search.&lt;span&gt;WolfePowellRule&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
mycriterion = criterion.&lt;span&gt;criterion&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;ftol = &lt;span&gt;0.0001&lt;/span&gt;, iterations_max = &lt;span&gt;100&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
myoptimizer = optimizer.&lt;span&gt;StandardOptimizer&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;function = fun,
                                          step = mystep,
                                          line_search = mylinesearch,
                                          criterion = mycriterion,
                                          x0 = numpy.&lt;span&gt;array&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;.35, .45&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;I didn&amp;#8217;t display the result, because in fact it didn&amp;#8217;t finished at 100 iterations.&lt;/p&gt;&lt;p&gt;Here are animations on the evolution of the value of the cost function and the position of the parameters.&lt;/p&gt;&lt;p&gt;&lt;center&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;&lt;center&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;Knowing that Fletcher-Reeves adds to the new gradient a fraction of the last direction, this circular evolution can be understood. In fact, with a simple gradient, it works better, as well as if a Polak-Ribière-Polyak is used. It all depends on how the different ingredients are mixed, as well as if the Wolfe-Powell rules are close to an exact line search.&lt;/p&gt;&lt;h4&gt;Conclusion&lt;/h4&gt;&lt;p&gt;I think that trying different solutions is what is fun about optimizations. With conjugate gradient, a lot of different optimizers can be built. With numerical differentitation, you don&amp;#8217;t have to rely on analytical gradient. Know though that the more the parameters, the longest it takes to compute the gradient (O(n)) and I don&amp;#8217;t even speak about the Hessian (O(n²)).&lt;/p&gt;&lt;p&gt;Here are some useful books that explain the theory and the ideas behind these topics:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/144193765X?ie=UTF8&amp;amp;tag=masbl03-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=144193765X&quot;&gt;Optimization Theory and Methods: Nonlinear Programming&lt;/a&gt;&lt;img class=&quot; hxmcvxtkhsxxstgvfndl hxmcvxtkhsxxstgvfndl&quot; src=&quot;http://www.assoc-amazon.com/e/ir?t=masbl03-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=144193765X&quot; border=&quot;0&quot; alt=&quot;&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/0387303030?ie=UTF8&amp;amp;tag=masbl03-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0387303030&quot;&gt;Numerical Optimization&lt;/a&gt;&lt;img class=&quot; hxmcvxtkhsxxstgvfndl hxmcvxtkhsxxstgvfndl&quot; src=&quot;http://www.assoc-amazon.com/e/ir?t=masbl03-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0387303030&quot; border=&quot;0&quot; alt=&quot;&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/0470183527?ie=UTF8&amp;amp;tag=masbl03-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0470183527&quot;&gt;Engineering Optimization: Theory and Practice&lt;/a&gt;&lt;img class=&quot; hxmcvxtkhsxxstgvfndl hxmcvxtkhsxxstgvfndl&quot; src=&quot;http://www.assoc-amazon.com/e/ir?t=masbl03-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0470183527&quot; border=&quot;0&quot; alt=&quot;&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;&lt;/p&gt;&lt;p&gt;Link to the tutorial code: &lt;a href=&quot;https://code.launchpad.net/~matthieu-brucher/+junk/optimization-tutorials&quot;&gt;Launchpad&lt;/a&gt;.&lt;/p&gt;&lt;form action=&quot;https://www.paypal.com/cgi-bin/webscr&quot; method=&quot;post&quot;&gt; &lt;input type=&quot;hidden&quot; name=&quot;cmd&quot; value=&quot;_xclick&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;business&quot; value=&quot;matthieu.brucher@gmail.com&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;item_name&quot; value=&quot;Buy Me a Coffee!&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;currency_code&quot; value=&quot;USD&quot; /&gt;&lt;span&gt;&lt;strong&gt; Buy Me a Coffee!&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;select id=&quot;amount&quot; name=&quot;amount&quot; class=&quot;&quot;&gt;&lt;option value=&quot;3&quot;&gt;Capuccino - 3$&lt;/option&gt;&lt;option value=&quot;6&quot;&gt;Frappuccino - 6$&lt;/option&gt;&lt;option value=&quot;10&quot;&gt;Hot Chocolate - 10$&lt;/option&gt;&lt;option value=&quot;20&quot;&gt;Expensive Coffee - 20$&lt;/option&gt;&lt;option value=&quot;50&quot;&gt;Alien Coffee - 50$&lt;/option&gt;&lt;/select&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Other Amount:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;amount&quot; size=&quot;10&quot; title=&quot;Other donate&quot; value=&quot;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt; Your Email Address :&lt;/strong&gt;&lt;input type=&quot;hidden&quot; name=&quot;on0&quot; value=&quot;Reference&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;os0&quot; maxlength=&quot;60&quot; /&gt; &lt;br /&gt;&lt;br /&gt; &lt;input type=&quot;hidden&quot; name=&quot;no_shipping&quot; value=&quot;2&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;no_note&quot; value=&quot;1&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;mrb&quot; value=&quot;3FWGC6LFTMTUG&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;bn&quot; value=&quot;IC_Sample&quot; /&gt; &lt;input type=&quot;hidden&quot; name=&quot;return&quot; value=&quot;http://matt.eifelle.com&quot; /&gt;&lt;input type=&quot;image&quot; src=&quot;https://www.paypal.com/en_US/i/btn/x-click-but11.gif&quot; name=&quot;submit&quot; alt=&quot;Make payments with payPal - it's fast, free and secure!&quot; /&gt;&lt;/form&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/lB-3VWSmm7HfrhNIpgT7mt1TeI0/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/lB-3VWSmm7HfrhNIpgT7mt1TeI0/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/lB-3VWSmm7HfrhNIpgT7mt1TeI0/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/lB-3VWSmm7HfrhNIpgT7mt1TeI0/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/vDBq41JcUk8&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 29 Jun 2010 07:36:19 +0000</pubDate>
</item>
<item>
	<title>SciPy 2010: Tutorials Day 1 Cont'd: Signals and Systems</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-6686713333422356135</guid>
	<link>http://scipy2010.blogspot.com/2010/06/tutorials-day-1-contd-signals-and.html</link>
	<description>&lt;a href=&quot;http://2.bp.blogspot.com/_W2DrRJQaWUM/TCjylMCzz2I/AAAAAAAAABc/c3K5nVbrC4k/s1600/GunnarRistrophSigSysjpg&quot;&gt;&lt;img src=&quot;http://2.bp.blogspot.com/_W2DrRJQaWUM/TCjylMCzz2I/AAAAAAAAABc/c3K5nVbrC4k/s320/GunnarRistrophSigSysjpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5487902866653040482&quot; /&gt;&lt;/a&gt;&lt;p&gt; Gunnar Ristroph gave a tutorial in the advanced track on the basics of doing signal processing in Python using &lt;a href=&quot;http://scipy.org/&quot;&gt;scipy&lt;/a&gt;. Here's a link to the materials for his talk: &lt;a href=&quot;http://www.ijkco.com/scipy/Tutorial%2001.pdf&quot;&gt;slides&lt;/a&gt; and &lt;a href=&quot;http://www.ijkco.com/scipy/SciPy.zip&quot;&gt;code with sample data&lt;/a&gt;&lt;span&gt;&lt;span&gt;. He also plugged the work-in-progress &lt;a href=&quot;http://sourceforge.net/apps/mediawiki/python-control/index.php?title=Main_Page&quot;&gt;python-control&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; module which goes beyond the functionality provided by the &lt;a href=&quot;http://docs.scipy.org/doc/scipy/reference/tutorial/signal.html&quot;&gt;scipy.signal&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; module.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-6686713333422356135?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 28 Jun 2010 14:08:14 +0000</pubDate>
	<author>noreply@blogger.com (Paul Ivanov)</author>
</item>
<item>
	<title>SciPy 2010: Tutorials Day 1: Advanced NumPy</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-3732206412747469979</guid>
	<link>http://scipy2010.blogspot.com/2010/06/tutorials-day-1-advanced-numpy.html</link>
	<description>&lt;a href=&quot;http://2.bp.blogspot.com/_VlmUGSIN3wI/TCjG8N5Tb6I/AAAAAAAAAAk/Vywyxl4qfQ8/s1600/stefantut.jpg&quot;&gt;&lt;img src=&quot;http://2.bp.blogspot.com/_VlmUGSIN3wI/TCjG8N5Tb6I/AAAAAAAAAAk/Vywyxl4qfQ8/s320/stefantut.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5487854883775410082&quot; /&gt;&lt;/a&gt;The advanced track tutorials kicked off today with Stéfan van der Walt's advanced NumPy tutorial, &quot;Kittens and Dragons&quot;. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Among other things, he gave an &quot;under the hood&quot; introduction to the &lt;span class=&quot;Apple-style-span&quot;&gt;numpy.ndarray&lt;/span&gt; object, broadcasting and indexing tricks, an introduction to profiling Python code and visualizing your profiling results, a crash course in speeding up your code with Cython, and an example of using the array interface to expose foreign memory to NumPy.&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;His &lt;a href=&quot;http://mentat.za.net/numpy/kittens&quot;&gt;slides and code examples&lt;/a&gt; are now online.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-3732206412747469979?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 28 Jun 2010 10:00:08 +0000</pubDate>
	<author>noreply@blogger.com (David Warde-Farley)</author>
</item>
<item>
	<title>SciPy 2010: SciPy Salsa!</title>
	<guid>tag:blogger.com,1999:blog-8203824369595109529.post-3606506053284988080</guid>
	<link>http://scipy2010.blogspot.com/2010/06/scipy-salsa.html</link>
	<description>&lt;p&gt;A truly Texan treat awaits this year's participants at the registration desk:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_W2DrRJQaWUM/TCfZQgay4tI/AAAAAAAAABU/dstPaStY_sE/s1600/06272010127.jpg&quot;&gt;&lt;img src=&quot;http://2.bp.blogspot.com/_W2DrRJQaWUM/TCfZQgay4tI/AAAAAAAAABU/dstPaStY_sE/s320/06272010127.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5487593548577694418&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/8203824369595109529-3606506053284988080?l=scipy2010.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Sun, 27 Jun 2010 17:06:17 +0000</pubDate>
	<author>noreply@blogger.com (Paul Ivanov)</author>
</item>
<item>
	<title>EuroSciPy 2010: EuroSciPy 2010 Tutorials in the works</title>
	<guid>http://www.euroscipy.org/blogentry/3224</guid>
	<link>http://www.euroscipy.org/blogentry/3224</link>
	<description>&lt;img align=&quot;right&quot; alt=&quot;http://www.europython.eu/images/euro_compo.jpg&quot; class=&quot;align-right&quot; src=&quot;http://www.europython.eu/images/euro_compo.jpg&quot; /&gt;
&lt;p&gt;The tutorials are being worked on at github and discussed on a mailing list. If you want to join us and contribute, subscribe to &lt;a class=&quot;reference&quot; href=&quot;http://lists.python-science.org/cgi-bin/mailman/listinfo/euroscipy-tutorials&quot;&gt;euroscipy-tutorials&lt;/a&gt; and fetch the source from the repositories: &lt;a class=&quot;reference&quot; href=&quot;http://github.com/emmanuelle/Euroscipy-intro-tutorials&quot;&gt;first&lt;/a&gt; and &lt;a class=&quot;reference&quot; href=&quot;http://github.com/GaelVaroquaux/scipy-tutorials&quot;&gt;second&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;photo borrowed from the EuroPython website&lt;/em&gt;&lt;/p&gt;</description>
	<pubDate>Fri, 25 Jun 2010 18:20:00 +0000</pubDate>
</item>
<item>
	<title>Titus Brown: Which functional programming language(s) should we teach?</title>
	<guid>http://ivory.idyll.org/blog/2010/06/24/functional-programming-languages</guid>
	<link>http://ivory.idyll.org/blog/jun-10/functional-programming-languages</link>
	<description>&lt;div class=&quot;document&quot;&gt;
&lt;p&gt;Laurie Dillon just posted the SIGPLAN eduction board article on &lt;a class=&quot;reference&quot; href=&quot;http://mt4.acm.org/educationboard/2010/06/why-undergraduates-should-learn-the-principles-of-programming-languages.html&quot;&gt;Why
Undergraduates Should Learn the Principles of Programming Languages&lt;/a&gt;
to our faculty mailing list at the &lt;a class=&quot;reference&quot; href=&quot;http://www.cse.msu.edu&quot;&gt;MSU Computer Science department&lt;/a&gt;.  One question that came up in the ensuing
conversation was: what functional programming language(s) would/should
we teach?&lt;/p&gt;
&lt;p&gt;I mentioned OCaml, Haskell, and Erlang as reasonably pure but still
pragmatic FP languages.  Anything else that's both &amp;quot;truly&amp;quot; functional
and used somewhat broadly in the real world?&lt;/p&gt;
&lt;p&gt;thanks!&lt;/p&gt;
&lt;p&gt;--titus&lt;/p&gt;
&lt;/div&gt;</description>
	<pubDate>Thu, 24 Jun 2010 18:31:48 +0000</pubDate>
</item>
<item>
	<title>Skipper Seabold: Statsmodels: GSoC Week 4 Update</title>
	<guid>tag:blogger.com,1999:blog-128274497687662608.post-5435399188165828183</guid>
	<link>http://scipystats.blogspot.com/2010/06/statsmodels-gsoc-week-4-update.html</link>
	<description>I spent the last week finishing up the paper that I submitted to accompany my talk at the &lt;a href=&quot;http://conference.scipy.org/scipy2010/&quot;&gt;SciPy conference&lt;/a&gt;.  I am really looking forward to going to Austin and hearing all the great talks (plus I hear the beer is cheap and the food and music are good, which doesn't hurt).  In addition to finishing up the paper, I have started to clean up our time series code.&lt;br /&gt;&lt;br /&gt;So far this has included finishing the augmented Dickey-Fuller (ADF) test for unit roots.  The big time sink here is that the ADF test-statistic has a non-standard distribution in most cases.&amp;nbsp; The ADF test statistic is obtained by running the following regression&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.codecogs.com/eqnedit.php?latex=%5CDelta%20y_%7Bt%7D%20=%20%5Calpha@plus;%5Cbeta%20t@plus;%5Cgamma%20y_%7Bt-1%7D@plus;%5Cdelta_%7B1%7D%5CDelta%20y_%7Bt-1%7D%20@plus;%20%5Ccdots%20@plus;%5Cdelta_%7Bp%7D%5CDelta%20y_%7Bt-p%7D&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://latex.codecogs.com/gif.latex?%5CDelta%20y_%7Bt%7D%20=%20%5Calpha+%5Cbeta%20t+%5Cgamma%20y_%7Bt-1%7D+%5Cdelta_%7B1%7D%5CDelta%20y_%7Bt-1%7D%20+%20%5Ccdots%20+%5Cdelta_%7Bp%7D%5CDelta%20y_%7Bt-p%7D&quot; title=&quot;\Delta y_{t} = \alpha+\beta t+\gamma y_{t-1}+\delta_{1}\Delta y_{t-1} + \cdots +\delta_{p}\Delta y_{t-p}&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One approach to testing for a unit root means testing the t-stat on the coefficient on the lagged level of &lt;i&gt;y&lt;/i&gt;.&amp;nbsp; The actual distribution for this statistic, however, is not Student's t.&amp;nbsp; Many software packages use the tables in Fuller (1976, updated to 1996 version or not) in order to get the critical values for the test statistic depending on the sample size.&amp;nbsp; They use linear interpolation for sample sizes not included in the table.&amp;nbsp; The p-values for the obtained test statistic are usually obtained using MacKinnon's (1994) study that estimated regression surfaces of these distributions via Monte Carlo simulation.&lt;br /&gt;&lt;br /&gt;While we do use MacKinnon's approximate p-values from the 1994 paper, MacKinnon wrote a note updating this paper in early 2010, which gives new regression surface results for obtaining the critical values.&amp;nbsp; We use these new results for the critical values.&amp;nbsp; Therefore, when using our ADF test, it is advised that if the p-value is close to the reject/accept region then the critical values should be used in place of the p-value to make the ultimate decision.&lt;br /&gt;&lt;br /&gt;We can illlustrate the use of ADF.&amp;nbsp; Note that this version is only in my branch and that it is still in the sandbox, even though it has now been tested, because the API and returned results may change.&amp;nbsp; We will demonstrate on a series that we can easily guess is non-stationary, real GDP.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;mycode&quot;&gt;In [1]: import scikits.statsmodels as sm&lt;br /&gt;&lt;br /&gt;In [2]: from scikits.statsmodels.sandbox.tsa.stattools import adfuller&lt;br /&gt;&lt;br /&gt;In [3]: data = sm.datasets.macrodata.load()&lt;br /&gt;&lt;br /&gt;In [4]: realgdp = data.data['realgdp']&lt;br /&gt;&lt;br /&gt;In [5]: adf = adfuller(realgdp, maxlag=4, autolag=None, regression=&quot;ct&quot;)&lt;br /&gt;&lt;br /&gt;In [6]: adf&lt;br /&gt;Out[6]: &lt;br /&gt;(-1.8566384063254346,&lt;br /&gt;&amp;nbsp;0.67682917510440099,&lt;br /&gt;&amp;nbsp;4,&lt;br /&gt;&amp;nbsp;198,&lt;br /&gt;&amp;nbsp;{'1%': -4.0052351400496136,&lt;br /&gt;&amp;nbsp; '10%': -3.1402115863254525,&lt;br /&gt;&amp;nbsp; '5%': -3.4329000694218998})&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The return values are the test statistic, its p-value (the null-hypothesis here is that the series &lt;i&gt;does&lt;/i&gt; contain a unit root), the number of lags of the differences used, the number of observations for the regression, and a dictionary containing the critical values at the respective confidence levels.&amp;nbsp; The regression option controls the type of regression (ie., whether to include a constant or a linear or quadratic time trend), and the autolag option has three options for choosing the lag length to help correct for serial correlation in the regression.&amp;nbsp; There are 'AIC', 'BIC', and 't-stat'.&amp;nbsp; The former two choose the lag length that maximizes the infofrmation criterion, the latter chooses the lag length based on the significance of the lag.&amp;nbsp; This starts with maxlag and works its way down.&amp;nbsp; The docstring has more detailed information.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Beyond this, I have been working on an autocorrelation function (acf), a&amp;nbsp; partial autocorrelation function (pacf), and Q-Statistics (Box-Ljung test).  Next up for this week is finishing my VAR class with identification schemes.&amp;nbsp; After this, I will work to integrate post-estimation tests into our results classes, most likely using some sort of mix-in classes and attach test containers to the results objects for test results.&amp;nbsp; Then it's off to the SciPy conference.  There I will hopefully be participating in the stats sprint, helping out with the docs marathon and discussing what we need for the future of statistics and Python.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;mycode&quot;&gt;Fuller, W.A.&amp;nbsp; 1996.&amp;nbsp; &lt;i&gt;Introduction to Statistical Time Series.&lt;/i&gt; 2nd ed.&amp;nbsp; Wiley.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;MacKinnon, J.G. 1994.&amp;nbsp; &quot;Approximate asymptotic distribution functions for &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit-root and cointegration tests.&amp;nbsp; &lt;i&gt;Journal of Business and Economic&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Statistics&lt;/i&gt; 12, 167-76.&lt;br /&gt;&lt;br /&gt;MacKinnon, J.G. 2010. &quot;Critical Values for Cointegration Tests.&quot;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Queen's University, Dept of Economics, Working Papers.&amp;nbsp; Available at&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; http://ideas.repec.org/p/qed/wpaper/1227.html&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/128274497687662608-5435399188165828183?l=scipystats.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 22 Jun 2010 11:42:19 +0000</pubDate>
	<author>noreply@blogger.com (jseabold)</author>
</item>
<item>
	<title>Matthieu Brucher: Optimally use massively parallel clusters resources</title>
	<guid>http://matt.eifelle.com/?p=1208</guid>
	<link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/ZIWMCGF71KA/</link>
	<description>&lt;p&gt;We have now &lt;a href=&quot;http://www.top500.org/&quot;&gt;several petaflopic clusters available in the Top500&lt;/a&gt;. Of course, we are trying to get the most of their peak computational power, but I think we should sometimes also look at optimal resource allocation.&lt;/p&gt;&lt;p&gt;I&amp;#8217;ve been thinking about this for several months now, for work that has thousands of tasks, each task being massively data parallel. Traditionnally, one launches a job through one&amp;#8217;s favorite batch scheduler (favorite or mandatory&amp;#8230;) with fixed resources and during an estimated amount of time. This may work well in research, but in the industrial world, there often a new job that arises and that needs part of your scarce resources. You may have to stop your work, loose your current advances and/or restart the job with less resources. And then the cycle goes on.&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;more-1208&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4&gt;Static resource allocation&lt;/h4&gt;&lt;p&gt;How can resource allocation work? Let&amp;#8217;s start with a simple case where you have 2 applications with different priorities. One of them has a priority of 70 (it&amp;#8217;s supposed to finish in three days) whereas the other one has a priority of 50 (four days left). They share the cluster so that 66% is allocated to the first application and 33% to the second one.&lt;br /&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/Allocation-2.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/Allocation-2-300x165.png&quot; alt=&quot;&quot; title=&quot;Dispatch and allocation of two applications&quot; width=&quot;300&quot; height=&quot;165&quot; class=&quot;aligncenter size-medium wp-image-1241&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;What happens if a third application must be launched with a higher priority, because it has to ne finished by tomorrow? You may stop the other two programs, you may loose a lot of work if you didn&amp;#8217;t implement checkpoints (besides, one of them may be an of-the-shelf program you bought yesterday) or suspend it. Either way, this is what you will get:&lt;br /&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/Allocation-3.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/Allocation-3-300x165.png&quot; alt=&quot;&quot; title=&quot;Dispatch and allocation for three applications&quot; width=&quot;300&quot; height=&quot;165&quot; class=&quot;aligncenter size-medium wp-image-1242&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;In fact, even if you use dynamic resource allocation, this is what you must get to have your results by the time you need them, but obviously, you have lost your two other applications. Some batch schedulers allow applications to be suspended, but this is a double-edge sword:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;your cluster must support job suspension, and thus have access to drives to save the job state (which is not possible for medium to large-scaled clusters)&lt;/li&gt;&lt;li&gt;if your application does not scale to your entire cluster (it happens), although one of the other two applications could go on, it is not possible, all processes are put to sleep&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;So all things considered, you have to implement dynamic resource allocation.&lt;/p&gt;&lt;h4&gt;Dynamic resource allocation&lt;/h4&gt;&lt;p&gt;How does this work? Each application must be aware that it can be allocated more resources or deallocated some at all time. To be portable on all clusters, you cannot suspend part of your program, it must really go away. The batch scheduler must also notice that your application has freed some of its resources. You thus have to allocate small jobs that will communicate together (this can be done with MPI-2).&lt;/p&gt;&lt;p&gt;This means that you will have hundreds or thousands of small works. All of them will not have to be connected to the scheduler, only one master must be. Of course, this can easilly be done by using a specific queue. Each application on this queue will thus receive orders from the batch scheduler and act upon it. Another advantage is that also the application gets no resource at one point, it still has a saved state that enable the continuation of a run.&lt;br /&gt;&lt;center&gt;&lt;a href=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/Dynamic-workflow.png&quot;&gt;&lt;img src=&quot;http://matt.eifelle.com/wp-content/uploads/2010/06/Dynamic-workflow-300x165.png&quot; alt=&quot;&quot; title=&quot;Dynamic resource allocation workflow&quot; width=&quot;300&quot; height=&quot;165&quot; class=&quot;aligncenter size-medium wp-image-1244&quot; /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;&lt;p&gt;Of course, this is not easy to do. How can this be applied to an of-the-shelf application? Well, in this case, you may create a bogus application on the master queue that will at least allow other applications to be allocated resources beside it.&lt;/p&gt;&lt;p&gt;You do not have to implement this on top of MPI. It can be really hard to do (handling data moves between processors, change the decomposition, &amp;#8230;), and you may implement another solution. In my case, I have thousands different tasks that can be run on very few cores, so this is my elementary unit. I don&amp;#8217;t need all tasks to communicate between them, so I create each time brand new independent jobs and I also can tell the scheduler it can kill jobs that are not responding before the next allocation phase.&lt;/p&gt;&lt;h4&gt;Conclusion&lt;/h4&gt;&lt;p&gt;To finish, I&amp;#8217;ll say that I know that &lt;a href=&quot;http://www.platform.com/&quot;&gt;LSF&lt;/a&gt; allows plugins that help dispatch jobs on specific hosts of your cluster (to have the best communication location). There seems to be a way of implementing the needs gathering and the resource assignment, but the documentation is not clear (at all). A specific daemon may be needed. I don&amp;#8217;t know if other batch scheduler allow plugins to modify their behavior, if you know of them and their API, please do tell &lt;img src=&quot;http://matt.eifelle.com/wp-includes/images/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;wp-smiley&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/b2zG1Ob5K0S0OATMbQ0yr_hPG6g/0/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/b2zG1Ob5K0S0OATMbQ0yr_hPG6g/0/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://feedads.g.doubleclick.net/~a/b2zG1Ob5K0S0OATMbQ0yr_hPG6g/1/da&quot;&gt;&lt;img src=&quot;http://feedads.g.doubleclick.net/~a/b2zG1Ob5K0S0OATMbQ0yr_hPG6g/1/di&quot; border=&quot;0&quot; ismap=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/eifelle/CPPV/~4/ZIWMCGF71KA&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 15 Jun 2010 07:53:10 +0000</pubDate>
</item>
<item>
	<title>Titus Brown: Teaching next-gen sequencing data analysis to biologists</title>
	<guid>http://ivory.idyll.org/blog/2010/06/14/ngs-course-postmortem</guid>
	<link>http://ivory.idyll.org/blog/jun-10/ngs-course-postmortem</link>
	<description>&lt;div class=&quot;document&quot;&gt;
&lt;p&gt;Our &lt;a class=&quot;reference&quot; href=&quot;http://bioinformatics.msu.edu/ngs-summer-course-2010&quot;&gt;sequencing analysis course&lt;/a&gt; ended last
Friday, with an overwhelmingly positive response from the students.
The few negative comments that I got were largely about organizational
issues, and could be reshaped as suggestions for next time rather than
as condemnations of this year's course.&lt;/p&gt;
&lt;img alt=&quot;http://ivory.idyll.org/permanent/ngs-2010-group.png&quot; src=&quot;http://ivory.idyll.org/permanent/ngs-2010-group.png&quot; /&gt;
&lt;p&gt;The 23 students -- most with no prior command-line experience -- spent
two weeks experiencing at first hand the challenges of dealing with
dozens of gigabytes of sequencing data.  Each of the students went
through genome-scale mapping, genome assembly, mRNAseq analysis on an
&amp;quot;emerging model organism&amp;quot; (a.k.a &amp;quot;one with a crappy genome&amp;quot;, lamprey),
resequencing analysis on E. coli, and ChIP-seq analysis on Myxococcus
xanthus.  By the beginning of the second week, many students were working
with their own data -- a real victory.  Python programming competency
may take a bit longer, but many of them seem motivated.&lt;/p&gt;
&lt;p&gt;If you had told me three weeks ago that we could pull this off, I
would have told you that you were crazy.  This does beg the question
of what I was thinking when I proposed the course -- but don't dwell
on that, please...&lt;/p&gt;
&lt;p&gt;The locale was great, as you can see:&lt;/p&gt;
&lt;img alt=&quot;http://ivory.idyll.org/permanent/ngs-2010-beach.png&quot; src=&quot;http://ivory.idyll.org/permanent/ngs-2010-beach.png&quot; /&gt;
&lt;p&gt;One of the most important lessons of the course for me is that &lt;a class=&quot;reference&quot; href=&quot;http://ivory.idyll.org/blog/jun-10/ngs-course-with-aws.html&quot;&gt;cloud
computing works well to backstop this kind of course&lt;/a&gt;.  I
was very worried about the suitabiliy and reliability and ease of use,
but AWS did a great job, providing an easy-to-use Web interface and a
good range of machine images.  I have little doubt that this course
would have been nearly impossible (and either completely ineffective
or much more expensive) without it.&lt;/p&gt;
&lt;p&gt;In the end, we spent more on beer than on computational power.  That says
something important to me :)&lt;/p&gt;
&lt;p&gt;The &lt;a class=&quot;reference&quot; href=&quot;http://ged.msu.edu/angus/&quot;&gt;course notes&lt;/a&gt; are available under a
CC license although they need to be reworked to use publicly available
data sets before they become truly useful.  At that point I expect them
to become awesomely useful, though.&lt;/p&gt;
&lt;p&gt;From the scientific perspective, the students derived a number of
significant benefits from the course.  One that I had not really
expected was that some students had no idea what went in to
computational &amp;quot;sausage&amp;quot;, and were kind of shocked to see what kinds of
assumptions us comp bio people made on their behalf.  This was
especially true in the case of students from companies, who have
pipelines that are run on their data.  One student lamented that &amp;quot;we
used to look at the raw traces... now all we get are spreadsheet
summaries!&amp;quot;  Another student came to me in a panic because they didn't
realize that there &lt;em&gt;was&lt;/em&gt; no one true answer -- that that was in fact
part of the &amp;quot;fun&amp;quot; of &lt;em&gt;all&lt;/em&gt; biology, not just experimental biology.
These reactions alone made teaching the course worthwhile.&lt;/p&gt;
&lt;p&gt;Of course, the main point is that many of the students seem to be
capable of at least starting their own analyses now.  I was surprised
at the practical power of our cut-and-paste approach -- for example,
if you look at the &lt;a class=&quot;reference&quot; href=&quot;http://ged.msu.edu/angus/tutorials/short-read-assembly.html&quot;&gt;Short-read assembly with ABySS tutorial&lt;/a&gt;, it
turns out to be relatively straightforward to adapt this to doing
assemblies of your own genomic or transcriptomic data.  I based our
approach on Greg Wilson's post on &lt;a class=&quot;reference&quot; href=&quot;http://pyre.third-bit.com/blog/archives/3761.html&quot;&gt;the failure of inquiry-based
teaching&lt;/a&gt; and so
far I like it.&lt;/p&gt;
&lt;p&gt;I am particularly amused that we have now documented, in replicable
detail, the Kroos Lab MrpC ChIP analysis.  We also have the best
documentation for Jeff Barrick's breseq software, I think; this is
what is used to analyze the &lt;a class=&quot;reference&quot; href=&quot;http://en.wikipedia.org/wiki/E._coli_long-term_evolution_experiment&quot;&gt;Long Term Evolution Experiment&lt;/a&gt;
lines -- and I can't wait for the anti-evolutionists to pounce on
that...  &amp;quot;Titus Brown -- making evolution experiments accessible to
creationists.&amp;quot;  Yay?&lt;/p&gt;
&lt;p&gt;There were a number of problems and mistakes that we had to
steamroller through.  In particular, more background and more advanced
tutorials would have be great, but we just didn't have time to write
them.  Some 454, Helicos, and SOLiD data sets (and next year, PacBio?)
would be a good addition.  We had a general lack of multiplexing data,
which is becoming a Big Thing now that sequencing is so ridiculously
deep. I would also like to introduce additional real data analyses
next year, reprising things like the &lt;a class=&quot;reference&quot; href=&quot;http://www.nature.com/nbt/journal/v28/n5/abs/nbt.1621.html&quot;&gt;Cufflinks analysis&lt;/a&gt; and
whole-vertebrate-genome ChIP-seq/mRNAseq &lt;a class=&quot;reference&quot; href=&quot;http://www.nature.com/nmeth/journal/v6/n11s/abs/nmeth.1371.html&quot;&gt;a la the Wold Lab&lt;/a&gt;.
I'm weighing adding metagenomics data analysis in for a day, although
it's a pretty separate field of inquiry (and frankly much harder in
terms of &amp;quot;unknown unknowns&amp;quot;).  We also desperately need some plant
genomics expertise, because frankly I know nothing about plant
genomes; my last-minute plant genomics TA fell through due to lack of
planning on my part.  (Conveniently, plant genomics is something MSU
is particularly good at, so I'm sure I can find someone next year.)&lt;/p&gt;
&lt;p&gt;Oops, did I say next year?  Well, yes.  &lt;em&gt;If&lt;/em&gt; I can find funding for my
princely salary, &lt;em&gt;then&lt;/em&gt; I will almost certainly run the course again
next year.  I can cover TAs and my own room/board and speakers with
workshop fees, but if I'm going to keep room+board+fees under
$1000/student -- a practical necessity for most -- there's no way I
can pay myself, too.  And while this year I relied on my lovely,
patient, and frankly long-suffering wife to hold down the home fort
while I was away for two weeks, I simply can't put her through that
again, so I will need to pay for a nanny next year.  So doing it for
free is not an option.&lt;/p&gt;
&lt;p&gt;In other words, &lt;strong&gt;if you are a sequencing company, or an NIH/NSF/USDA
program director, interested in keeping this going, please get in
touch&lt;/strong&gt;.  I plan to apply for this &lt;a class=&quot;reference&quot; href=&quot;http://grants.nih.gov/grants/guide/pa-files/PAR-09-245.html&quot;&gt;Initiative to Maximize Research
Education in Genomics&lt;/a&gt; in
September, but I am not confident of getting that on the first try,
and in any case I will need letters of support from interested folks.
So &lt;a class=&quot;reference&quot; href=&quot;mailto:ctb&amp;#64;msu.edu&quot;&gt;drop me a note at ctb&amp;#64;msu.edu&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Course development this year was sponsored by the &lt;a class=&quot;reference&quot; href=&quot;http://www.bch.msu.edu/GEDD/&quot;&gt;MSU Gene Expression
in Disease and Development&lt;/a&gt;, to whom
I am truly grateful.  The course would simply not have been possible
without their support.&lt;/p&gt;
&lt;p&gt;My overall conclusion is that it is possible to teach bench biologists
with no prior computational experience to achieve at least minimal
competency in real-world data analysis of next-generation sequencing
data.  I can't conclusively &lt;em&gt;demonstrate&lt;/em&gt; this without doing a better
job of course evaluation, and of course only time will tell if it
sticks for any of the students, but right now I'm feeling pretty good
about the course overall.  Not to mention massively relieved.&lt;/p&gt;
&lt;p&gt;--titus&lt;/p&gt;
&lt;p&gt;p.s. Update from one student -- &amp;quot;It's not even 12 o'clock Monday
morning and I'm already getting people asking me how to run assemblies
and analyze data.&amp;quot;  Heh.&lt;/p&gt;
&lt;/div&gt;</description>
	<pubDate>Mon, 14 Jun 2010 15:38:31 +0000</pubDate>
</item>
<item>
	<title>Skipper Seabold: Statsmodels: GSoC Week 3 Update</title>
	<guid>tag:blogger.com,1999:blog-128274497687662608.post-3774895251087389400</guid>
	<link>http://scipystats.blogspot.com/2010/06/statsmodels-gsoc-week-3-update.html</link>
	<description>[&lt;b&gt;Edit&lt;/b&gt;: Formatting should be fixed now.  I will not be reformatting old posts though, so that they don't get reposted at &lt;a href=&quot;http://planet.scipy.org&quot;&gt;Planet SciPy&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Last week was spent mainly ensuring that I pass my comps and remain a PhD student.  This week was much more productive for coding.  For now, all changes are in my branch and have not been merged to trunk, but I will describe the two big changes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first concerns the datasets package.  This one is not all that exciting, but suffice it to say that the datasets are now streamlined and use the &lt;a href=&quot;http://code.activestate.com/recipes/52308/&quot;&gt;Bunch pattern&lt;/a&gt; to load the data.  Thanks, Gaël, for pointing this out.  I also rewrote a bit of David's datasets proposal from scikits-learn to reflect the current design of our datasets and thoughts.  You can see it &lt;a href=&quot;http://bazaar.launchpad.net/%7Ejsseabold/statsmodels/statsmodels-skipper/annotate/head:/scikits/statsmodels/datasets/DATASET_PROPOSAL.rst&quot;&gt;here&lt;/a&gt; (soon to be on the docs page).  We are making an effort to ensure that our datasets are going to be similar to those of scikits-learn.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The second change was an improvement of the fitting of maximum likelihood models and the start of a GenericLikelihoodModel class.  Maximum likelihood based models (mainly discrete choice models in the main code base right now) can now be fit using any of the unconstrained solvers from scipy.optimize (Nelder-Mead, BFGS, CG, Newton-CG, Powell) plus Newton-Raphson.  To take a simple example to see how it works, we can fit a Probit model.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;mycode&quot;&gt;In [1]: import scikits.statsmodels as sm&lt;br /&gt;&lt;br /&gt;In [2]: data = sm.datasets.spector.load()&lt;br /&gt;&lt;br /&gt;In [3]: data.exog = sm.add_constant(data.exog)&lt;br /&gt;&lt;br /&gt;In [4]: res_newton = sm.Probit(data.endog, data.exog).fit(method=&quot;newton&quot;)&lt;br /&gt;Optimization terminated successfully.&lt;br /&gt;Current function value: 12.818804&lt;br /&gt;Iterations 6&lt;br /&gt;&lt;br /&gt;In [5]: res_nm = sm.Probit(data.endog, data.exog).fit(method=&quot;nm&quot;, maxiter=500)&lt;br /&gt;Optimization terminated successfully.&lt;br /&gt;Current function value: 12.818804&lt;br /&gt;Iterations: 439&lt;br /&gt;Function evaluations: 735&lt;br /&gt;&lt;br /&gt;In [6]: res_bfgs = sm.Probit(data.endog, data.exog).fit(method=&quot;bfgs&quot;)&lt;br /&gt;Optimization terminated successfully.&lt;br /&gt;Current function value: 12.818804&lt;br /&gt;Iterations: 15&lt;br /&gt;Function evaluations: 21&lt;br /&gt;Gradient evaluations: 21&lt;br /&gt;&lt;br /&gt;In [7]: res_cg = sm.Probit(data.endog, data.exog).fit(method=&quot;cg&quot;, maxiter=250)&lt;br /&gt;Optimization terminated successfully.&lt;br /&gt;Current function value: 12.818804&lt;br /&gt;Iterations: 188&lt;br /&gt;Function evaluations: 428&lt;br /&gt;Gradient evaluations: 428&lt;br /&gt;&lt;br /&gt;In [8]: res_ncg = sm.Probit(data.endog, data.exog).fit(method=&quot;ncg&quot;, avextol=1e-8)&lt;br /&gt;Optimization terminated successfully.&lt;br /&gt;Current function value: 12.818804&lt;br /&gt;Iterations: 12&lt;br /&gt;Function evaluations: 14&lt;br /&gt;Gradient evaluations: 12&lt;br /&gt;Hessian evaluations: 12&lt;br /&gt;&lt;br /&gt;In [9]: res_powell = sm.Probit(data.endog, data.exog).fit(method=&quot;powell&quot;, ftol=1e-8)&lt;br /&gt;Optimization terminated successfully.&lt;br /&gt;Current function value: 12.818804&lt;br /&gt;Iterations: 12&lt;br /&gt;Function evaluations: 568&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All of the options for the solvers are available and are documented in the fit method.  As you can see, some of the default values need to be changed to ensure (accurate) convergence.  The  Results objects that are returned have two new attributes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;mycode&quot;&gt;&lt;br /&gt;In [10]: res_powell.mle_retvals&lt;br /&gt;Out[10]: &lt;br /&gt;{'converged': True,&lt;br /&gt;'direc': array([[  7.06629660e-02,  -3.07499922e-03,   5.38418734e-01,&lt;br /&gt;-4.19910465e-01],&lt;br /&gt;[  0.00000000e+00,   1.00000000e+00,   0.00000000e+00,&lt;br /&gt;0.00000000e+00],&lt;br /&gt;[  1.49194876e+00,  -6.64992809e-02,  -6.96792443e-03,&lt;br /&gt;-3.22306873e+00],&lt;br /&gt;[ -5.36227277e-02,   1.18544093e-01,  -8.75205765e-02,&lt;br /&gt;-2.42149981e+00]]),&lt;br /&gt;'fcalls': 568,&lt;br /&gt;'fopt': 12.818804069990534,&lt;br /&gt;'iterations': 12,&lt;br /&gt;'warnflag': 0}&lt;br /&gt;&lt;br /&gt;In [11]: res_powell.mle_settings&lt;br /&gt;Out[11]: &lt;br /&gt;{'callback': None,&lt;br /&gt;'disp': 1,&lt;br /&gt;'fargs': (),&lt;br /&gt;'ftol': 1e-08,&lt;br /&gt;'full_output': 1,&lt;br /&gt;'maxfun': None,&lt;br /&gt;'maxiter': 35,&lt;br /&gt;'optimizer': 'powell',&lt;br /&gt;'retall': 0,&lt;br /&gt;'start_direc': None,&lt;br /&gt;'start_params': [0, 0, 0, 0],&lt;br /&gt;'xtol': 0.0001}&lt;/div&gt;&lt;br /&gt;The dict mle_retvals contains all of the values that are returned from the solver if the full_output keyword is True.  The dict mle_settings contains all of the arguments passed to the solver, including the defaults so that these can be checked after the fit.  Again, all settings and returned values are documented in the fit method and in the results class, respectively.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Lastly, I started a GenericLikelihoodModel class.  This is currently unfinished, though the basic idea is laid out.  Take again the Probit example above using Lee Spector's &lt;a href=&quot;http://www.jstor.org/pss/1182446&quot;&gt;educational program data&lt;/a&gt;.  And assume we didn't have the Probit model from statsmodels.  We could use the new GenericLikelihoodModel class.  There are two ways (probably more) to proceed.  For those comfortable with object oriented programming and inheritance in Python, we could subclass the GenericLikelihoodModel, defining our log-likelihood method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;mycode&quot;&gt;from scikits.statsmodels import GenericLikelihoodModel as LLM&lt;br /&gt;from scipy import stats&lt;br /&gt;import numpy as np&lt;br /&gt;&lt;br /&gt;class MyModel(LLM):&lt;br /&gt;def loglike(self, params):&lt;br /&gt;&quot;&quot;&quot;&lt;br /&gt;Probit log-likelihood&lt;br /&gt;&quot;&quot;&quot;&lt;br /&gt;q = 2*self.endog - 1&lt;br /&gt;X = self.exog&lt;br /&gt;return np.add.reduce(stats.norm.logcdf(q*np.dot(X,params)))&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now this model could be fit, using any of the methods that only require an objective function, i.e., Nelder-Mead or Powell.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;mycode&quot;&gt;In [43]: mod = MyModel(data.endog, data.exog)&lt;br /&gt;&lt;br /&gt;In [44]: res = mod.fit(method=&quot;nm&quot;, maxiter=500)&lt;br /&gt;Optimization terminated successfully.&lt;br /&gt;Current function value: 12.818804&lt;br /&gt;Iterations: 439&lt;br /&gt;Function evaluations: 735&lt;br /&gt;&lt;br /&gt;In [45]: res_nm.params&lt;br /&gt;Out[45]: array([ 1.62580058,  0.05172931,  1.42632242, -7.45229725])&lt;br /&gt;&lt;br /&gt;In [46]: res.params&lt;br /&gt;Out[46]: array([ 1.62580058,  0.05172931,  1.42632242, -7.45229725])&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The main drawback right now is that all statistics that rely on the covariance of the parameters, etc. will use numeric gradients and Hessians, which can lessen that accuracy of those statistics.  This can be overcome by providing score and hessian methods as loglike was provided above.  Of course, for more complicated likelihood functions this can soon become cumbersome.  We are working towards more accurate numerical differentiation and discussing options for automatic or symbolic differentiation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The main advantage as opposed to just writing your likelihood and passing it to a solver is that you have all of the (growing number of) statistics and tests available to statsmodels right in the generic model.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I would also like to accommodate those who are less familiar with OOP and inheritance in Python.  I haven't quite worked out the final design for how this would go yet.  Right now, you could do the following, though I don't think it quite meets the less complicated goal.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;mycode&quot;&gt;In [4]: from scikits.statsmodels.model import GenericLikelihoodModel as LLM&lt;br /&gt;&lt;br /&gt;In [5]: import scikits.statsmodels as sm&lt;br /&gt;&lt;br /&gt;In [6]: from scipy import stats&lt;br /&gt;&lt;br /&gt;In [7]: import numpy as np&lt;br /&gt;&lt;br /&gt;In [8]: &lt;br /&gt;&lt;br /&gt;In [9]: data = sm.datasets.spector.load()&lt;br /&gt;&lt;br /&gt;In [10]: data.exog = sm.add_constant(data.exog)&lt;br /&gt;&lt;br /&gt;In [11]: &lt;br /&gt;&lt;br /&gt;In [12]: def probitloglike(params, endog, exog):&lt;br /&gt;....:         &quot;&quot;&quot;&lt;br /&gt;....:     Log likelihood for the probit&lt;br /&gt;....:     &quot;&quot;&quot;&lt;br /&gt;....:     q = 2*endog - 1&lt;br /&gt;....:     X = exog&lt;br /&gt;....:     return np.add.reduce(stats.norm.logcdf(q*np.dot(X,params)))&lt;br /&gt;....: &lt;br /&gt;&lt;br /&gt;In [13]: mod = LLM(data.endog, data.exog, loglike=probitloglike)&lt;br /&gt;&lt;br /&gt;In [14]: res = mod.fit(method=&quot;nm&quot;, fargs=(data.endog,data.exog), maxiter=500)&lt;br /&gt;Optimization terminated successfully.&lt;br /&gt;Current function value: 12.818804&lt;br /&gt;Iterations: 439&lt;br /&gt;Function evaluations: 735&lt;br /&gt;&lt;br /&gt;In [15]: res.params&lt;br /&gt;Out[15]: array([ 1.62580058,  0.05172931,  1.42632242, -7.45229725])&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are still a few design issues and bugs that need to be worked out with the last example, but the basic idea is there.  That's all for now.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/128274497687662608-3774895251087389400?l=scipystats.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 14 Jun 2010 12:54:36 +0000</pubDate>
	<author>noreply@blogger.com (jseabold)</author>
</item>
<item>
	<title>NeuralEnsemble: Program &amp; reg. deadline extension - FACETS CodeJam #4</title>
	<guid>tag:blogger.com,1999:blog-73903413139568172.post-2794150172216944615</guid>
	<link>http://neuralensemble.blogspot.com/2010/06/program-reg-deadline-extension-facets.html</link>
	<description>A preliminary program for the 4th annual FACETS CodeJam meeting (&lt;a href=&quot;http://neuralensemble.org/codejam4&quot;&gt;http://neuralensemble.org/codejam4&lt;/a&gt;) which will take place June 22nd-24th, 2010 in Marseille, France is now available here: &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://neuralensemble.org/meetings/CJ4_Preliminary_Program_v2.pdf&quot;&gt;http://neuralensemble.org/meetings/CJ4_Preliminary_Program_v2.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In addition, the registration deadline has been extended to June 13th, 2010.  What are you waiting for?  Register now!&lt;br /&gt;&lt;br /&gt;The goal of the FACETS CodeJam workshops is to catalyze open-source, collaborative software development in computational and systems neuroscience and neuroinformatics, by bringing together researchers, students and engineers to share ideas, present their work, and write code together. The general format of the workshops is to dedicate the mornings to invited and contributed talks, leaving the afternoons free for discussions and code sprints.&lt;br /&gt;&lt;br /&gt;For the 4th FACETS CodeJam, the main theme of the meeting will be workflows: what are the best practices for combining different tools (simulators, analysis tools, visualization tools, databases etc.) to ensure the efficient and reproducible flow of data and information from experiment conception to publication and archiving? &lt;br /&gt;&lt;br /&gt;The meeting is being organised by:&lt;br /&gt;Andrew Davison (UNIC-CNRS, Gif-sur-Yvette, France)&lt;br /&gt;Abigail Morrison (BCCN-Freiburg, Germany) &lt;br /&gt;Eilif Muller (BBP-EPFL, Lausanne, Switzerland) &lt;br /&gt;Laurent Perrinet (INCM-CNRS, Marseille, France)&lt;br /&gt;&lt;br /&gt;Please consult the meeting website at&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://neuralensemble.org/codejam4&quot;&gt;http://neuralensemble.org/codejam4&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;for registration and further information.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/73903413139568172-2794150172216944615?l=neuralensemble.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Thu, 10 Jun 2010 00:26:57 +0000</pubDate>
	<author>noreply@blogger.com (eilif)</author>
</item>

</channel>
</rss>
