Development#

Installation#

For package development, the installation procedure is more complex than the one for the end user

Getting plinder#

For development you need a clone of the official GitHub repository.

$ git clone https://github.com/plinder-org/plinder.git

Creating the Conda environment#

The plinder subpackages beside plinder.core require dependencies that are not installable via pip. The most convenient way to install the aforementioned extra dependencies is a Conda environment. If you have not Conda installed yet, we recommend its installation via miniforge. Afterwards the environment can be created from the environment.yml in the local repository clone.

Note

We currently only support a Linux environment. plinder.data uses a number of dependencies which are not simply pip-installable. openstructure is for some of its functionality and is available from the aivant conda channel using conda install aivant::openstructure, but it is only built targeting Linux architectures. Additionally, networkit>=11.0, which at the time of writing, does not install cleanly on MacOS, along with a number of dependencies which are referenced by a GitHub link directly, make a pip-installable package problematic. These additional dependencies can be installed by running:

$ pip install -r requirements_data.txt

plinder.eval also relies on openstructure for metrics calculations. For Windows and MacOS users, please see the relevant Docker resources.

$ mamba env create -f environment.yml
$ mamba activate plinder

Installing plinder#

Now plinder can be installed into the created environment:

$ pip install -e .

Enabling Pre-commit hooks#

Please install pre-commit hooks, that will run the same code quality checks as the CI:

$ pre-commit install

Alternative: Using a Docker container#

We also publish the plinder project as a docker container as alternative to the Conda-based installation, to ensure the highest level of compatibility with non-Linux platforms. See the relevant docker resources here for more details:

  • docker-compose.yml: defines a base image, the plinder “app” and a test container

  • dockerfiles/base/: contains the files for the base image

  • dockerfiles/main/: contains the files for the plinder “app” image

Testing and linting#

plinder uses tox for running tests, type checks and code linting (with ruff).

$ tox -e test
$ tox -e type
$ tox -e lint

See tox.ini and .pre-commit-config.yaml for details.

Debugging#

In order to change log levels in plinder, please set:

export PLINDER_LOG_LEVEL=10