Tag your AWS resources in StarCluster 11 Nov 2014
DjangoCon 2014: Top tips for developing and deploying on AWS 15 Sep 2014
Install NumPy and SciPy without Fortran 16 Dec 2013
NumPy and SciPy are two great Python packages for scientists, as is the popular Matplotlib. However, installing NumPy and SciPy is not for the faint hearted if you install your Python packages via pip. Assuming you have fortran, blas, lapack and atlas already installed it is actually quite a slow installation, especially SciPy. NumPy took 46 seconds to install, whereas SciPy took 6 mins and 50 seconds on my MacBook Pro. So what if you install once and forget? Two problems with that. First I use
mktmpenvwhen debugging issues. Second I also use tox to test against multiple version of Python and/or Django. All of a sudden 6 build configurations is 42 minutes of SciPy compilation!
Let’s not forget Windows users, Fortran - I don’t think so and they should be able to enjoy pip and virtualenv as much as any Python developer.
The obvious solution is for SciPy to be packaged with wheel, the new Python binary distribution format. However, I appreciate that would be very hard for the authors, but hopefully one day.
In the meantime Anaconda might be of interest. It is like apt-get/yum for scientific Python, but a new feature has just been announced, you can pip install anaconda itself then take advantage of the binary distributions it provides for you.
New comments, but not like YouTube 20 Nov 2013
GDG DevFest now includes Albuquerque 19 Nov 2013
My first WordCamp 04 Nov 2013
Book chapter on the use of open source software in the pharmaceutical industry 05 May 2013
Getting ready for PyCon 2013 10 Mar 2013
DjangoCon US 2012 25 Sep 2012
Using Gunicorn with PyCharm 18 Jul 2012
When you develop projects with Django it comes with a handy
runserverwhich is a lightweight webserver bundled with Django, see more here. It goes without saying you would never want to deploy any production code with this as it doesn’t scale nor is it particularly secure. It does not get much attention from the Django developers, lets face it there are better things to work on. So a few alternatives have popped up. The one which caught my eye is gunicorn. Now gunicorn can be used on preprod or production sites as well, but I stick to development here (what I use for production will feature in another post).
Gunicorn is actually a fork of Unicorn which is designed for use with Ruby. It is a WSGI webserver, WSGI is the way to run webservers. It also features integration with Django so can be a drop in replacement for
runserver. Installation is a breeze,
pip install gunicornand add
PyCharm for Django development 13 Jul 2012
Homebrew 01 May 2012
Homebrew, the OS X package manager, not the beverage, is the third package manager I’ve used on OS X. I started in 2005 with Fink and MacPorts. MacPorts seemed to be more active, especially with the flurry of Leopard releases. Indeed it also has some advanced features including dependencies to let you install MAMP stacks. However, I find I prefer to have control of my MAMP stack especially in my volatile development environments, upgrades can be particularly painful with MacPorts.
Homebrew has quite a different approach. There is no need for sudo, all binaries get symlinks in
/usr/local, but point to
/usr/local/Cellarwhich controls the formula (aka package) version. The formula scripts are ruby based, so adding your own is very easy.
If you don’t want to search forumlae via the command-line then head to http://braumeister.org/ (another GitHub project).
Installation is pretty simple. If you are a developer, e.g. you have Xcode installed it is probably a one-liner. Installation alongside MacPorts is not recommended, but to check you can get everything you need from Homebrew it will probably not cause too many problems.
Now you have
brewin your path lets explore some use cases:
Python Virtual Environments 04 Mar 2012
Anyone who uses Python regularly will soon encounter the need to install an extra package be it MySQLdb, numpy or Django. Thanks to tools like
easy_installthis is very trivial to do, as long as you have internet access from your command-line. Those of you behind corporate firewalls might want to try cntlm to help. Typically they will install the package into your home directory for only you to use. If you are root they will install into the system installation for all users to use. In both scenarios it is hard to mix and match multiple versions of packages. As a developer this becomes very important, I might want to try the lastest version of a package, but for my production code I want to remain on the stable release. The easiest way to manage this is using virtual environments. Virtualenv is a python package that allows you to manage multiple python instances with different combinations of packages. It is easy to mix python and package versions for development and production code. Virtualenv is great and has been extended with virtualenvwrappers, which adds even more functionality.
To get started run the following:
Notes and more everywhere 21 Feb 2012
I download lots of iOS apps, mainly out of curiosity. Some I grow to use others just disappear. One which I use more and more and has got better and better is Evernote. With the tagline “Remember Everything” you use Evernote via the web, iOS, Android, BlackBerry etc. You can do simple notes, todo lists, upload files or images. I started to use it for making notes at conferences. The Evernote ecosystem has grown and a great feature is the web clipper. This add-in for your favorite browser clips all or part of a web site and saves it as an evernote note. Once in evernote it is easy to search through it via tags; my google searches even checks my evernote account now (with permission). Skitch is a recent acquisition but makes annotating images dead easy on your desktop, iPad or Android device (and then saves the results to Evernote).
It works on a freemium model. You get everything with some restrictions (60MB upload a month, no offline data on mobile devices). They get you hooked then you can pay for unlimited access, which I’m giving serious consideration to. Why not give it a try at your next conference? I hear CUP XIII should be good fun.
Operating systems which are current for now 20 Feb 2012
After switching employer I’m no longer tied to Windows Vista & Red Hat. Truth be told I’m quite happy on Red Hat, Vista less so. Anyway, my new setup is Mac OS X Lion & Ubuntu. I use Lion on my personal computer so that is no problem. Although from a developer perspective OS X isn’t Linux like Red Hat, but once you learn the tweaks it does play ball.
All change 20 Feb 2012
Computational Chemistry sandwich placement available 28 Dec 2011
It is that time of year again when I can announce my group at AstraZeneca has a new position available. We are looking for a Sandwich Student to join us in September 2012. We successfully rebooted our sandwich student program last year. The ideal candidate will currently be in the second year of their chemistry or computer science degree. No experience is required, but a willingness to learn is crucial as you will learn about cheminformatics and computational chemistry.
Computational Chemistry sandwich placement available 15 Jan 2011
I’m delighted to announce we have a 12 month placement available for a sandwich student. Typically the third year of a four year undergraduate degree. It has been a while since my department has had a placement student, but I firmly believe the experience is valuable for both the student and us. I did a placement during my undergraduate degree and thoroughly enjoyed it. Seemingly my employer agreed as they later sponsored my PhD.
The ideal candidate would be a chemist or computer scientist. The only skill you need to bring is a desire to learn. We don’t expect you to know all about drug discovery or be an amazing programmer. During the placement you will have to the opportunity to pick up the skills required to make a meaningful contribution to our department.
If you are interested find out more here, and search for reference: TRES DECS 11. Closing date for applications is 15th Feb 2011. Good luck!
Subversion Edge 23 Sep 2010
iOS apps for Science 20 Sep 2010
I was going to list interesting iPhone/iPad apps months ago, but there is already an excellent list available here and I see no point in reinventing the wheel.
If you fancy hunting through the App Store, which isn’t that great a search you’ll generally find science apps under Books, Education, Reference or Utilities.
Now I have slightly more free time I might have a dabble with the iOS SDK.
Blog spring clean 30 Aug 2010
Admittedly this is late for a spring clean, but Blogger has introduced a host of updates since I last looked. One being this nifty new template.
Also, something I’ve wanted to try out is a decent syntax highlighter and this one looks good. See http://alexgorbatchev.com/SyntaxHighlighter/. The instructions I followed for Blogger can be found here.
So now I can easily publish code like this:
New content... part II 03 Apr 2010
I’ve finally submitted my PhD thesis! Therefore, I now have spare time, it might take a while to get used to. I’ve neglected this blog because of writing up but will start to post new content soon.
Eclipse Galileo 28 Jun 2009
Eclipse with Django 14 Jun 2009
Eclipse with C++/OEChem 01 Jun 2009