Welcome to our contributing guidelines!
sktime is a community-driven project and your help is extremely welcome. If you get stuck, please don't hesitate to chat with us or raise an issue.
To find out more about how to take part in sktime's community, check out our governance document.
- How to get started
- Where to contribute
- Acknowledging contributions
- Reporting bugs
- Git and GitHub workflow
- Continuous integration
- Documentation
- Dependencies
- Coding style
- Infrastructure
- Release instructions
We are particularly motivated to support new and/or anxious contributors and people who are looking to learn and develop their skills.
- The Turing Way. A great handbook and community for open science to find lots of useful resources. Check out their Guide for Reproducible Research to get started and learn more about open-source collaboration.
- GitHub's Open Source Guides. Take a look at their How to Contribute Guide to find out more about what it means to contribute.
- scikit-learn's developer guide. sktime follows scikit-learn's API whenever possible. We assume basic familiarity with scikit-learn. If you're new to scikit-learn, take a look at their getting-started guide. If you're already familiar with scikit-learn, you may still learn something new from their developers' guide.
- Good-first issues. A good place for starting to contribute to sktime is our list of good-first issues. If you are interested in one of them, please comment on the issue or chat to us.
- Mentorship programme. We have also launched sktime's own mentorship programme. You can find out more and apply on our website!
We value all kinds of contributions - not just code. The following table gives an overview of key contribution areas.
Area | Description |
---|---|
Documentation | Improve or add docstrings, glossary terms, the user guide, and the example notebooks |
Testing | Report bugs, improve or add unit tests, conduct field testing on real-world data sets |
Code | Improve or add functionality, fix bugs |
Mentoring | Onboarding and mentoring of new contributors |
Outreach | Organize talks, tutorials or workshops, write blog posts |
Maintenance | Improve development operations (continuous integration pipeline, GitHub bots), manage and review issues/pull requests |
API design | Design interfaces for estimators and other functionality |
Project management | Finding funding, organising meetings, initiating new collaborations |
For a more detailed overview of current and future work, check out our development roadmap.
We follow the all-contributors specification and recognise various types of contributions. Take a look at our past and current contributors!
If you are a new contributor, please make sure we add you to our list of contributors. All contributions are recorded in .all-contributorsrc.
If we have missed anything, please chat with us, raise an issue or create a PR!
We use GitHub issues to track all bugs and feature requests; feel free to open an issue if you have found a bug or wish to see a feature implemented.
It is recommended to check that your issue complies with the following rules before submitting:
- Verify that your issue is not being currently addressed by other issues or pull requests.
- Please ensure all code snippets and error messages are formatted in appropriate code blocks. See Creating and highlighting code blocks.
- Please be specific about what estimators and/or functions are involved and the shape of the data, as appropriate; please include a reproducible code snippet or link to a gist. If an exception is raised, please provide the traceback.
The preferred workflow for contributing to sktime's repository is to fork the main repository on GitHub, clone, and develop on a new branch.
-
Fork the project repository by clicking on the 'Fork' button near the top right of the page. This creates a copy of the code under your GitHub user account. For more details on how to fork a repository see this guide.
-
Clone your fork of the sktime repo from your GitHub account to your local disk:
git clone [email protected]:USERNAME/sktime.git cd sktime
-
Configure and link the remote for your fork to the upstream repository:
git remote -v git remote add upstream https://github.com/alan-turing-institute/sktime.git
-
Verify the new upstream repository you've specified for your fork:
git remote -v > origin https://github.com/USERNAME/YOUR_FORK.git (fetch) > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push) > upstream https://github.com/alan-turing-institute/sktime.git (fetch) > upstream https://github.com/alan-turing-institute/sktime.git (push)
-
Sync the
master
branch of your fork with the upstream repository:git fetch upstream git checkout master --track origin/master git merge upstream/master
-
Create a new
feature
branch from themaster
branch to hold your changes:git checkout master git checkout -b <my-feature-branch>
Always use a
feature
branch. It's good practice to never work on themaster
branch! Name thefeature
branch after your contribution. -
Develop your contribution on your feature branch. Add changed files using
git add
and thengit commit
files to record your changes in Git:git add <modified_files> git commit
-
When finished, push the changes to your GitHub account with:
git push --set-upstream origin my-feature-branch
-
Follow these instructions to create a pull request from your fork. If your work is still work in progress, you can open a draft pull request. We recommend to open a pull request early, so that other contributors become aware of your work and can give you feedback early on.
-
To add more changes, simply repeat steps 7 - 8. Pull requests are updated automatically if you push new changes to the same branch.
If any of the above seems like magic to you, please look up the Git documentation on the web. If you get stuck, feel free to chat with us or raise an issue.
We use continuous integration services on GitHub to automatically check if new pull requests do not break anything and meet code quality standards such as a common coding style.
To check if your code meets our code quality standards, you can automatically run these checks before you make a new commit using the pre-commit workflow. To set up the workflow, you need to install a few extra tools:
pip install -r maint_tools/requirements.txt
Once installed, pre-commit will automatically run our code quality checks on the files you changed whenenver you make a new commit.
You can find our pre-commit configuration in .pre-commit-config.yaml.
We use pytest for unit testing. To check if your code passes all tests locally, you need to install the development version of sktime and all extra dependencies.
-
Install the development version with all extra requirements from the root directory of sktime:
pip install --editable .[all_extras]
This installs an editable development version of sktime which will include the changes you make. For trouble shooting on different operating systems, please see our detailed installation instructions.
-
To run all unit tests, run:
pytest sktime/
We use coverage via the pytest-cov plugin and codecov to measure and compare test coverage of our code.
We use sphinx and readthedocs to build and deploy our online documention. You can find our online documentation here.
The source files used to generate the online documentation can be found in docs/source/. For example, the main configuration file for sphinx is conf.py and the main page is index.rst. To add new pages, you need to add a new .rst
file and include it in the index.rst
file.
To build the documentation locally, you need to install a few extra dependencies listed in docs/requirements.txt.
-
Install extra requirements from the root directory, run:
pip install -r docs/requirements.txt
-
To build the website locally, run:
make docs
You can find the generated files in the sktime/docs/_build/
folder. To view the website, open sktime/docs/_build/html/index.html
with your preferred web browser.
We try to keep the number of core dependencies to a minimum and rely on other packages as soft dependencies when feasible.
If you add a new dependency or change the version of an existing one, you need to update the following files:
- sktime/setup.py for package installation and minimum version requirements,
- build_tools/requirements.txt for continuous integration and distribution,
- docs/requirements.txt for building the documentation,
- .binder/requirements.txt for launching notebooks on Binder.
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 automatically apply consistent formatting and check whether your contribution complies with the PEP8 style.
For docstrings, we use the numpy docstring standard.
In addition, we add the following guidelines:
- Please check out our glossary of terms.
- Use underscores to separate words in non-class names:
n_instances
rather thanninstances
. - Avoid multiple statements on one line. Prefer a line return after a control flow statement (
if
/for
). - Use absolute imports for references inside sktime.
- Please 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.
This section gives an overview of the infrastructure and continuous integration services we use.
Platform | Operation | Configuration |
---|---|---|
Travis | Build/test/distribute on MacOS | .travis.yml |
Appveyor | Build/test/distribute on Windows | appveyor.yml |
Azure Pipelines | Build/test/distribute on Linux (manylinux) | azure-pipelines.yml |
GitHub Actions | Code quality checks | .github/workflows/code-quality.yml |
Read the Docs | Build/deploy documentation | .readthedocs.yml |
Codecov | Test coverage | codecov.yml, .coveragerc |
Additional scripts used for building, unit testing and distributing can be found in build_tools/.
This section is for core developers. To make a new release, you need push-to-write access on our master branch.
sktime is not a pure Python package and depends on some non-Python code including Cython and C. We distribute compiled files, called wheels, for different operating systems and Python versions. More details can be found here:
We use continuous integration services to automatically build and distribute wheels across platforms and version. The release process is triggered on our continuous integration services by pushing a tagged commit using semantic versioning. Pushing a new tag will trigger a new build on the continuous integration services which will provide the wheels for different platforms and automatically upload them to PyPI. You can see all uploaded wheels here.
To make the release process easier, we have an interactive script that you can follow. Simply run:
make release
This calls maint_tools/make_release.py and will guide you through the release process.