|
1 | | -How to contribute |
2 | | ------------------ |
| 1 | +This document describes the workflow on how to contribute to the openml-python package. |
| 2 | +If you are interested in connecting a machine learning package with OpenML (i.e. |
| 3 | +write an openml-python extension) or want to find other ways to contribute, see [this page](https://openml.github.io/openml-python/master/contributing.html#contributing). |
3 | 4 |
|
4 | | -The preferred workflow for contributing to the OpenML python connector is to |
| 5 | +Scope of the package |
| 6 | +-------------------- |
| 7 | + |
| 8 | +The scope of the OpenML Python package is to provide a Python interface to |
| 9 | +the OpenML platform which integrates well with Python's scientific stack, most |
| 10 | +notably [numpy](http://www.numpy.org/), [scipy](https://www.scipy.org/) and |
| 11 | +[pandas](https://pandas.pydata.org/). |
| 12 | +To reduce opportunity costs and demonstrate the usage of the package, it also |
| 13 | +implements an interface to the most popular machine learning package written |
| 14 | +in Python, [scikit-learn](http://scikit-learn.org/stable/index.html). |
| 15 | +Thereby it will automatically be compatible with many machine learning |
| 16 | +libraries written in Python. |
| 17 | + |
| 18 | +We aim to keep the package as light-weight as possible and we will try to |
| 19 | +keep the number of potential installation dependencies as low as possible. |
| 20 | +Therefore, the connection to other machine learning libraries such as |
| 21 | +*pytorch*, *keras* or *tensorflow* should not be done directly inside this |
| 22 | +package, but in a separate package using the OpenML Python connector. |
| 23 | +More information on OpenML Python connectors can be found [here](https://openml.github.io/openml-python/master/contributing.html#contributing). |
| 24 | + |
| 25 | +Reporting bugs |
| 26 | +-------------- |
| 27 | +We use GitHub issues to track all bugs and feature requests; feel free to |
| 28 | +open an issue if you have found a bug or wish to see a feature implemented. |
| 29 | + |
| 30 | +It is recommended to check that your issue complies with the |
| 31 | +following rules before submitting: |
| 32 | + |
| 33 | +- Verify that your issue is not being currently addressed by other |
| 34 | + [issues](https://github.com/openml/openml-python/issues) |
| 35 | + or [pull requests](https://github.com/openml/openml-python/pulls). |
| 36 | + |
| 37 | +- Please ensure all code snippets and error messages are formatted in |
| 38 | + appropriate code blocks. |
| 39 | + See [Creating and highlighting code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks). |
| 40 | + |
| 41 | +- Please include your operating system type and version number, as well |
| 42 | + as your Python, openml, scikit-learn, numpy, and scipy versions. This information |
| 43 | + can be found by running the following code snippet: |
| 44 | +```python |
| 45 | +import platform; print(platform.platform()) |
| 46 | +import sys; print("Python", sys.version) |
| 47 | +import numpy; print("NumPy", numpy.__version__) |
| 48 | +import scipy; print("SciPy", scipy.__version__) |
| 49 | +import sklearn; print("Scikit-Learn", sklearn.__version__) |
| 50 | +import openml; print("OpenML", openml.__version__) |
| 51 | +``` |
| 52 | + |
| 53 | +Determine what contribution to make |
| 54 | +----------------------------------- |
| 55 | +Great! You've decided you want to help out. Now what? |
| 56 | +All contributions should be linked to issues on the [Github issue tracker](https://github.com/openml/openml-python/issues). |
| 57 | +In particular for new contributors, the *good first issue* label should help you find |
| 58 | +issues which are suitable for beginners. Resolving these issues allow you to start |
| 59 | +contributing to the project without much prior knowledge. Your assistance in this area |
| 60 | +will be greatly appreciated by the more experienced developers as it helps free up |
| 61 | +their time to concentrate on other issues. |
| 62 | + |
| 63 | +If you encountered a particular part of the documentation or code that you want to improve, |
| 64 | +but there is no related open issue yet, open one first. |
| 65 | +This is important since you can first get feedback or pointers from experienced contributors. |
| 66 | + |
| 67 | +To let everyone know you are working on an issue, please leave a comment that states you will work on the issue |
| 68 | +(or, if you have the permission, *assign* yourself to the issue). This avoids double work! |
| 69 | + |
| 70 | +General git workflow |
| 71 | +-------------------- |
| 72 | + |
| 73 | +The preferred workflow for contributing to openml-python is to |
5 | 74 | fork the [main repository](https://github.com/openml/openml-python) on |
6 | 75 | GitHub, clone, check out the branch `develop`, and develop on a new branch |
7 | 76 | branch. Steps: |
@@ -114,6 +183,10 @@ First install openml with its test dependencies by running |
114 | 183 | $ pip install -e .[test] |
115 | 184 | ``` |
116 | 185 | from the repository folder. |
| 186 | +Then configure pre-commit through |
| 187 | + ```bash |
| 188 | + $ pre-commit install |
| 189 | + ``` |
117 | 190 | This will install dependencies to run unit tests, as well as [pre-commit](https://pre-commit.com/). |
118 | 191 | To run the unit tests, and check their code coverage, run: |
119 | 192 | ```bash |
@@ -141,51 +214,38 @@ If you want to run the pre-commit tests without doing a commit, run: |
141 | 214 | ``` |
142 | 215 | Make sure to do this at least once before your first commit to check your setup works. |
143 | 216 |
|
144 | | -Filing bugs |
145 | | ------------ |
146 | | -We use GitHub issues to track all bugs and feature requests; feel free to |
147 | | -open an issue if you have found a bug or wish to see a feature implemented. |
148 | | - |
149 | | -It is recommended to check that your issue complies with the |
150 | | -following rules before submitting: |
151 | | - |
152 | | -- Verify that your issue is not being currently addressed by other |
153 | | - [issues](https://github.com/openml/openml-python/issues) |
154 | | - or [pull requests](https://github.com/openml/openml-python/pulls). |
155 | | - |
156 | | -- Please ensure all code snippets and error messages are formatted in |
157 | | - appropriate code blocks. |
158 | | - See [Creating and highlighting code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks). |
159 | | - |
160 | | -- Please include your operating system type and version number, as well |
161 | | - as your Python, openml, scikit-learn, numpy, and scipy versions. This information |
162 | | - can be found by running the following code snippet: |
| 217 | +Executing a specific unit test can be done by specifying the module, test case, and test. |
| 218 | +To obtain a hierarchical list of all tests, run |
163 | 219 |
|
164 | | - ```python |
165 | | - import platform; print(platform.platform()) |
166 | | - import sys; print("Python", sys.version) |
167 | | - import numpy; print("NumPy", numpy.__version__) |
168 | | - import scipy; print("SciPy", scipy.__version__) |
169 | | - import sklearn; print("Scikit-Learn", sklearn.__version__) |
170 | | - import openml; print("OpenML", openml.__version__) |
171 | | - ``` |
| 220 | + ```bash |
| 221 | + $ pytest --collect-only |
| 222 | +
|
| 223 | + <Module 'tests/test_datasets/test_dataset.py'> |
| 224 | + <UnitTestCase 'OpenMLDatasetTest'> |
| 225 | + <TestCaseFunction 'test_dataset_format_constructor'> |
| 226 | + <TestCaseFunction 'test_get_data'> |
| 227 | + <TestCaseFunction 'test_get_data_rowid_and_ignore_and_target'> |
| 228 | + <TestCaseFunction 'test_get_data_with_ignore_attributes'> |
| 229 | + <TestCaseFunction 'test_get_data_with_rowid'> |
| 230 | + <TestCaseFunction 'test_get_data_with_target'> |
| 231 | + <UnitTestCase 'OpenMLDatasetTestOnTestServer'> |
| 232 | + <TestCaseFunction 'test_tagging'> |
| 233 | + ``` |
172 | 234 |
|
173 | | -New contributor tips |
174 | | --------------------- |
| 235 | +You may then run a specific module, test case, or unit test respectively: |
| 236 | +```bash |
| 237 | + $ pytest tests/test_datasets/test_dataset.py |
| 238 | + $ pytest tests/test_datasets/test_dataset.py::OpenMLDatasetTest |
| 239 | + $ pytest tests/test_datasets/test_dataset.py::OpenMLDatasetTest::test_get_data |
| 240 | +``` |
175 | 241 |
|
176 | | -A great way to start contributing to openml-python is to pick an item |
177 | | -from the list of [Good First Issues](https://github.com/openml/openml-python/labels/Good%20first%20issue) |
178 | | -in the issue tracker. Resolving these issues allow you to start |
179 | | -contributing to the project without much prior knowledge. Your |
180 | | -assistance in this area will be greatly appreciated by the more |
181 | | -experienced developers as it helps free up their time to concentrate on |
182 | | -other issues. |
| 242 | +Happy testing! |
183 | 243 |
|
184 | 244 | Documentation |
185 | 245 | ------------- |
186 | 246 |
|
187 | 247 | We are glad to accept any sort of documentation: function docstrings, |
188 | | -reStructuredText documents (like this one), tutorials, etc. |
| 248 | +reStructuredText documents, tutorials, etc. |
189 | 249 | reStructuredText documents live in the source code repository under the |
190 | 250 | doc/ directory. |
191 | 251 |
|
|
0 commit comments