Simplify return valuef rom _load_object
This commit is contained in:
@@ -63,10 +63,8 @@ class HyperOptResolver(IResolver):
|
||||
# Add extra hyperopt directory on top of search paths
|
||||
abs_paths.insert(0, Path(extra_dir))
|
||||
|
||||
(hyperopt, module_path) = self._load_object(paths=abs_paths,
|
||||
object_type=IHyperOpt,
|
||||
object_name=hyperopt_name,
|
||||
kwargs={})
|
||||
hyperopt = self._load_object(paths=abs_paths, object_type=IHyperOpt,
|
||||
object_name=hyperopt_name)
|
||||
if hyperopt:
|
||||
return hyperopt
|
||||
raise OperationalException(
|
||||
@@ -120,10 +118,8 @@ class HyperOptLossResolver(IResolver):
|
||||
# Add extra hyperopt directory on top of search paths
|
||||
abs_paths.insert(0, Path(extra_dir))
|
||||
|
||||
(hyperoptloss, module_path) = self._load_object(paths=abs_paths,
|
||||
object_type=IHyperOptLoss,
|
||||
object_name=hyper_loss_name,
|
||||
kwargs={})
|
||||
hyperoptloss = self._load_object(paths=abs_paths, object_type=IHyperOptLoss,
|
||||
object_name=hyper_loss_name)
|
||||
if hyperoptloss:
|
||||
return hyperoptloss
|
||||
|
||||
|
||||
Reference in New Issue
Block a user