Author: mattions

How to push to two different git repositories in one go

Branching illustration

Branching it’s good:
http://git-scm.com/

With the new release of Neuronvisio (0.8.3) we have improved the documentation, gave the software a new home (http://neuronvisio.org) and created a new fork under the NeuralEnsemble orgs.

I think for Python and Neuroscience it would be good to have a website similar to http://pinaxproject.com/ecosystem, to give visibility to the different projects and avoid to re-invent the wheel, however for now using the same space in NeuroEnsemble orgs it’s a good start. I didn’t want to move or transfer my repository there directly,  but I wanted to have a mirror of my repo https://github.com/mattions/neuronvisio in that space, without having to manually update it. I’ve looked how to open a mirror fork on github, but to no avail. So I came up with a possible solution, using the ability of git to push to different repositories.

My solution was to create a new remote point, called all in the local git config (.git/config in your repo) with the following format:

[remote "all"]
url = git@github.com:mattions/neuronvisio.git
url = git@github.com:NeuralEnsemble/neuronvisio.git

This way I can push to both the repos with a single command

git push all

Both the repos will be updated in one go. Neat.

Tools for a computational scientist

So, how do you keep track of your work?

If you are in a wet lab, usually you end up using a lab book, where all the experiments are recorded. You can replicate the experiment, and do something new. It’s pretty cool system, although I think it’s not great for computational scientist. In computational science there is the same problem of recording what is going on, and what happened before. On top of that there is also the problem of sharing the program with other people to address reproducibility. Therefore the problem can be broken down to two different sub problems:

  • record the changes happening in a computational project, in particular to the code used to run the project
  • record the results of different execution and link them with a certain state of the code.
A classic approach is “do nothing”. The code sits on your hard drive somewhere. Maybe it is organized in folders, and descriptive file name. However there is not history attached, you have no idea what’s going on, and which is the latest version. As you guessed this is not a cool position, ’cause you spend time thinking how to track your work instead of doing your work, and you have the feeling that you don’t know what’s going on. This is bad. 
Fortunately, this can be solved 🙂
This is one of the problem which could be solved using a Version Control System, which are exactly invented to track changes in text files (and more).
I found very useful to work with Git, which is an amazing Distributed Version Control System (DVCS). The most important benefit that you get one using a version control system, and in particular git is that you have the ability to be more brave. This is because Git makes very easy to create a branch and test something new as you go on.
Branches

Branch in Git are quick and cheap! Easy to experiment!

Did you ever find yourself in a situation where you wanted to try something new, which could break a lot of different things in your repository, however you didn’t want to mess with your current code?
Well, Git gives you the ability to create a branch very cheaply, to test your new crazy idea and see if it works, in a completely isolated environment from the code that is sitting on your master branch. This means you can try new things, which tends to be quite important in science, because we don’t usually know where we are going, and try more than one solution opens up a lot of different possibilities.
The other good thing is you have a log, with whatever happened, and you can try to go back to the version that was working and restart from there. For example, this is the commits log from neuronvisio.
I’ve ran a hands-on crash course at the EBI about Git, (the repo). The course was very well-welcomed and people started to understand the power of using fast tools to free some mental space.
Another big plus for Git is the ability to host your project on github, which makes collaboration super-easy. These are the contributors for Neuronvisio for example.
Using a version controlled system is a good idea, and integrating it with Sumatra is also a very good idea. Sumatra automatically tracks all the parameters and versions of the programs used. I’ll talk about it in a later post, for now have a look to the slides:
Sumatra and git [slideshare id=3802681&w=425&h=355&sc=no]

Integrating the different leads

Blooming

Spring knocking!

To try to put all the stuff that I have on the net in a consistent way, so to give the people one address where to go to look up my stuff, I’ve decided to get a new personal domain, michelemattioni.me.  I’ve moved this blog to a new address blog.michelemattioni.me. On top of that, I’ve changed the name of the blog to Trains of Thoughts. After 6 years of activity, I guess it was time.

For the technical side, if you are interested, the blog is still hosted on wordpress.com and you can get them to map the old address to any domain or subdomain for 13$/year. I’ve considered the idea to move all the blog and go for a self-hosted strategy, but I’ve decided it was too time-consuming, so I took this solution.

To register my domains and dealing with the DNS, I’m using dnsimple.com (my referral) for the domain I own. It’s a nice DNS provider, which simplify a lot of the DNS woodo action that you need to take when setting up new stuff.

The landing page is hosted using github pages, which is very neat way to keep the site under git and update it with just a push. I plan to use bootstrap to handle the graphic and to add some content to the page.

For the time being, this is the old version (current version):

old version of michelemattioni.me

First version of michelemattioni.me

What to expect from Ideatransform

Image

With Ideatransform kicking in in less than 5 hours, I want to write down what I expect from the meeting

  • I expect a lot of fun. Enjoying the WE is one of my goal
  • I expect to meet a lot of interesting people, among developers, designers, doers and mentors
  • I also would like to pitch the SustainableSouk idea, build a team and create a first MVC, in the classic LeanStartup way.

Although looking for a Co-founder is always a tricky business, and going solo is a possibility, I would like to build this project in a super open and easy way.

The excitement is high, let’s see how it rolls!

Kitegen comes back to fly

[slideshow]

I’m very happy to read (link in Italian) that Kitegen has started the automatic testing for take off and landing at Sommariva site.

I just report the main points written in the post which I think they are interesting, without going into a full english translation:

  • first of all, they have managed to perform a take off with only 1.5 m/s wind speed at the ground, which is remarkable given the fact this wind speed is very small. Considering that the wind speed in Europe is around 3 m/s this is a great achievement.
  • the next step they are planning is to test how long the kite can fly without interruption, to achieve 5000 hours of continuous flight 5000 hours per year. H/T Stefano

All in all, it seems the control software is getting ready for the field, and I can’t wait to see the development during spring and summer!

Goodies: Link to the video!

Making playlist with Android

Droid Music

If you would like to make a playlist based on the content on the folder on your droid, just open a terminal, go to the folder where the music is and run

$ls | sort | grep mp3 > "$(basename "$(pwd)")".m3u

and magically you have the playlist..
which looks like this:

04 - Pennywise - Fuck authority.ofn.mp3
07 - A Perfect Government.mp3
07 - Pearl Jam - Do The Evolution.mp3
13 - Goldfinger - 99 Red Balloons .mp3
Nirvana - 03 - Come As You Are.mp3
Oasis - Live Forever.mp3
Offspring - Smash - 05 - Genocide.mp3
System Of A Down - Aeralis.mp3
System Of A Down - Spiders.mp3
03 Whatever Happened to My Rock 'N Roll.wma

the last one is a wma, and if you don’t have time/will to convert it to mp3 can be added with:

$ls | sort | grep wma >> "$(basename "$(pwd)")".m3u

Tip found here

Neuronvisio 0.8.0 out in the wild

pyramidal_3D_change_voltage

A Pyramidal Neuron model visualized with Neuronvisio

We have just released a new version of Neuronvisio, which depends on Mayavi 4.1.x. All the goodies are described in the docs, but I want to highlight an aspect of this release which is pretty important.

When we have ported Neuronvisio, from Mayavi 3.4 to Mayavi 4.1.0, two regression bugs popped out: Issues #32 and Issue #34 .

The good thing about issue #34 was that it was gone in the 4.1.1.dev version of traitsui, therefore we had just to depend on the development snapshot, however the story was different for #32. The bug was difficult to replicate, and it seems to not be deterministic. After investigating the problem, I’ve managed to isolate and set up a Pull Request which actually fixes it https://github.com/enthought/mayavi/pull/23.

While the Pull Request was still to be accepted in the main tree of Mayavi, we wanted to distribute it out there, because Neuronvisio paper is under reviewing, and the Reviewers had several trouble to install the version 0.7.3, which depends on Mayavi 3.4. We managed to package both traitsui and Mayavi and make them as required dependencies of the new Neuronvisio, and using the special version requirement in the pavement, we could make the installation as automatic as possible.

All in all, to install the latest version of Neuronvisio, depending on the latest version of Traitsui and the patched version of Mayavi 4.1.1.dev a user has to run

pip install -U --extra-index-url=http://www.ebi.ac.uk/~mattioni/snapshots/ neuronvisio

which I think it’s pretty neat.

With the new version out, we didn’t want to remove the old docs, ’cause the version are quite different and same information applying to one version in particular. Some of our user may don’t want to update to the latest version, so we have now Neuronvisio docs hosted to the beautiful Read The Docs, at http://readthedocs.org/projects/neuronvisio/ where you can choose the docs according to the version.