Giter Club home page Giter Club logo

dsts's Introduction

Development HOWTO

Installing the package

To install the library on the system, run:

$ sudo python setup.py install

Package functionality

This package provides a python library proving the following functionality:

  • Suffix Array
  • LZ Factorisor

Using the package

Installing the development environment

The code comes with an installation script that setups an development environment allowing further changes to be made to the code or to run additional tests. This installation script automatically downloads and installs the necessary packages. The development environment is installed within a python virtual environment, which means it will not install any global packages and perform changes affecting the machine's python intrepretter.

After cloning the repository the development environment can be installed byrunning the following:

$ scripts/install_dev_env.sh

The installation script requires virtualenv to be installed.

This will create a symbolic link between in the lib directory pointing to the src directory. This allows one to import the data structures from a python intrepretter running in an activated virtual environment (see next session), e.g:

>>> from dsts.suffix_array import SuffixArray

Activating the development environment

The development environment can be activated using the standard virtual environment scripts, which should have been installed when the development environment was installed, that is:

$ source bin/activate

And to deactivate it:

$ deactivate

Note, if you want to install the library outside the virtual environment using "python setup.py install" make sure to first deactivate the virtual environment, or run the installation command in a seperate shell.

Package management

The installation script installs the 'yolk' utility that can be used to query packages. If used in an activated development environment, yolk can be used to show all the packages that were installed to the environemnt by the installation script, as well as any added packages added manually by the user:

$ yolk -l

It can also check if there are any packages that need to be upgraded as follows:

$ yolk -U

For more instructions please check yolk's online documentation or refer to yolk's command documentationg:

$ yolk --help

To upgrade all packages required by this package, run pip as folows:

$ pip install --upgrade -r etc/requirements.txt

Running the test suit

Once the development environment has been installed one can run a test suit on the suffix array. The test suit relies on the nosetest framework which should have been installed by the installation script.

To run tests:

$ nosetests

Also, nosetests can be used to show the tested coverage of the code. The coverage package is also installed automatically in the virtual environment by the installation script.

$nosetests --with-coverage

For more verbosity, showing the tests:

$nosetests -v --with-coverage

See notetest for more information (http://nose.readthedocs.org/en/latest/).

In order to test the latest code, one needs to stage it in the virtual environment lib/ directory. This can be done by running "python setup.py install" (without sudo), while the environment is activated. To save having to stage the code everytime one needs to run the tests, the following testing script can be used:

$scripts/test.sh

Pep8, flake8, pyflakes, pylint compliance

In order to insure good quality code in this package, a number of code compliance and analysis packages are used.

There is a git pre-commit hook in the script directory. The installation of the virtual environment enables this hook by making a symbolic link to the .git directory. This script checks stages files for PEP8 compliance before commiting staged files.

One of the scripts can be used to check for pep8 and pyflakes (using the flake8) compliance:

$scripts/check.sh

In addition the installation script also installed the pylint package, which also can be used to improve the code.

More information can be found regarding the packages can be found here:

dsts's People

Contributors

ichindar avatar pombredanne avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.