Este é um tutorial rápido de como se utilizar e programar este pacote de software para fazer análises de rodadas do DESSEM.
[TOC]
- Python 3.6 or superior (
sudo apt-get install python3.6under Linux) - Python virtual environment (
sudo apt-get install python3.6-venvunder Linux) - Git
Estrutura de diretórios e arquivos:
dessemstatsDiretório raiz do pacote.README.mdEste documento - deve ser escrito em Markdown.setup.pyScript para compilar e instalar este pacote.LICENSEDocumento de licença..gitignoreEspecifica arquivos que não serão monitorados pelo git.dessemstatsMódulo base do pacote.compare_dessem_sagic.pyMódulo principal do pacote que computa os indicadores do DESSEM.
scriptsDiretório básico com os scripts do usuário.run.pyUm script básico de como rodar esta aplicação.
testsColeção de testes de uso geral.base_test.pyTeste mínimo de sanidade para o módulocompare_dessem_sagic.py.
The first step aims to clone the dessemstats repository from GitHub. It is possible to change the current working directory to the location where you want the cloned directory to be made.
$ mkdir ~/git
$ git clone https://github.com/venidera/dessemstats.git ~/git/dessemstats
$ cd ~/git/dessemstatsStart by creating a new virtual environment for your project. Next, update the packages pip and setuptools to the latest version. Then install the package itself.
$ /usr/bin/python3.6 -m venv --prompt="dessemstats" venv
$ source venv/bin/activate
(dessemstats) $ pip install --upgrade setuptools pip
(dessemstats) $ python setup.py installIt is also possible to check for errors in Python code using:
(dessemstats) $ python setup.py pylintPylint is a tool that tries to enforce a coding standard and looks for code smells. Pylint will display several messages as it analyzes the code and it can also be used for displaying some statistics about the number of warnings and errors found in different files. The current package uses a custom configuration file, tailored to Venidera code standard.
Python tests are Python classes that reside in separate files from the code being tested. In this project, module tests are based on Python unittest package and are located in the tests directory. They can be run by the following code:
(dessemstats) $ python setup.py testIn general, the developer can create and perform as many tests as he needs. However, it is important to validate them before committing a new change to the GitHub Cloud, as a way of avoiding errors. It is also important to mention that tests will only be performed if test classes extend the unittest.TestCase object.
To run your package (and also to generate a script that helps other developers to execute your package), put your package's execution routines into scripts/run.py directory. Then, once package syntax is following Venidera code standards and all tests were performed, you can run the application by executing the following code:
(dessemstats) $ python scripts/run.pyPlease file a GitHub issue to report a bug.
- Marcos Leone Filho - marcos@venidera.com
This package is released and distributed under the license GNU GPL Version 3, 29 June 2007.