Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotation for distributions #220

Merged
merged 2 commits into from
Apr 24, 2022
Merged
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
9 changes: 6 additions & 3 deletions python_tests/test_search_space.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
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 BaseDistribution
from optuna.distributions import UniformDistribution
from optuna.exceptions import ExperimentalWarning
from optuna.trial import TrialState
Expand All @@ -16,7 +19,7 @@ def setUp(self) -> None:
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),
Expand Down Expand Up @@ -47,7 +50,7 @@ def test_same_distributions(self) -> None:
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),
Expand Down Expand Up @@ -78,7 +81,7 @@ def test_different_distributions(self) -> None:
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),
Expand Down