adds numpy.NaN => np.nan conversion to the strategy updater since numpy2.0 changed that, now it throws errors.

To adjust more of those we can now easily expand on it.
This includes aliases for imports as well.
This commit is contained in:
hippocritical
2025-07-26 11:22:07 +02:00
parent 3ecc9c30cb
commit 52374b39f2
2 changed files with 32 additions and 4 deletions
+3
View File
@@ -42,8 +42,10 @@ def test_strategy_updater_methods(default_conf, caplog) -> None:
instance_strategy_updater = StrategyUpdater()
modified_code1 = instance_strategy_updater.update_code(
"""
import numpy as np
class testClass(IStrategy):
def populate_buy_trend():
some_variable = np.NaN
pass
def populate_sell_trend():
pass
@@ -62,6 +64,7 @@ class testClass(IStrategy):
assert "check_exit_timeout" in modified_code1
assert "custom_exit" in modified_code1
assert "INTERFACE_VERSION = 3" in modified_code1
assert "np.nan" in modified_code1
def test_strategy_updater_params(default_conf, caplog) -> None: