Python library for classifier calibration
The PyCalib package can be installed from Pypi with the command
pip install pycalib
The documentation can be found at https://classifier-calibration.github.io/PyCalib/
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
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.
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.
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
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.
It is possible to check that the README file passes some tests for Pypi by running
make check-readme
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
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