Skip to content

matyama/makespan-poc

Repository files navigation

makespan-poc

Makespan PoC

Prototype impementations for makespan project.

Note that just some algorithms implemented here will be ported to the main Rust project. This repository generally serves to analyze the minimum makespan problem and compare different approaches (mainly in terms of solution quality, performance is of secondary concern).

Environment setup

  1. Install GLPK system libraries (see GLPK section).
  2. Download and install Poetry. E.g. pipx install poetry.
  3. Inside project directory use Python 3.8 environment: poetry env use python3.6.
  4. Install project dependencies by running poetry install or update current ones with poetry update.
  5. Install pre-commit by running poetry run pre-commit install.

There is also a convenience make target to setup the environment install all requirements:

make setup

Activate project environment by running

poetry shell

Additional libraries

GLPK

To be able to use GLPK in MILP formulation, install following system libraries.

sudo apt install -y libglpk-dev glpk-utils glpk-doc

Development

It is advised to use following make targets during development.

make fmt
  1. Reformats imports using isort.
  2. Runs black formatting tool on source code.

Again, find configuration for both tools in pyproject.toml.

make lint

This command runs:

  1. Bunch of flakehell checks against code in src/. One can find config and tweak plugins in pyproject.toml.
  2. Runs mypy static type check on src/. Configuration is in default mypy.ini.
make tests

Runs tests with doctests enabled and displays code coverage. Configuration can be tweaked in relevant sections of pyproject.toml.

All lints and tests are also available via single command:

make check

Finally, initial setup installs pre-commit hooks (see .pre-commit-config.yaml). One can run these hooks as follows:

pre-commit run --all-files