pgleeson / osb-model-validation

Tools for automated model validation in OpenSourceBrain projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

osb-model-validation

Tools for automated model validation in OpenSourceBrain projects.

Instructions

Any OSB project can have automated testing incorporated (currently, only LEMS and NEURON implementations can be tested thoroughly, though). In order to enable it:

  • create a dry-run OSB Model Test (omt) file, containing the target model file and the simulator, e.g.

    echo -e "target: LEMS_hh_nostim.xml \n engine: LEMS" > NeuroML2/hh.omt
    
  • copy the travis config file template to the projects' root dir, and rename it to .travis.yml (don't forget the leading dot!):

    cd OSB_proj_dir
    wget https://raw.githubusercontent.com/borismarin/osb-model-validation/master/templates/travis.yml.template
    mv travis.yml.template .travis.yml
    

Once these changes are pushed to the github repo, travis will run the tests automatically. You can check the results at http://travis-ci.org/OpenSourceBrain/project_name (and ideally add a travis build badge to the projects' Readme.md file). Check this project for a working example.

After this initial simple test passes, you can start writing more elaborate tests by creating a Model Emergent Properties (mep) file and corresponding omt tests. Examples of supported constructs can be found [here] (https://github.com/borismarin/hh-testing). Notice that omt tests will be automatically discovered by travis, regardless of their location.

If you are wise and want to run the tests locally before submitting your changes to github, install the omv python package

pip install git+https://github.com/borismarin/osb-model-validation.git

This package provides three shell scripts:

  • omv_test [filename.omt], which runs a specific test locally

  • omv_alltests, which recursively discovers all .omt files in the project and runs them (this is the command used by travis).

  • omv_validate_mep [filename.mep], to validate a .mep file against the current mep schema.

Evidently, we will provide a validate_omt script as soon as we agree on its schema.

In other words, to run all omt tests inside a project:

cd OSB_proj_dir
omv_alltests

About

Tools for automated model validation in OpenSourceBrain projects