Skip to main content

Python library with tools for classifier calibration.

Project description

CI Documentation License BSD3 Python3.8 pypi codecov DOI

PyCalib

Python library for classifier calibration

User installation

The PyCalib package can be installed from Pypi with the command

pip install pycalib

Documentation

The documentation can be found at https://classifier-calibration.github.io/PyCalib/

Development

There is a make file to automate some of the common tasks during development. After downloading the repository create the virtual environment with the command

make venv

This will create a venv folder in your current folder. The environment needs to be loaded out of the makefile with

source venv/bin/activate

After the environment is loaded, all dependencies can be installed with

make requirements-dev

Unittest

Unittests are specified as doctest examples in simple functions (see example ), and more complex tests in their own python files starting with test_ (see example ).

Run the unittest with the command

make test

The test will show a unittest result including the coverage of the code. Ideally we want to increase the coverage to cover most of the library.

Contiunous Integration

Every time a commit is pushed to the master branch a unittest is run following the workflow .github/workflows/ci.yml. The CI badge in the README file will show if the test has passed or not.

Analyse code

We are trying to follow the same code standards as in Numpy and Scikit-learn, it is possible to check for pep8 and other code conventions with

make code-analysis

Documentation

The documentation can be found at https://www.classifier-calibration.com/PyCalib/, and it is automatically updated after every push to the master branch.

All documentation is done ussing the Sphinx documentation generator. The documentation is written in reStructuredText (*.rst) files in the docs/source folder. We try to follow the conventions from Numpy and Scikit-learn.

The examples with images in folder docs/source/examples are generated automatically with Sphinx-gallery from the python code in folder examples/ starting with xmpl_{example_name}.py.

The docuemnation can be build with the command

make doc

(Keep in mind that the documentation has its own Makefile inside folder docs).

After building the documentation, a new folder should appear in docs/build/ with an index.html that can be opened locally for further exploration.

The documentation is always build and deployed every time a new commit is pushed to the master branch with the workflow .github/workflows/documentation.yml.

After building, the docs/build/html folder is pushed to the branch gh-pages.

Check Readme

It is possible to check that the README file passes some tests for Pypi by running

make check-readme

Upload to PyPi

After testing that the code passes all unittests and upgrading the version in the file pycalib/__init__.py the code can be published in Pypi with the following command:

make pypi

It may require user and password if these are not set in your home directory a file .pypirc

[pypi]
username = __token__
password = pypi-yourtoken

Contributors

This code has been adapted by Miquel from several previous codes. The following is a list of people that has been involved in some parts of the code.

  • Miquel Perello Nieto
  • Hao Song
  • Telmo Silva Filho
  • Markus Kängsepp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycalib-0.1.0.dev6.tar.gz (34.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page