The preferred workflow for contributing to the OpenML python connector is to
fork the main repository on
GitHub, clone, check out the branch develop, and develop on a new branch
branch. Steps:
-
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 openml-python repo from your GitHub account to your local disk:
$ git clone git@github.com:YourLogin/openml-python.git $ cd openml-python -
Switch to the
developbranch:$ git checkout develop
-
Create a
featurebranch to hold your development changes:$ git checkout -b feature/my-feature
Always use a
featurebranch. It's good practice to never work on themasterordevelopbranch! To make the nature of your pull request easily visible, please prepend the name of the branch with the type of changes you want to merge, such asfeatureif it contains a new feature,fixfor a bugfix,docfor documentation andmaintfor other maintenance on the package. -
Develop the feature on your feature branch. Add changed files using
git addand thengit commitfiles:$ git add modified_files $ git commit
to record your changes in Git, then push the changes to your GitHub account with:
$ git push -u origin my-feature
-
Follow these instructions to create a pull request from your fork. This will send an email to the committers.
(If any of the above seems like magic to you, please look up the Git documentation on the web, or ask a friend or another contributor for help.)
We recommended that your contribution complies with the following rules before you submit a pull request:
-
Follow the pep8 style guide. With the following exceptions or additions:
- The max line length is 100 characters instead of 80.
- When creating a multi-line expression with binary operators, break before the operator.
- Add type hints to all function signatures. (note: not all functions have type hints yet, this is work in progress.)
- Use the
str.formatoverprintfstyle formatting. E.g. use"{} {}".format('hello', 'world')not"%s %s" % ('hello', 'world'). (note: old code may still useprintf-formatting, this is work in progress.)
-
If your pull request addresses an issue, please use the pull request title to describe the issue and mention the issue number in the pull request description. This will make sure a link back to the original issue is created.
-
An incomplete contribution -- where you expect to do more work before receiving a full review -- should be submitted as a
draft. These may be useful to: indicate you are working on something to avoid duplicated work, request broad review of functionality or API, or seek collaborators. Drafts often benefit from the inclusion of a task list in the PR description. -
Add unit tests and examples for any new functionality being introduced.
- If an unit test contains an upload to the test server, please ensure that it is followed by a file collection for deletion, to prevent the test server from bulking up. For example,
TestBase._mark_entity_for_removal('data', dataset.dataset_id),TestBase._mark_entity_for_removal('flow', (flow.flow_id, flow.name)). - Please ensure that the example is run on the test server by beginning with the call to
openml.config.start_using_configuration_for_example().
- If an unit test contains an upload to the test server, please ensure that it is followed by a file collection for deletion, to prevent the test server from bulking up. For example,
-
All tests pass when running
pytest. On Unix-like systems, check with (from the toplevel source folder):$ pytest
For Windows systems, execute the command from an Anaconda Prompt or add
pytestto PATH before executing the command. -
Documentation and high-coverage tests are necessary for enhancements to be accepted. Bug-fixes or new features should be provided with non-regression tests. These tests verify the correct behavior of the fix or feature. In this manner, further modifications on the code base are granted to be consistent with the desired behavior. For the Bug-fixes case, at the time of the PR, this tests should fail for the code base in develop and pass for the PR code.
-
Add your changes to the changelog in the file doc/progress.rst.
-
If any source file is being added to the repository, please add the BSD 3-Clause license to it.
You can also check for common programming errors with the following tools:
- Code with good unittest coverage (at least 80%), check with:
$ pip install pytest pytest-cov
$ pytest --cov=. path/to/tests_for_package- No style warnings, check with:
$ pip install flake8
$ flake8 --ignore E402,W503 --show-source --max-line-length 100- No mypy (typing) issues, check with:
$ pip install mypy
$ mypy openml --ignore-missing-imports --follow-imports skipWe 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 include your operating system type and version number, as well as your Python, openml, scikit-learn, numpy, and scipy versions. This information can be found by running the following code snippet:
import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import sklearn; print("Scikit-Learn", sklearn.__version__)
import openml; print("OpenML", openml.__version__)A great way to start contributing to openml-python is to pick an item from the list of Good First Issues in the issue tracker. Resolving these issues allow you to start contributing to the project without much prior knowledge. Your assistance in this area will be greatly appreciated by the more experienced developers as it helps free up their time to concentrate on other issues.
We are glad to accept any sort of documentation: function docstrings, reStructuredText documents (like this one), tutorials, etc. reStructuredText documents live in the source code repository under the doc/ directory.
You can edit the documentation using any text editor and then generate
the HTML output by typing make html from the doc/ directory.
The resulting HTML files will be placed in build/html/ and are viewable in
a web browser. See the README file in the doc/ directory for more
information.
For building the documentation, you will need sphinx, sphinx-bootstrap-theme, sphinx-gallery and numpydoc.
$ pip install sphinx sphinx-bootstrap-theme sphinx-gallery numpydocWhen dependencies are installed, run
$ sphinx-build -b html doc YOUR_PREFERRED_OUTPUT_DIRECTORY