Developer notes

Building the docs

The documentation is a combined for the ParticleDetection and the RodTracker packages. Please make sure that ParticleDetection is installed. It is not necessary to install the DETECTRON extra. Please make sure that the RodTracker with the dependencies of the DOCS, BUILD, or DEV extra are installed.

  1. Clean the build directory:

    YOUR/REPO/PATH/docs$ make clean
    
  2. (Re-)Build the documentation:

    YOUR/REPO/PATH/docs$ make html
    

Refer to the Sphinx documentation for further options.

Warning

On Windows make sure that no other process, e.g. Dropbox, attempts to access files necessary for the build during this. Otherwise an OSError: [WinError 110] might occur and break the process.

On Linux this problem does not seem to occur.

RodTracker

The different tasks described below require additional libraries compared to the default installation. Please make sure that you install the correct extras before attempting the tasks below (see Installation options).

PyQt UI files

Please make sure that the dependencies from the DEV extra are installed. The main GUI-layout is modeled in mainwindow_layout.ui and can be changed using QtDesigner. Generate the Python file after changing the UI-File using:

pyuic5 -o path/to/mainwindow_layout.py path/to/mainwindow_layout.ui

Do not change the Python file containing the GUI-Layout manually as all changes will be lost when generating it automatically again.

Running tests

Please make sure that the dependencies from TEST or DEV extra are installed. Run the tests with pytest from within the RodTracker directory:

YOUR/REPO/PATH/RodTracker$ pytest

Note

Some tests require a display (see pytest-qt)! Make sure the machine either has a screen connected or use pytest-xvfb.

Building the docs

Please make sure that the dependencies of the DOCS, BUILD, or DEV extra are installed.

  1. Clean the build directory:

    YOUR/REPO/PATH/docs$ make clean
    
  2. (Re-)Build the documentation:

    YOUR/REPO/PATH/docs$ make html
    

Refer to the Sphinx documentation for further options.

Warning

On Windows make sure that no other process, e.g. Dropbox, attempts to access files necessary for the build during this step. Otherwise an OSError: [WinError 110] might occur and break the process.

On Linux this problem does not seem to occur.

Bundling the app

Please make sure that the dependencies of the BUILD, or DEV extra are installed. On Linux there are additional requirements to be able to run the bundling script. Refer to the PyInstaller documentation for that.

There is a script to generate an executable for both Windows and Linux. Prior to bundling it will also (re-)build the documentation because this is supposed to be contained in the bundled app.

On Windows:

YOUR/REPO/PATH/RodTracker/build-files> build_app.bat

On Linux:

YOUR/REPO/PATH/RodTracker/build-files$ build_app.sh

There are two command line options -onedir(default)/-onefile. Both will generate a .\RodTracker\build and a .\RodTracker\dist folder. The generated executables are located in the .\RodTracker\dist folder.

In the first case everything is bundled into one folder named RodTracker which can be copied or moved as a whole. Run the executable dist\RodTracker\RodTrackerApp.exe inside this folder to start the program.

The build option generates only one file, i.e. dist\RodTracker.exe, that holds all necessary files to run the program and unpacks those during runtime.

Warning

On Windows make sure that no other process, e.g. Dropbox, attempts to access files necessary for the build during this step. Otherwise an OSError: [WinError 110] might occur and break the process.

On Linux this problem does not seem to occur.

ParticleDetection

Running tests

Please make sure that the dependencies from TEST extra are installed. Run the tests with pytest from within the ParticleDetection directory:

YOUR/REPO/PATH/ParticleDetection$ pytest