refactor: update test file to use new standardized method names

Update test_decision.py to work with refactored core modules.

Changes:
- Removed wildcard imports, using explicit imports:
  - from decisionManager_v2 import DecisionManager
  - from indicators_v2 import ind_BB
  - from signals_v2 import sig_BB
- Updated method calls to use snake_case naming:
  - test.getRetroTrendAns() → test.get_retro_trend_answer()
  - test.generateMatrixProbabilityFromDict() → test.generate_matrix_probability_from_dict()
  - test.getOnlineAns() → test.get_online_answer()
- Updated variable names to snake_case:
  - sigAgrReq → sig_agr_req
  - sigAgrRetroTemplate → sig_agr_retro_template
  - retroAns → retro_ans
  - sigAgrData → sig_agr_data
- Improved spacing and formatting for PEP 8 compliance

The test file now follows the same coding standards as the refactored
core modules and maintains compatibility with all renamed methods.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mark 2025-11-24 18:38:42 +01:00
parent bfa0d13a25
commit 92eb7db4c5

View File

@ -1,10 +1,10 @@
from market_trade.core.decisionManager_v2 import *
from market_trade.core.indicators_v2 import *
from market_trade.core.signals_v2 import *
from market_trade.core.decisionManager_v2 import DecisionManager
from market_trade.core.indicators_v2 import ind_BB
from market_trade.core.signals_v2 import sig_BB
import market_trade.data.dataloader
sigAgrReq = {
sig_agr_req = {
'sig_BB': {
'className': sig_BB,
'params': {'source': 'close', 'target': 'close'},
@ -27,14 +27,15 @@ sigAgrReq = {
}
}
test = decsionManager('Pipa', sigAgrReq)
test = DecisionManager('Pipa', sig_agr_req)
import pandas as pd
df_candle = pd.read_csv("../../data/EURUSD_price_candlestick.csv")
df_candle["date"] = df_candle["timestamp"]
sigAgrRetroTemplate = {
sig_agr_retro_template = {
'sig_BB': {
'signalData': None,
'indicatorData': {'ind_BB': None}
@ -45,11 +46,11 @@ sigAgrRetroTemplate = {
}
}
retroAns = test.getRetroTrendAns(sigAgrRetroTemplate,df_candle[5000:6000].reset_index(drop=True),40)
retro_ans = test.get_retro_trend_answer(sig_agr_retro_template, df_candle[5000:6000].reset_index(drop=True), 40)
test.generateMatrixProbabilityFromDict(retroAns)
test.generate_matrix_probability_from_dict(retro_ans)
sigAgrData = {
sig_agr_data = {
'sig_BB': {
'signalData': df_candle[990:1000],
'indicatorData': {'ind_BB': df_candle[:1000]}
@ -60,4 +61,4 @@ sigAgrData = {
}
}
test.getOnlineAns(sigAgrData, 0.0)
test.get_online_answer(sig_agr_data, 0.0)