Search This Blog

Loading...

Tuesday, April 28, 2015

iPython notebook server via SSH tunnel

On the host:
$ screen
$ cd vEnv3/
$ source bin/activate
[eEnv3]$ ipython notebook --no-browser --port=8000 --ip=0.0.0.0
(detach screen: ctrl-A ctrl-D)
on the local machine
$ autossh -M 20000 -N -L 9000:host:8000 [username@]host

Learning by playing

I randomly came across this awesome website. It looks really interesting, but I don't have the bandwidth right now to spend time plying with those ideas. In particular, this article looks pretty interesting for my super-secret font project ...

Wednesday, April 22, 2015

Python Package Development

Context

I'm developing a few Python packages, which are obviously under version control (personally hosted GIT repo in this case, but that's not relevant). Now, the package is in active development, but I usually work in different machines: my personal laptop and workstations at the lab. In the lab machines I don't have root access, so I work on a virtualenv, where I can install python packages using pip install.

How?

To facilitate the development in every machine I work on, this is the basic setup:
  1. Create a setup.py file in the repo, to use setuptools to install the package (this will also help you if you want to use PyPI later on to distribute your package)
  2. Clone the repo in every machine you will develop/use your package
  3. For every machine:
    1. activate the virtualenv
    2. cd into the cloned repo
    3. Type python setup.py develop

Wednesday, March 11, 2015

Sunday, January 18, 2015

Rendering large datasets with matplotlib

This post provides a great solution for a common problem. Like the author, I always go for vector graphics for publications and posters. The problem is that some times these images are build using large datasets, which means large number of vector elements in the final image. This, in turn, makes browsing such document slow and painful (I've sure have stopped reading some articles due to unresponisveness). To overcome such problem, matplotlib offers a neat trick. Is possible to rasterize only selected elements in your figure, while keeping the rest vectorized. Read the post for more info.

Friday, December 26, 2014

Transforming Code into Beautiful, Idiomatic Python

Some of these idioms are fairly well known (at least I've seen them a lot). But several others were new to me.

Monday, November 24, 2014

D3 inspiration

Of course the main entry point for inspiration is D3.js website and Mike Bostock's examples page. Another great resource is Jason Davie's website.