From 26b67b3d428fe3b35cebf9bff9d3467069344896 Mon Sep 17 00:00:00 2001 From: Lennart Purucker Date: Tue, 15 Oct 2024 15:21:31 +0200 Subject: [PATCH] doc: Make Docs Work Again and Stop Progress.rst Usage (#1365) * fix/maint: deprecate outdated examples, discounting progress.rst, and minor fixes to the tests. * doc: update wording to reflect new state --- CONTRIBUTING.md | 30 ++----------------- doc/progress.rst | 6 ++-- .../30_extended/flows_and_runs_tutorial.py | 4 +-- examples/30_extended/run_setup_tutorial.py | 2 +- examples/40_paper/2018_kdd_rijn_example.py | 20 +++++++++++-- pyproject.toml | 1 - 6 files changed, 27 insertions(+), 36 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c2b4be187..cc8633f84 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -141,7 +141,7 @@ following rules before you submit a pull request: - 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. + created. Make sure the title is descriptive enough to understand what the pull request does! - 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 @@ -174,8 +174,6 @@ following rules before you submit a pull request: 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. @@ -201,17 +199,12 @@ Make sure your code has good unittest **coverage** (at least 80%). Pre-commit is used for various style checking and code formatting. Before each commit, it will automatically run: - - [black](https://black.readthedocs.io/en/stable/) a code formatter. + - [ruff](https://docs.astral.sh/ruff/) a code formatter and linter. This will automatically format your code. Make sure to take a second look after any formatting takes place, if the resulting code is very bloated, consider a (small) refactor. - *note*: If Black reformats your code, the commit will automatically be aborted. - Make sure to add the formatted files (back) to your commit after checking them. - [mypy](https://mypy.readthedocs.io/en/stable/) a static type checker. In particular, make sure each function you work on has type hints. - - [flake8](https://flake8.pycqa.org/en/latest/index.html) style guide enforcement. - Almost all of the black-formatted code should automatically pass this check, - but make sure to make adjustments if it does fail. If you want to run the pre-commit tests without doing a commit, run: ```bash @@ -224,23 +217,6 @@ $ pre-commit run --all-files Make sure to do this at least once before your first commit to check your setup works. Executing a specific unit test can be done by specifying the module, test case, and test. -To obtain a hierarchical list of all tests, run - -```bash -$ pytest --collect-only - - - - - - - - - - - -``` - You may then run a specific module, test case, or unit test respectively: ```bash $ pytest tests/test_datasets/test_dataset.py @@ -271,7 +247,7 @@ information. For building the documentation, you will need to install a few additional dependencies: ```bash -$ pip install -e .[docs] +$ pip install -e .[examples,docs] ``` When dependencies are installed, run ```bash diff --git a/doc/progress.rst b/doc/progress.rst index 6496db7a8..31ab48740 100644 --- a/doc/progress.rst +++ b/doc/progress.rst @@ -3,11 +3,11 @@ .. _progress: ========= -Changelog +Changelog (discontinued after version 0.15.0) ========= -next -~~~~~~ +See GitHub releases for the latest changes. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0.15.0 ~~~~~~ diff --git a/examples/30_extended/flows_and_runs_tutorial.py b/examples/30_extended/flows_and_runs_tutorial.py index 38b0d23cf..3c017087d 100644 --- a/examples/30_extended/flows_and_runs_tutorial.py +++ b/examples/30_extended/flows_and_runs_tutorial.py @@ -101,7 +101,7 @@ [ ( "categorical", - preprocessing.OneHotEncoder(sparse=False, handle_unknown="ignore"), + preprocessing.OneHotEncoder(handle_unknown="ignore"), cat, # returns the categorical feature indices ), ( @@ -145,7 +145,7 @@ [ ( "categorical", - preprocessing.OneHotEncoder(sparse=False, handle_unknown="ignore"), + preprocessing.OneHotEncoder(handle_unknown="ignore"), categorical_feature_indices, ), ( diff --git a/examples/30_extended/run_setup_tutorial.py b/examples/30_extended/run_setup_tutorial.py index a2bc3a4df..477e49fa6 100644 --- a/examples/30_extended/run_setup_tutorial.py +++ b/examples/30_extended/run_setup_tutorial.py @@ -58,7 +58,7 @@ cat_imp = make_pipeline( - OneHotEncoder(handle_unknown="ignore", sparse=False), + OneHotEncoder(handle_unknown="ignore"), TruncatedSVD(), ) cont_imp = SimpleImputer(strategy="median") diff --git a/examples/40_paper/2018_kdd_rijn_example.py b/examples/40_paper/2018_kdd_rijn_example.py index d3ce59f35..7ec60fe53 100644 --- a/examples/40_paper/2018_kdd_rijn_example.py +++ b/examples/40_paper/2018_kdd_rijn_example.py @@ -4,8 +4,10 @@ A tutorial on how to reproduce the paper *Hyperparameter Importance Across Datasets*. -This is a Unix-only tutorial, as the requirements can not be satisfied on a Windows machine (Untested on other -systems). +Example Deprecation Warning! +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This example is not supported anymore by the OpenML-Python developers. The example is kept for reference purposes but not tested anymore. Publication ~~~~~~~~~~~ @@ -14,6 +16,16 @@ | Jan N. van Rijn and Frank Hutter | In *Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining*, 2018 | Available at https://dl.acm.org/doi/10.1145/3219819.3220058 + +Requirements +~~~~~~~~~~~~ + +This is a Unix-only tutorial, as the requirements can not be satisfied on a Windows machine (Untested on other +systems). + +The following Python packages are required: + +pip install openml[examples,docs] fanova ConfigSpace<1.0 """ # License: BSD 3-Clause @@ -26,6 +38,10 @@ ) exit() +# DEPRECATED EXAMPLE -- Avoid running this code in our CI/CD pipeline +print("This example is deprecated, remove this code to use it manually.") +exit() + import json import fanova import matplotlib.pyplot as plt diff --git a/pyproject.toml b/pyproject.toml index 0496bf23d..83f0793f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,6 @@ examples=[ "ipykernel", "seaborn", ] -examples_unix=["fanova"] docs=[ "sphinx>=3", "sphinx-gallery",