You can just clone your forks then install TheVirtualBrain‘s distutils packages.
That approach is described in The unaided setup.
It seems easy but TheVirtualBrain has some heavy dependencies.
To avoid having contributors deal with installing those we have created the contributor setup.

In the contributor setup you will have to install the latest TheVirtualBrain distribution.
This is the same install that end users will use.

Then use a special script to clone the repositories you want to modify.
This setup will use the python and the dependencies from the TheVirtualBrain distribution, sidestepping the need to install them.
You will run TheVirtualBrain from the distribution and the changes you have made to your local git repo will be visible.
This works by placing your repository in PYTHONPATH ahead of the code from the distribution.

Below are the commands for getting a contributor setup for the tvb-library.
You should do the same for tvb-framework if you need to change that.

The commands below are for Linux, adapt the extensions for your operating system.
Also replace [github_account] with your github account name to get a valid url to your fork.

Assuming you have your TVB Distribution package unpacked in a folder TVB_Distribution run:

The steps above will create a folder TVB_Distribution/tvb-library.
This is a clone of your forked repository. You are now ready to contribute to TVB. Good luck!

NOTE: Each time you do a clean of TVB using the tvb_clean.sh script, make sure to re-run the above described commands in order to re-initialize TVB_PATH properly. This will give you some GIT related warning which you can just ignore.

TheVirtualBrain depends on numpy and scipy, heavy native libraries.
If you can please install them using you operating system package manager.
On Linux apt-get, yum, dnf etc.

$ sudo yum install Cython numpy scipy

If such native package managers are not available please install the anaconda python distribution and use TVB with it.

If you leave the installation of these dependencies to distutils then it will try to compile them from source.
For that to work you will need C and Fortran compilers, and development libraries, not an easy task.

Using a virtual python environment is a good idea.
For vanilla python get virtualenv then create and activate an enviroment:

$ virtualenv tvb_venv
$ source tvb_venv/bin/activate

Anaconda has it’s own way of creating environments, see anaconda site.

Now to install the TheVirtualBrain packages in develop mode using distutils :

in tvb-framework, if you want to inherit from TransactionalTestCase and you want the unit-test method setup to
be done in the same transaction as the unit-test (recommended situation), then define in your subclass methods:

By default, the only branch available is ‘trunk’. You should always create a separate branch with a self-explanatory name for the new features you want to add to TVB.
In order to do this assuming you are using the contributor setup do :

Once you are done with your changes and you believe that they can be integrated into TVB master repository, go to your GitHub repository,
switch to your feature branch and issue a pull request, describing the improvements you did.
We will later test that your changes are fit to be included, and notify you of the integration process.

TVB uses numpy extensively.
Numpy is quite different from other python libraries.
Learn a bit about it before trying to understand TVB code.

The TVB framework uses sqlalchemy for ORM mapping, cherrypy as a web framework and server and genshi for html templating.
Numeric arrays are stored in the hdf5 format.
Client side we use jquery, d3 and webgl.

A TVB framework plugin, similar to a runnable task. It has a launch method.
It declares what inputs it requires and what Datatypes it produces.
Asynchronous Adapters will be run in a different process, possibly on a cluster.

Adapters may be of different types: analysers, creators, uploaders, visualizers

These plugins are discovered at TVB startup and recorded in the database table ALGORITHMS.

Example: SimulatorAdapter
code: framework_tvb/tvb/adapters

Operation:

Running an Adapter produces an Operation. It will contain the Datatypes produced by the Adapter.

Project:

Organizes the data of an user. It will contain all Operations and Datatypes.
Stored on disk in ~/TVB/PROJECTS. The numerically named folders correspond to operations with that id, the h5 files in them correspond to datatypes.