mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-03 10:33:08 +00:00
fix formatting
This commit is contained in:
@@ -27,6 +27,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class ft_CategoricalDistribution(CategoricalDistribution):
|
||||
name: str
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
categories: Sequence[Any],
|
||||
@@ -34,8 +35,10 @@ class ft_CategoricalDistribution(CategoricalDistribution):
|
||||
):
|
||||
return super().__init__(categories)
|
||||
|
||||
|
||||
class ft_IntDistribution(IntDistribution):
|
||||
name: str
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
low: int,
|
||||
@@ -44,6 +47,7 @@ class ft_IntDistribution(IntDistribution):
|
||||
):
|
||||
return super().__init__(low, high, **kwargs)
|
||||
|
||||
|
||||
class BaseParameter(ABC):
|
||||
"""
|
||||
Defines a parameter that can be optimized by hyperopt.
|
||||
@@ -88,9 +92,9 @@ class BaseParameter(ABC):
|
||||
return f"{self.__class__.__name__}({self.value})"
|
||||
|
||||
@abstractmethod
|
||||
def get_space(self, name: str) -> Union[
|
||||
"ft_IntDistribution", "Real", "SKDecimal", "ft_CategoricalDistribution"
|
||||
]:
|
||||
def get_space(
|
||||
self, name: str
|
||||
) -> Union["ft_IntDistribution", "Real", "SKDecimal", "ft_CategoricalDistribution"]:
|
||||
"""
|
||||
Get-space - will be used by Hyperopt to get the hyperopt Space
|
||||
"""
|
||||
@@ -187,9 +191,7 @@ class IntParameter(NumericParameter):
|
||||
:param name: A name of parameter field.
|
||||
"""
|
||||
# return Integer(low=self.low, high=self.high, name=name, **self._space_params)
|
||||
result = ft_IntDistribution(
|
||||
self.low, self.high, **self._space_params
|
||||
)
|
||||
result = ft_IntDistribution(self.low, self.high, **self._space_params)
|
||||
result.name = name
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user