mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-15 04:11:14 +00:00
fix: don't restrict spaces - explicitly defined space should win
This commit is contained in:
@@ -174,24 +174,15 @@ def detect_all_parameters(
|
||||
attr = getattr(obj, attr_name)
|
||||
if not issubclass(attr.__class__, BaseParameter):
|
||||
continue
|
||||
auto_category: str | None = None
|
||||
# Category auto detection
|
||||
for category in auto_categories:
|
||||
if attr_name.startswith(category + "_"):
|
||||
auto_category = category
|
||||
break
|
||||
if auto_category is None and attr.category is None:
|
||||
if not attr.category:
|
||||
# Category auto detection
|
||||
for category in auto_categories:
|
||||
if attr_name.startswith(category + "_"):
|
||||
attr.category = category
|
||||
break
|
||||
if attr.category is None:
|
||||
raise OperationalException(f"Cannot determine parameter space for {attr_name}.")
|
||||
if auto_category is not None and attr.category is None:
|
||||
attr.category = auto_category
|
||||
if (
|
||||
auto_category is not None
|
||||
and attr.category is not None
|
||||
and auto_category != attr.category
|
||||
):
|
||||
raise OperationalException(
|
||||
f"Conflicting parameter space for {attr_name}: {auto_category} vs {attr.category}."
|
||||
)
|
||||
|
||||
if attr.category in ("all", "default") or attr.category.isidentifier() is False:
|
||||
raise OperationalException(
|
||||
f"'{attr.category}' is not a valid space. Parameter: {attr_name}."
|
||||
|
||||
Reference in New Issue
Block a user