Montag, 7. April 2008

Python + Emacs, contd.

On my neverending voyage towards the ultimate python IDE I stumbled across another nice tool: ropemacs! Ropemacs is an emacs binding to the rope library for refactoring python code. It also uses Pymacs, which aims towards employing Python as an extension language for emacs.


Installing Pymacs, rope, and ropemacs was fairly easy thanks to the excellent installation instructions - Kudos to the developers of rope and Pymacs! Good instructions are not a common thing for emacs extensions, it seems.


I think ropemacs will accompany my journey for the next few thousand lines of code, and we'll see how well we get along... I'll keep you posted! :)

Mittwoch, 19. März 2008

7 reasons why test-driven development rocks

Did I ever mention that test-driven development rocks? No? Well, it sure does :)
Here are my top 7 reasons:

  • Know when you're done. Back when I didn't have tests prior to implementing functions I never was sure when the implementation was actually done. There was always this unspecific feeling of having forgotton something...

  • Reward. Everytime a test passes, I get this satifying feeling of having accomplished something :)

  • Efficiency. Writing tests forces me to think about solutions instead of thinking about problems.

  • Better software design. Writing tests before implementing the actual method forces me to think about what exactly I expect the method to do. Methods that are awkward to test are awkward to use, and require redesign.

  • Refactoring. You simply cannot refactor your code without having tests in place. But if you have tests, refactoring is a breeze.

  • Confidence. Having tests in place makes me confident that my code does what I want it to do. Well, most of the time... But when I encounter a bug I add another test and regressions won't hurt me.

  • Example code. Test functions are concrete examples how to use a given function in my code.


I would have liked to have 10 top reasons, but couldn't figure out the remaining three... If you have one, please comment!

Donnerstag, 13. März 2008

Neural Ensemble

The Neuralensemble project brings together several efforts to make simulations of neurons easier. Currently, I spend most of my time working with the tools they created. Since a few days I have an account on their TRAC server, so I thought this is a good time to blog about it.

The project which got me into neuralensemble is PyNN , which provides a unified front end to several widely used neural simulators, e.g. NEURON, NEST and PCSIM. PyNN greatly facilitates setting up neural networks, because it provides an abstraction from simulator-specific languages. As the name suggests, it's written in Python, and lets you specify the network in Python, too.

For experiment design and analysis of simulated data there is Neurotools. It's written for PyNN (in Python), but can also be used independently from it. One of the most promising design goals is its ability to control large experiment sets, e.g. to systematically investigate the impact of certain parameters on network function. I'm sure every scientist who does computational modeling has written code to deal with this tasks at least once. Having a common API for this is a great thing.

Neuralensemble is a dynamic community which is still very open to all sorts of contributions. So if you're into modeling of neural networks, you should definitely give it a shot!

Montag, 10. März 2008

Python IDE revisited

Today Komodo edit got released under various open source licenses. Since I'm still looking for a decent Python IDE I could not wait to try it.

My very first impression is a very good one! It looks like Eclipse, but I can live with that... especially because it lets me use Emacs keybindings. Killer feature :). Beyond that, code completion seems to do a good job in Komodo Edit, something I never got around to set up in emacs.

Of course, I still need to check out things like code navigation, refactoring and other IDE goodies... soon to be reported here!

Dienstag, 26. Februar 2008

Two machines, one keyboard

Daily computer work can be quite annoying when you have to work on two machines simultaneously. If those two machines are connected through the network, synergy was my method of choice to solve this problem. It's like having a dual-screen setup, your mouse can move between both screens. The difference is that each monitor is a separate machine. Keystrokes from one machine go the window that has focus, irrespective to which the keyboard is hooked up. I liked that tool a lot, but in practice I found it too cumbersome in the long run.

Now I came across this blog post, which advertises Mango Lassi as a better synergy. It even has packages for OpenSuse, via the Buildservice. Sounds promising, have to check it out when I find time.

Yet another python primer

Another python tutorial, this time specially for life science researchers. Published back in November last year, but it took me until today to run across it. It seems to be focused towards bioinformatics, at least from what I can tell by quickly going through it. Might be useful for students entering the field, not knowing which lagnuage to learn.

Citation: Bassi S (2007) A Primer on Python for Life Science Researchers. PLoS Comput Biol 3(11): e199

Montag, 25. Februar 2008

Python + Emacs, cont.

I came across this blog post which states some very interesting additional resources for python development in emacs. Very cool!