Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ import openml; print("OpenML", openml.__version__)


<!-- Thanks for contributing! -->

3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Please make sure that:
* Change Log Entry: <!-- Short String, example: "Add new function `foo()` to module `bar`"; or "Fixes a bug with `bar`" -->


#### Details
#### Details
<!--
if necessary, please share the following:

Expand All @@ -28,4 +28,3 @@ if necessary, please share the following:
* How can I reproduce the issue this PR is solving and its solution?
* Any other comments?
-->

2 changes: 1 addition & 1 deletion .github/workflows/release_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:
repository: openml/openml-python
short-description: "pre-installed openml-python environment"
readme-filepath: ./docker/readme.md

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e .[test] scikit-learn==${{ matrix.scikit-learn }}

if [ "${{ matrix.pandas-version }}" != "" ]; then
echo "Installing specific pandas version: ${{ matrix.pandas-version }}"
pip install "pandas==${{ matrix.pandas-version }}"
Expand Down
23 changes: 7 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
default_language_version:
python: python3
files: |
(?x)^(
openml|
tests
)/.*\.py$
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
rev: v0.15.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --no-cache]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.19.1
hooks:
- id: mypy
additional_dependencies:
- types-requests
- types-python-dateutil
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.36.2
hooks:
- id: check-github-workflows
files: '^github/workflows/.*\.ya?ml$'
types: ["yaml"]
- id: check-dependabot
files: '^\.github/dependabot\.ya?ml$'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
files: ".*"
- id: check-case-conflict
files: ".*"
- id: check-merge-conflict
files: ".*"
- id: check-yaml
files: ".*"
- id: end-of-file-fixer
files: ".*"
types: ["yaml"]
- id: check-toml
files: ".*"
types: ["toml"]
- id: debug-statements
files: '^src/.*\.py$'
- id: mixed-line-ending
args: ['--fix=lf']
- id: trailing-whitespace
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Great! You've decided you want to help out. Now what?
All contributions should be linked to issues on the [GitHub issue tracker](https://github.com/openml/openml-python/issues).
In particular for new contributors, the *good first issue* label should help you find
issues which are suitable for beginners. Resolving these issues allows 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
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.

If you encounter a particular part of the documentation or code that you want to improve,
Expand All @@ -39,28 +39,28 @@ This is important since you can first get feedback or pointers from experienced
To let everyone know you are working on an issue, please leave a comment that states you will work on the issue
(or, if you have the permission, *assign* yourself to the issue). This avoids double work!

## Contributing Workflow Overview
## Contributing Workflow Overview
To contribute to the openml-python package, follow these steps:

0. Determine how you want to contribute (see above).
1. Set up your local development environment.
1. Fork and clone the `openml-python` repository. Then, create a new branch from the ``main`` branch. If you are new to `git`, see our [detailed documentation](#basic-git-workflow), or rely on your favorite IDE.
1. Fork and clone the `openml-python` repository. Then, create a new branch from the ``main`` branch. If you are new to `git`, see our [detailed documentation](#basic-git-workflow), or rely on your favorite IDE.
2. [Install the local dependencies](#install-local-dependencies) to run the tests for your contribution.
3. [Test your installation](#testing-your-installation) to ensure everything is set up correctly.
4. Implement your contribution. If contributing to the documentation, see [here](#contributing-to-the-documentation).
5. [Create a pull request](#pull-request-checklist).
5. [Create a pull request](#pull-request-checklist).

### Install Local Dependencies

We recommend following the instructions below to install all requirements locally.
However, it is also possible to use the [openml-python docker image](https://github.com/openml/openml-python/blob/main/docker/readme.md) for testing and building documentation. Moreover, feel free to use any alternative package managers, such as `pip`.


1. To ensure a smooth development experience, we recommend using the `uv` package manager. Thus, first install `uv`. If any Python version already exists on your system, follow the steps below, otherwise see [here](https://docs.astral.sh/uv/getting-started/installation/).
1. To ensure a smooth development experience, we recommend using the `uv` package manager. Thus, first install `uv`. If any Python version already exists on your system, follow the steps below, otherwise see [here](https://docs.astral.sh/uv/getting-started/installation/).
```bash
pip install uv
```
2. Create a virtual environment using `uv` and activate it. This will ensure that the dependencies for `openml-python` do not interfere with other Python projects on your system.
2. Create a virtual environment using `uv` and activate it. This will ensure that the dependencies for `openml-python` do not interfere with other Python projects on your system.
```bash
uv venv --seed --python 3.8 ~/.venvs/openml-python
source ~/.venvs/openml-python/bin/activate
Expand Down Expand Up @@ -119,7 +119,7 @@ Drafts often benefit from the inclusion of a
[task list](https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments)
in the PR description.

---
---

# Appendix

Expand Down Expand Up @@ -157,7 +157,7 @@ local disk:
git checkout -b feature/my-feature
```

Always use a ``feature`` branch. It's good practice to never work on the ``main`` branch!
Always use a ``feature`` branch. It's good practice to never work on the ``main`` branch!
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 as ``feature`` if it contains a new feature, ``fix`` for a bugfix, ``doc`` for documentation and ``maint`` for other maintenance on the package.

4. Develop the feature on your feature branch. Add changed files using ``git add`` and then ``git commit`` files:
Expand Down Expand Up @@ -189,7 +189,7 @@ Before each commit, it will automatically run:
if the resulting code is very bloated, consider a (small) refactor.
- [mypy](https://mypy.readthedocs.io/en/stable/) a static type checker.
In particular, make sure each function you work on has type hints.

If you want to run the pre-commit tests without doing a commit, run:
```bash
$ make check
Expand All @@ -214,4 +214,4 @@ When dependencies are installed, run
```bash
mkdocs serve
```
This will open a preview of the website.
This will open a preview of the website.
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2014-2019, Matthias Feurer, Jan van Rijn, Andreas Müller,
Copyright (c) 2014-2019, Matthias Feurer, Jan van Rijn, Andreas Müller,
Joaquin Vanschoren and others.
All rights reserved.

Expand Down Expand Up @@ -29,7 +29,7 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

License of the files CONTRIBUTING.md, ISSUE_TEMPLATE.md and
License of the files CONTRIBUTING.md, ISSUE_TEMPLATE.md and
PULL_REQUEST_TEMPLATE.md:

Those files are modifications of the respecting templates in scikit-learn and
Expand All @@ -52,7 +52,7 @@ modification, are permitted provided that the following conditions are met:
c. Neither the name of the Scikit-learn Developers nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
permission.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Bibtex entry:

We welcome contributions from both new and experienced developers!

If you would like to contribute to OpenML-Python, please read our
If you would like to contribute to OpenML-Python, please read our
[Contribution Guidelines](https://github.com/openml/openml-python/blob/main/CONTRIBUTING.md).

If you are new to open-source development, a great way to get started is by
Expand Down
24 changes: 12 additions & 12 deletions docker/readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# OpenML Python Container

This docker container has the latest version of openml-python downloaded and pre-installed.
It can also be used by developers to run unit tests or build the docs in
a fresh and/or isolated unix environment.
It can also be used by developers to run unit tests or build the docs in
a fresh and/or isolated unix environment.
This document contains information about:

1. [Usage](#usage): how to use the image and its main modes.
Expand Down Expand Up @@ -42,7 +42,7 @@ docker run -v PATH/TO/FILE:/openml/MY_SCRIPT.py openml/openml-python MY_SCRIPT.p
### Running unit tests

You can run the unit tests by passing `test` as the first argument.
It also requires a local or remote repository to be specified, which is explained
It also requires a local or remote repository to be specified, which is explained
[below]((#using-local-or-remote-code). For this example, we specify to test the
`develop` branch:

Expand All @@ -52,8 +52,8 @@ docker run openml/openml-python test develop

### Building documentation

You can build the documentation by passing `doc` as the first argument,
you should [mount]((https://docs.docker.com/storage/bind-mounts/#start-a-container-with-a-bind-mount))
You can build the documentation by passing `doc` as the first argument,
you should [mount]((https://docs.docker.com/storage/bind-mounts/#start-a-container-with-a-bind-mount))
an output directory in which the docs will be stored. You also need to provide a remote
or local repository as explained in [the section below]((#using-local-or-remote-code).
In this example, we build documentation for the `develop` branch.
Expand All @@ -67,7 +67,7 @@ on Linux:
```text
docker run --mount type=bind,source="./output",destination="/output" openml/openml-python doc develop
```

see [the section below]((#using-local-or-remote-code) for running against local changes
or a remote branch.

Expand Down Expand Up @@ -106,26 +106,26 @@ The branch may be specified by name directly if it exists on the original reposi

Where `BRANCH` is the name of the branch for which to generate the documentation.
It is also possible to build the documentation from the branch on a fork,
in this case the `BRANCH` should be specified as `GITHUB_NAME#BRANCH` (e.g.
in this case the `BRANCH` should be specified as `GITHUB_NAME#BRANCH` (e.g.
`PGijsbers#my_feature_branch`) and the name of the forked repository should be `openml-python`.

## For developers
This section contains some notes about the structure of the image,
This section contains some notes about the structure of the image,
intended for those who want to work on it.

### Added Directories
The `openml/openml-python` image is built on a vanilla `python:3` image.
Additionally, it contains the following files are directories:

- `/openml`: contains the openml-python repository in the state with which the image
was built by default. If working with a `BRANCH`, this repository will be set to
- `/openml`: contains the openml-python repository in the state with which the image
was built by default. If working with a `BRANCH`, this repository will be set to
the `HEAD` of `BRANCH`.
- `/openml/venv/`: contains the used virtual environment for `doc` and `test`. It has
`openml-python` dependencies pre-installed. When invoked with `doc` or `test`, the
`openml-python` dependencies pre-installed. When invoked with `doc` or `test`, the
dependencies will be updated based on the `setup.py` of the `BRANCH` or mounted `/code`.
- `/scripts/startup.sh`: the entrypoint of the image. Takes care of the automated features (e.g. `doc` and `test`).

## Building the image
To build the image yourself, execute `docker build -f Dockerfile .` from the `docker`
directory of the `openml-python` repository. It will use the `startup.sh` as is, so any
directory of the `openml-python` repository. It will use the `startup.sh` as is, so any
local changes will be present in the image.
2 changes: 1 addition & 1 deletion docker/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ if [ "$1" == "doc" ]; then
if [ -d "/output" ]; then
cp -r /openml/doc/build /output
fi
fi
fi
7 changes: 3 additions & 4 deletions docs/details.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Advanced User Guide

This document highlights some of the more advanced features of
`openml-python`.
`openml-python`.

## Configuration

Expand Down Expand Up @@ -34,7 +34,7 @@ following keys are defined:
trying to reconnect for a longer time, quickly increasing
the time between retries.

- connection_n_retries: number of times to retry a request if they fail.
- connection_n_retries: number of times to retry a request if they fail.
Default depends on retry_policy (5 for `human`, 50 for `robot`)
- verbosity: the level of output:
- 0: normal output
Expand All @@ -43,7 +43,7 @@ Default depends on retry_policy (5 for `human`, 50 for `robot`)

This file is easily configurable by the `openml` command line interface.
To see where the file is stored, and what its values are, use openml
configure none.
configure none.

## Docker

Expand Down Expand Up @@ -73,4 +73,3 @@ list of **tasks**.

A further explanation is given in the [OpenML user
guide](https://docs.openml.org/concepts/).

6 changes: 3 additions & 3 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension interface to allows others to contribute back. Building a
suitable extension for therefore requires an understanding of the
current OpenML-Python support.

[This tutorial](../examples/Basics/simple_flows_and_runs_tutorial) shows how the scikit-learn
[This tutorial](../examples/Basics/simple_flows_and_runs_tutorial) shows how the scikit-learn
extension works with OpenML-Python.

#### API
Expand All @@ -52,7 +52,7 @@ must be called to allow OpenML-Python to interface the new extension.

The following methods should get implemented. Although the documentation
in the extension interface should always be leading, here
we list some additional information and best practices.
we list some additional information and best practices.
Note that most methods are relatively simple
and can be implemented in several lines of code.

Expand Down Expand Up @@ -135,7 +135,7 @@ and can be implemented in several lines of code.
### Hosting the library

Each extension created should be a stand-alone repository, compatible
with the [OpenML-Python repository](https://github.com/openml/openml-python).
with the [OpenML-Python repository](https://github.com/openml/openml-python).
The extension repository should work off-the-shelf with *OpenML-Python* installed.

Create a public Github repo with the following directory structure:
Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Welcome to the documentation of the OpenML Python API, a connector to
the collaborative machine learning platform
[OpenML.org](https://www.openml.org).
[OpenML.org](https://www.openml.org).
OpenML-Python can download or upload data from OpenML, such as datasets
and machine learning experiment results.

If you are new to OpenML, we recommend checking out the [OpenML documentation](https://docs.openml.org/)
to get familiar with the concepts and features of OpenML. In particular, we recommend
reading more about the [OpenML concepts](https://docs.openml.org/concepts/).
to get familiar with the concepts and features of OpenML. In particular, we recommend
reading more about the [OpenML concepts](https://docs.openml.org/concepts/).

## :joystick: Minimal Examples

Expand Down Expand Up @@ -78,7 +78,7 @@ Contributing to the OpenML package is highly appreciated. Please see the
## Citing OpenML-Python

If you use OpenML-Python in a scientific publication, we would
appreciate a reference to our JMLR-MLOSS paper
appreciate a reference to our JMLR-MLOSS paper
["OpenML-Python: an extensible Python API for OpenML"](https://www.jmlr.org/papers/v22/19-920.html):

=== "Bibtex"
Expand All @@ -98,6 +98,6 @@ appreciate a reference to our JMLR-MLOSS paper

=== "MLA"

Feurer, Matthias, et al.
Feurer, Matthias, et al.
"OpenML-Python: an extensible Python API for OpenML."
_Journal of Machine Learning Research_ 22.100 (2021):1−5.
4 changes: 2 additions & 2 deletions examples/_external_or_deprecated/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# External or Deprecated Examples

This directory contains examples that are either external or deprecated. They may not be maintained or updated
This directory contains examples that are either external or deprecated. They may not be maintained or updated
regularly, and their functionality might not align with the latest version of the library. Moreover,
they are not shown on the documentation website.
they are not shown on the documentation website.
2 changes: 1 addition & 1 deletion openml/_api_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import shutil
import time
import urllib.parse
import xml
import xml.parsers.expat
import zipfile
from pathlib import Path

Expand Down
Loading
Loading