Unverified Commit 64ae3d73 authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Fix error message for incorrect tuner config (#4919)

parent 6022859e
...@@ -109,6 +109,7 @@ linkcheck_ignore = [ ...@@ -109,6 +109,7 @@ linkcheck_ignore = [
r'https://www\.msra\.cn/', # MSRA r'https://www\.msra\.cn/', # MSRA
r'https://1drv\.ms/', # OneDrive (shortcut) r'https://1drv\.ms/', # OneDrive (shortcut)
r'https://onedrive\.live\.com/', # OneDrive r'https://onedrive\.live\.com/', # OneDrive
r'https://www\.openml\.org/',
] ]
# Ignore all links located in release.rst # Ignore all links located in release.rst
......
...@@ -110,7 +110,15 @@ class ExperimentConfig(ConfigBase): ...@@ -110,7 +110,15 @@ class ExperimentConfig(ConfigBase):
for algo_type in ['tuner', 'assessor', 'advisor']: for algo_type in ['tuner', 'assessor', 'advisor']:
algo = getattr(self, algo_type) algo = getattr(self, algo_type)
if algo is not None and algo.name == '_none_':
# TODO: need a more universal solution for similar problems
if isinstance(algo, dict):
# the base class should have converted it to `_AlgorithmConfig` if feasible
# it is a `dict` here means an exception was raised during the convertion attempt
# we do the convertion again to show user the error message
_AlgorithmConfig(**algo) # pylint: disable=not-a-mapping
if algo is not None and algo.name == '_none_': # type: ignore
setattr(self, algo_type, None) setattr(self, algo_type, None)
if self.advisor is not None: if self.advisor is not None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment