From 43213f92302d7df0a82d3efbf54903759b6464e9 Mon Sep 17 00:00:00 2001 From: nabenabe0928 Date: Mon, 30 Sep 2024 09:40:31 +0200 Subject: [PATCH 1/3] Add future annotations as they fail with Python 3.9 --- .github/pull_request_template.md | 1 + package/samplers/nelder_mead/generate_initial_simplex.py | 2 ++ package/samplers/plmbo/plmbo.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 23454120..9a920a84 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -25,5 +25,6 @@ Otherwise, please check the following TODO list: - [ ] Replace `` in `LICENSE` of your package with your name - [ ] Fill out `README.md` in your package - [ ] Add import statements of your function or class names to be used in `__init__.py` +- [ ] (Optional) Add `from __future__ import annotations` at the head of any Python files that include MyPy typing - [ ] Apply the formatter based on the tips in [`README.md`](https://github.com/optuna/optunahub-registry/tree/main) - [ ] Check whether your module works as intended based on the tips in [`README.md`](https://github.com/optuna/optunahub-registry/tree/main) diff --git a/package/samplers/nelder_mead/generate_initial_simplex.py b/package/samplers/nelder_mead/generate_initial_simplex.py index 1114e3d9..94e65167 100644 --- a/package/samplers/nelder_mead/generate_initial_simplex.py +++ b/package/samplers/nelder_mead/generate_initial_simplex.py @@ -22,6 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +from __future__ import annotations + import numpy as np diff --git a/package/samplers/plmbo/plmbo.py b/package/samplers/plmbo/plmbo.py index d6ed9f2d..8355f2ad 100644 --- a/package/samplers/plmbo/plmbo.py +++ b/package/samplers/plmbo/plmbo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any import GPy From 7d7a4e052858367b801a62b8232d154ff1434984 Mon Sep 17 00:00:00 2001 From: nabenabe0928 Date: Mon, 30 Sep 2024 09:42:38 +0200 Subject: [PATCH 2/3] Fix --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9a920a84..195a48c1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -25,6 +25,6 @@ Otherwise, please check the following TODO list: - [ ] Replace `` in `LICENSE` of your package with your name - [ ] Fill out `README.md` in your package - [ ] Add import statements of your function or class names to be used in `__init__.py` -- [ ] (Optional) Add `from __future__ import annotations` at the head of any Python files that include MyPy typing +- [ ] (Optional) Add `from __future__ import annotations` at the head of any Python files that include MyPy typing to support older Python versions - [ ] Apply the formatter based on the tips in [`README.md`](https://github.com/optuna/optunahub-registry/tree/main) - [ ] Check whether your module works as intended based on the tips in [`README.md`](https://github.com/optuna/optunahub-registry/tree/main) From 1c8e4690f07ef1f95d361d6bbee71d29ad99b6cc Mon Sep 17 00:00:00 2001 From: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com> Date: Thu, 10 Oct 2024 08:29:11 +0200 Subject: [PATCH 3/3] Update .github/pull_request_template.md Co-authored-by: Naoto Mizuno --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 195a48c1..81910792 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -25,6 +25,6 @@ Otherwise, please check the following TODO list: - [ ] Replace `` in `LICENSE` of your package with your name - [ ] Fill out `README.md` in your package - [ ] Add import statements of your function or class names to be used in `__init__.py` -- [ ] (Optional) Add `from __future__ import annotations` at the head of any Python files that include MyPy typing to support older Python versions +- [ ] (Optional) Add `from __future__ import annotations` at the head of any Python files that include typing to support older Python versions - [ ] Apply the formatter based on the tips in [`README.md`](https://github.com/optuna/optunahub-registry/tree/main) - [ ] Check whether your module works as intended based on the tips in [`README.md`](https://github.com/optuna/optunahub-registry/tree/main)