Development

To contribute to the core NaviNIBS code base, you’ll likely want to set up a development environment.

This is a bit more involved than the standard installation, but it allows you to make changes to the code and test them out without having to reinstall NaviNIBS every time.

Install Poetry

Poetry is a dependency management tool for Python. It is used here to manage the dependencies for the project.

Install Poetry by following the instructions on the Poetry website.

Clone core repo

Recommended: use Github Desktop app to clone the repo, manage contributions.

Alternatively, you can use command line git to clone the repo:

>git clone https://github.com/PrecisionNeuroLab/NaviNIBS NaviNIBS-dev
>cd NaviNIBS-dev

Install dependencies

Use Poetry to install the dependencies for the project.

...>poetry install
...>poetry shell

This will create a virtual environment for the project and install all the dependencies listed in the pyproject.toml file.

You’ll also want to clone any addons needed for development or testing. By default, these should be cloned into subfolders within NaviNIBS-dev/addons For example, the simulated tools addon:

...>mkdir addons
...>cd addons
...>git clone https://github.com/PrecisionNeuroLab/NaviNIBS_Simulated_Tools
...>cd ..

Testing setup

NaviNIBS uses pytest for testing. Some data dependencies are used for tests, including example MRI data, head models, and screenshots against which to compare. Contact Chris Cline to get access to this test data, and place it in NaviNIBS-dev/data. This should include the following subfolders:

  • testScreenshots: screenshots of the GUI in various states, used for testing

  • testSourceData: MRI, head model, and other misc data used for testing

  • tools: tools definitions used for testing

To run the tests, you can use the following command from inside the NaviNIBS-dev folder:

...>pytest -x tests