CBF-SDP Interface Emulator - Quick Start

Ok so you don’t want to read all the documentation, or just want to get something running straight away. Open in the quickstart directory and you will find some simple configuration files.

There are quickstart examples for the following situations:

  1. A simple send and receive pair for a small number of channels on a single stream. The basic and simplest scheme - this will not expected to scale beyond a few hundred channels.
  2. A simple send and receive pair for a larger number of channels using multiple streams but a single output file. This employs a multi-threaded asynchronous receive and should scale. Although the performance may be limited by disk performance - both sending and receiving.
  3. A send and receive using a multicast to send to two separate receivers simultaneously one writing the data to disk and the other not. To mimic the functionality of multiple consumers.
  4. A send and receive using multiple senders to many receivers using multicast each writing their own separate measurement sets. This may be required as the the array continues to grow and if the PSI or early releases employ more than one CBF-node.

Each experiment is in its own directory - example data sets are included in the tests/data directory. You should not need to install anything other than this package to get them to work.

Running the Simple Send-Receive Pair

The system used for development needs to have Python 3 and pip installed.

Install

Always use a virtual environment. Pipenv is now Python’s officially recommended method, but we are not using it for installing requirements when building on the CI Pipeline. You are encouraged to use your preferred environment isolation (i.e. pip, conda or pipenv while developing locally.

For working with Pipenv, follow these steps at the project root:

First, ensure that ~/.local/bin is in your PATH with:

> echo $PATH

In case ~/.local/bin is not part of your PATH variable, under Linux add it with:

> export PATH=~/.local/bin:$PATH

or the equivalent in your particular OS.

Then proceed to install pipenv and the required environment packages:

> pip install pipenv # if you don't have pipenv already installed on your system
> pipenv install
> pipenv shell

You will now be inside a pipenv shell with your virtual environment ready.

Use exit to exit the pipenv environment.

Testing

  • Put tests into the tests folder
  • Use PyTest as the testing framework
  • Run tests with python setup.py test
    • Configure PyTest in setup.py and setup.cfg
  • Running the test creates the htmlcov folder
    • Inside this folder a rundown of the issues found will be accessible using the index.html file
  • All the tests should pass before merging the code

Code analysis

  • Use Pylint as the code analysis framework
  • By default it uses the PEP8 style guide
  • Use the provided code-analysis.sh script in order to run the code analysis in the module and tests
  • Code analysis should be run by calling pylint cbf_sdp. All pertaining options reside under the .pylintrc file.
  • Code analysis should only raise document related warnings (i.e. #FIXME comments) before merging the code

Writing documentation

  • The documentation generator for this project is derived from SKA’s SKA Developer Portal repository
  • The documentation can be edited under ./docs/src
  • If you want to include only your README.md file, create a symbolic link inside the ./docs/src directory if the existing one does not work:
$ cd docs/src
$ ln -s ../../README.md README.md
  • In order to build the documentation for this specific project, execute the following under ./docs:
$ make html
  • The documentation can then be consulted by opening the file ./docs/build/html/index.html