Skip to content
forked from sztal/pybdm

Python implementation of block decomposition method for approximating algorithmic complexity

License

Notifications You must be signed in to change notification settings

kostastsa/pybdm-1

 
 

Repository files navigation

PyBDM

https://badge.fury.io/py/pybdm.png https://travis-ci.org/sztal/pybdm.png?branch=master

Python implementation of block decomposition method for approximating algorithmic complexity. It is based on a split-apply-combine approach.

Installation

Local development:

git clone https://github.com/sztal/pybdm
cd pybdm
pip install --editable .

Standard usage:

pip install bdm

Collaboration & git workflow

The general idea is to separate ongoing work from the master branch (main development history). This will help ensuree that no accidental and unwanted changes will be pushed to overwrite the main codebase. Thus, a following workflow should be kept at all times:

  1. Start working on a new feature.
  2. Synchronize the local repository with the remote This is done usually by invoking: git pull --rebase origin <branch>, where <branch> is the name of a branch to which one synchronizes, usually this will be the master branch.
  3. Create a new branch for feature development with git checkout -b <branch name>.
  4. Work on a feature on the new branch and make as many commits as needed.
  5. When done, push the new branch to the repository and create a pull request. You can read more about pull requests here and here.
  6. The team discusses the propose changes and apply corrections and adjustments if needed.
  7. When everyone agree that the feature is ready, the new branch is merged with a target branch (usually the master branch) by the repository owner.

The above workflow is an example of shared repository approach. An alternative called fork-and-pull approach is based on everyone working on a completely separate forks of the main repository and doing between repository pull requests. This approach seems to be a little bit of an overkill for a team of few persons.

Static code analysis

At least for the beginnign let's try to keep to the PyLint configuration provided in the repo.

Unit testing

It is preferable, especially in the longterm, to follow the Test Driven Development approach. This is about writing modular code (decompose complicated logic into simple methods/functions) alongside with unit tests (simple automatically run functions that test the implementations).

PyTest is a very powerful and flexible library for unit testing, so it seems to be a good choice for this. It is quite complicated in advanced usecases, but standard usage is extremely simple. It also make benchmarking and profiling code very easy.

Documentation

I recommend to use the so-called Numpy style documentation. It makes it very easy to read docstrings in the source code and is not to hard to write (check the skeleton code of the BDM class). It can also utilize all the power of the reStructuredText markup.

Package structure

TODO

At this point it is important to mention only one special directory

_ref:It contains the reference python implementation of 2D BDM. It will not be included in the final package, but it will be perhaps of a great use during the development (i.e. for informing and validating the new implementation).

Useful VS Code extensions

Here is a short list of extensions for the VS Code IDE, that are often useful:

Features

  • TODO

About

Python implementation of block decomposition method for approximating algorithmic complexity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.4%
  • Makefile 8.6%