juandesant / lmc-base-classes

LMC Base Classes Software Development Kit Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lmc-base-classes

Documentation Status

About

A shared repository for the Local Monitoring and Control (LMC) Base Classes. The goal is to create a Software Development Kit for the Control System of the Square Kilometre Array (SKA) radio telescope project. The Telescope Manager provides the Central Control System and each Element provides a Local Control System that all work together as the Control System for the instrument. In the SKA case Elements are subsystems such as the Central Signal Processor (CSP), Science Data Processor (SDP), Dishes (DSH), Low-Frequency Apperture Array (LFAA) etc. Control is implement using the distributed control system, TANGO, which is accessed from Python using the PyTango package.

Early work in this repo was done as part of the LMC Base Classes Evolutionary Prototype (LEvPro) project, under the INDO-SA collaboration program.

The lmc-base-classe repository contains set of eight classes as mentioned in SKA Control systems guidelines. Following is the list of base classes

  • SKABaseDevice: This is generic class that includes common attributes, commands and properties that are required for any SKA tango device.
  • SKACapability: This is generic base class for any element to provide common functionality of a capability of an SKA device.
  • SKAAlarmHandler: This is the generic class meant to handle the alarms and alerts.
  • SKALogger: This is the generic class for logging.
  • SKAMaster: This is the generic base class to provide common functionality required for any SKA Element Master device.
  • SKAObsDevice: This is the generic base classs meant to provide common functionality of a device which is directly going to be a part of an observation.
  • SKASubarray: This is the generic base class which provides common functionality required in a subarray device.
  • SKATelState: This is the generic base class to provide common functionality of a TelState device of any SKA Element.

Version History

####0.1.3

  • Storage logs are written to a file if Syslog service is not available.
  • Added exception handling
  • Improved code coverage
  • Improved compliance to coding standards
  • Improvement in documentation
  • Other minor improvements ####0.1.2
  • Internal release ####0.1.1
  • Logging functionality
  • Python3 migration
  • Repackaging of all the classes into a single Python package
  • Changes to folder structure,
  • Integration in CI environment

Installation

Requirements

The basic requirements are:

  • Python 3.5
  • Pip

The requirements for installation of the lmc bas classes are:

  • enum34
  • argparse
  • future

The requirements for testing are:

  • coverage
  • pytest
  • pytest-cov
  • pytest-xdist
  • mock

Installation steps

  1. Clone the repository on local machine.
  2. Navigate to the root directory of the repository from terminal
  3. Run 'sudo pip3 install .'

Testing

The LMC base classes can be tested locally my invoking make CI_JOB_ID=some_id test command. This invokes a chain of commands from the makefile which builds the lmc base classes python package, creates a docker image with lmc base classes, instantiates separate container for each of the base class and runs unit test cases of each class. Additionally, code analysis is also done and code coverage report is prepared. After testing is done, the containers are taken down.

Usage

The base classes are installed as python package in the system. The intended usage of the base classes is to inherit the class according to the requirement. The class needs to be imported in the module. e.g.

from skabase.SKABaseDevice.SKABaseDevice import SKABaseDevice

class DishLeafNode(with_metaclass(DeviceMeta, SKABaseDevice)):
.
.
.

Note: The lmc-base-classes repository will be repackaged soon. That will change the way of importing it.

Docs

Contribute

Contributions are always welcome! Please ensure that you adhere to our coding standards CAM_Style_guide. Use flake8 for linting (default settings, except maximum line length of 90 characters).

About

LMC Base Classes Software Development Kit Project

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 92.1%Language:Makefile 3.4%Language:Shell 2.7%Language:Dockerfile 1.7%