From a17061e037a3d70b4321aeea2d1f438bb8afcf80 Mon Sep 17 00:00:00 2001 From: c-bata Date: Sun, 24 Apr 2022 14:20:24 +0900 Subject: [PATCH 1/4] Update CONTRIBUTING.md --- CONTRIBUTING.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dfa54af5..3da5b830 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,21 +47,10 @@ $ docker run -it --rm -p 8080:8080 -v `PWD`:/app -w /app sqlite:///db.sqlite3 ``` $ pip install -e . -$ optuna-dashboard sqlite:///db.sqlite3 -``` - -
- -Environment variables for development - -If you set `OPTUNA_DASHBOARD_DEBUG=1`, the server will automatically restart when the source codes are changed. - -``` $ OPTUNA_DASHBOARD_DEBUG=1 optuna-dashboard sqlite:///db.sqlite3 ``` -
- +Note that `OPTUNA_DASHBOARD_DEBUG=1` makes the server will automatically restart when the source codes are changed. ## Running tests, lint checks and formatters @@ -118,10 +107,11 @@ $ tox -e flake8 -e black -e mypy $ npm run fmt ``` -### Auto-formatting Python files (by black) +### Auto-formatting Python files ``` $ black . +$ isort . ``` From 06ff7928a400769f5530b8d8376ca48d8a5a4cd1 Mon Sep 17 00:00:00 2001 From: c-bata Date: Sun, 24 Apr 2022 14:55:57 +0900 Subject: [PATCH 2/4] Update mypy command in CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3da5b830..ae9c1c6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -91,7 +91,7 @@ $ pip install -r requirements.txt $ flake8 $ black --check . $ isort . --check -$ mypy . +$ mypy optuna_dashboard python_tests ``` or From d24c6d1ea331b63d92a98552193b590f5fb11627 Mon Sep 17 00:00:00 2001 From: Makoto Hiramatsu Date: Sun, 24 Apr 2022 16:21:38 +0900 Subject: [PATCH 3/4] Add annotation for distributions --- python_tests/test_search_space.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python_tests/test_search_space.py b/python_tests/test_search_space.py index df7fe9e2..44b460ea 100644 --- a/python_tests/test_search_space.py +++ b/python_tests/test_search_space.py @@ -1,9 +1,12 @@ +from typing import Dict +from typing import List from unittest import TestCase import warnings import optuna from optuna import create_trial from optuna.distributions import UniformDistribution +from optuna.distributions import BaseDistribution from optuna.exceptions import ExperimentalWarning from optuna.trial import TrialState @@ -16,7 +19,7 @@ class SearchSpaceTestCase(TestCase): warnings.simplefilter("ignore", category=ExperimentalWarning) def test_same_distributions(self) -> None: - distributions = [ + distributions: List[Dict[str, BaseDistribution]] = [ { "x0": UniformDistribution(low=0, high=10), "x1": UniformDistribution(low=0, high=10), @@ -47,7 +50,7 @@ class SearchSpaceTestCase(TestCase): self.assertEqual(len(search_space.union), 2) def test_different_distributions(self) -> None: - distributions = [ + distributions: List[Dict[str, BaseDistribution]] = [ { "x0": UniformDistribution(low=0, high=10), "x1": UniformDistribution(low=0, high=10), @@ -78,7 +81,7 @@ class SearchSpaceTestCase(TestCase): self.assertEqual(len(search_space.union), 3) def test_dynamic_search_space(self) -> None: - distributions = [ + distributions: List[Dict[str, BaseDistribution]] = [ { "x0": UniformDistribution(low=0, high=10), "x1": UniformDistribution(low=0, high=10), From a90e1a0defa936d0c7ad21a8e2860b30a49d9cff Mon Sep 17 00:00:00 2001 From: Makoto Hiramatsu Date: Sun, 24 Apr 2022 16:47:58 +0900 Subject: [PATCH 4/4] isort --- python_tests/test_search_space.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_tests/test_search_space.py b/python_tests/test_search_space.py index 44b460ea..c03ed218 100644 --- a/python_tests/test_search_space.py +++ b/python_tests/test_search_space.py @@ -5,8 +5,8 @@ import warnings import optuna from optuna import create_trial -from optuna.distributions import UniformDistribution from optuna.distributions import BaseDistribution +from optuna.distributions import UniformDistribution from optuna.exceptions import ExperimentalWarning from optuna.trial import TrialState