Coding standards#

Coding style#

We follow the PEP8 coding guidelines. A good example can be found here.

We use the pre-commit workflow together with black and flake8 to apply consistent formatting and check if your contribution complies with the PEP8 style.

For docstrings, we use the numpy docstring standard, along with sktime specific conventions described in our Developer Guide’s documentation section.

In addition, ensure that you:

  • Check out our Glossary of Common Terms.

  • Use underscores to separate words in non-class names: n_instances rather than ninstances.

  • Avoid multiple statements on one line. Prefer a line return after a control flow statement (if/for).

  • Use absolute imports for references inside sktime.

  • Don’t use import * in the source code. It is considered harmful by the official Python recommendations. It makes the code harder to read as the origin of symbols is no longer explicitly referenced, but most important, it prevents using a static analysis tool like pyflakes to automatically find bugs.

API design#

The general design approach of sktime is described in the paper “Designing Machine Learning Toolboxes: Concepts, Principles and Patterns”.

Note

Feedback and improvement suggestions are very welcome!