# Path: vizier/pyvizier/shared/parameter_config.py
# class ParameterType(enum.IntEnum):
# class ScaleType(enum.IntEnum):
# class ExternalType(enum.IntEnum):
# class ParameterConfig:
#   DOUBLE = 1
#   INTEGER = 2
#   CATEGORICAL = 3
#   DISCRETE = 4
#   LINEAR = 1
#   LOG = 2
#   REVERSE_LOG = 3
#   UNIFORM_DISCRETE = 4
#   INTERNAL = 0
#   BOOLEAN = 1
#   INTEGER = 2
#   FLOAT = 3
#   def is_numeric(self) -> bool:
# def _validate_bounds(bounds: Union[Tuple[int, int], Tuple[float, float]]):
# def _get_feasible_points_and_bounds(
#     feasible_values: Sequence[float]
# ) -> Tuple[List[float], Union[Tuple[int, int], Tuple[float, float]]]:
# def _get_categories(categories: Sequence[str]) -> List[str]:
# def _get_default_value(
#     param_type: ParameterType,
#     default_value: Union[float, int, str]) -> Union[float, int, str]:
#   def factory(
#       cls,
#       name: str,
#       *,
#       bounds: Optional[Union[Tuple[int, int], Tuple[float, float]]] = None,
#       feasible_values: Optional[MonotypeParameterSequence] = None,
#       children: Optional[Sequence[Tuple[MonotypeParameterSequence,
#                                         'ParameterConfig']]] = None,
#       scale_type: Optional[ScaleType] = None,
#       default_value: Optional[Union[float, int, str]] = None,
#       external_type: Optional[ExternalType] = ExternalType.INTERNAL
#   ) -> 'ParameterConfig':
#   def name(self) -> str:
#   def type(self) -> ParameterType:
#   def external_type(self) -> ExternalType:
#   def scale_type(self) -> Optional[ScaleType]:
#   def bounds(self) -> Union[Tuple[float, float], Tuple[int, int]]:
#   def matching_parent_values(self) -> MonotypeParameterList:
#   def child_parameter_configs(self) -> List['ParameterConfig']:
#   def _del_child_parameter_configs(self):
#   def clone_without_children(self) -> 'ParameterConfig':
#   def feasible_values(self) -> Union[List[int], List[float], List[str]]:
#   def default_value(self) -> Optional[Union[int, float, str]]:
#   def _set_matching_parent_values(self,
#                                   parent_values: MonotypeParameterSequence):
#   def _set_child_parameter_configs(self, children: List['ParameterConfig']):
#   def add_children(
#       self, new_children: Sequence[Tuple[MonotypeParameterSequence,
#                                          'ParameterConfig']]
#   ) -> 'ParameterConfig':
#   def continuify(self) -> 'ParameterConfig':
#   def merge(cls, one: 'ParameterConfig',
#             other: 'ParameterConfig') -> 'ParameterConfig':
#   def traverse(
#       self,
#       show_children: bool = False) -> Generator['ParameterConfig', None, None]:
#   def contains(
#       self, value: Union[trial.ParameterValueTypes,
#                          trial.ParameterValue]) -> bool:
#   def num_feasible_values(self) -> Union[float, int]:


from typing import Any
from vizier.pyvizier.shared import parameter_config as pc
from absl.testing import absltest
from absl.testing import parameterized
      _ = parameter_config.feasible_values

    self.assertEqual(parameter_config.continuify(), parameter_config)

  def testCreatesIntegerConfig(self):
    parameter_config = pc.ParameterConfig.factory(
        'name', bounds=(1, 3), scale_type=pc.ScaleType.LOG, default_value=1)
    self.assertEqual(parameter_config.name, 'name')
    self.assertEqual(parameter_config.type, pc.ParameterType.INTEGER)
    self.assertEqual(parameter_config.feasible_values, [1, 2, 3])
    self.assertEqual(parameter_config.bounds, (1, 3))
    self.assertEqual(parameter_config.scale_type, pc.ScaleType.LOG)
    self.assertEqual(parameter_config.default_value, 1)
    self.assertIsInstance(parameter_config.default_value, int)

    self.assertEqual(
        parameter_config.continuify(),
        pc.ParameterConfig.factory(
            'name',
            bounds=(1.0, 3.0),
            scale_type=pc.ScaleType.LOG,
            default_value=1.0))

  def testCreatesDiscreteConfig(self):
    feasible_values = (-1, 3, 2)
    parameter_config = pc.ParameterConfig.factory(
        'name',
        feasible_values=feasible_values,
        scale_type=pc.ScaleType.UNIFORM_DISCRETE,
        default_value=2,

# Path: vizier/pyvizier/shared/parameter_config.py
# class ParameterType(enum.IntEnum):
# class ScaleType(enum.IntEnum):
# class ExternalType(enum.IntEnum):
# class ParameterConfig:
#   DOUBLE = 1
#   INTEGER = 2
#   CATEGORICAL = 3
#   DISCRETE = 4
#   LINEAR = 1
#   LOG = 2
#   REVERSE_LOG = 3
#   UNIFORM_DISCRETE = 4
#   INTERNAL = 0
#   BOOLEAN = 1
#   INTEGER = 2
#   FLOAT = 3
#   def is_numeric(self) -> bool:
# def _validate_bounds(bounds: Union[Tuple[int, int], Tuple[float, float]]):
# def _get_feasible_points_and_bounds(
#     feasible_values: Sequence[float]
# ) -> Tuple[List[float], Union[Tuple[int, int], Tuple[float, float]]]:
# def _get_categories(categories: Sequence[str]) -> List[str]:
# def _get_default_value(
#     param_type: ParameterType,
#     default_value: Union[float, int, str]) -> Union[float, int, str]:
#   def factory(
#       cls,
#       name: str,
#       *,
#       bounds: Optional[Union[Tuple[int, int], Tuple[float, float]]] = None,
#       feasible_values: Optional[MonotypeParameterSequence] = None,
#       children: Optional[Sequence[Tuple[MonotypeParameterSequence,
#                                         'ParameterConfig']]] = None,
#       scale_type: Optional[ScaleType] = None,
#       default_value: Optional[Union[float, int, str]] = None,
#       external_type: Optional[ExternalType] = ExternalType.INTERNAL
#   ) -> 'ParameterConfig':
#   def name(self) -> str:
#   def type(self) -> ParameterType:
#   def external_type(self) -> ExternalType:
#   def scale_type(self) -> Optional[ScaleType]:
#   def bounds(self) -> Union[Tuple[float, float], Tuple[int, int]]:
#   def matching_parent_values(self) -> MonotypeParameterList:
#   def child_parameter_configs(self) -> List['ParameterConfig']:
#   def _del_child_parameter_configs(self):
#   def clone_without_children(self) -> 'ParameterConfig':
#   def feasible_values(self) -> Union[List[int], List[float], List[str]]:
#   def default_value(self) -> Optional[Union[int, float, str]]:
#   def _set_matching_parent_values(self,
#                                   parent_values: MonotypeParameterSequence):
#   def _set_child_parameter_configs(self, children: List['ParameterConfig']):
#   def add_children(
#       self, new_children: Sequence[Tuple[MonotypeParameterSequence,
#                                          'ParameterConfig']]
#   ) -> 'ParameterConfig':
#   def continuify(self) -> 'ParameterConfig':
#   def merge(cls, one: 'ParameterConfig',
#             other: 'ParameterConfig') -> 'ParameterConfig':
#   def traverse(
#       self,
#       show_children: bool = False) -> Generator['ParameterConfig', None, None]:
#   def contains(
#       self, value: Union[trial.ParameterValueTypes,
#                          trial.ParameterValue]) -> bool:
#   def num_feasible_values(self) -> Union[float, int]:


# Path: vizier/pyvizier/shared/parameter_config_test.py
from typing import Any
from vizier.pyvizier.shared import parameter_config as pc
from absl.testing import absltest
from absl.testing import parameterized

      _ = parameter_config.feasible_values

    self.assertEqual(parameter_config.continuify(), parameter_config)

  def testCreatesIntegerConfig(self):
    parameter_config = pc.ParameterConfig.factory(
        'name', bounds=(1, 3), scale_type=pc.ScaleType.LOG, default_value=1)
    self.assertEqual(parameter_config.name, 'name')
    self.assertEqual(parameter_config.type, pc.ParameterType.INTEGER)
    self.assertEqual(parameter_config.feasible_values, [1, 2, 3])
    self.assertEqual(parameter_config.bounds, (1, 3))
    self.assertEqual(parameter_config.scale_type, pc.ScaleType.LOG)
    self.assertEqual(parameter_config.default_value, 1)
    self.assertIsInstance(parameter_config.default_value, int)

    self.assertEqual(
        parameter_config.continuify(),
        pc.ParameterConfig.factory(
            'name',
            bounds=(1.0, 3.0),
            scale_type=pc.ScaleType.LOG,
            default_value=1.0))

  def testCreatesDiscreteConfig(self):
    feasible_values = (-1, 3, 2)
    parameter_config = pc.ParameterConfig.factory(
        'name',
        feasible_values=feasible_values,
        scale_type=pc.ScaleType.UNIFORM_DISCRETE,
        default_value=2,

        external_type=pc.ExternalType.INTEGER)