chore: don't return what ain't being needed
This commit is contained in:
@@ -64,7 +64,7 @@ class LookaheadAnalysisSubFunctions:
|
|||||||
|
|
||||||
table = tabulate(data, headers=headers, tablefmt="orgtbl")
|
table = tabulate(data, headers=headers, tablefmt="orgtbl")
|
||||||
print(table)
|
print(table)
|
||||||
return table, headers, data
|
return data
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def export_to_csv(config: Dict[str, Any], lookahead_analysis: List[LookaheadAnalysis]):
|
def export_to_csv(config: Dict[str, Any], lookahead_analysis: List[LookaheadAnalysis]):
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ class RecursiveAnalysisSubFunctions:
|
|||||||
|
|
||||||
table = tabulate(data, headers=headers, tablefmt="orgtbl")
|
table = tabulate(data, headers=headers, tablefmt="orgtbl")
|
||||||
print(table)
|
print(table)
|
||||||
return table, headers, data
|
return data
|
||||||
|
|
||||||
return None, None, data
|
return data
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def calculate_config_overrides(config: Config):
|
def calculate_config_overrides(config: Config):
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf
|
|||||||
|
|
||||||
instance = LookaheadAnalysis(lookahead_conf, strategy_obj)
|
instance = LookaheadAnalysis(lookahead_conf, strategy_obj)
|
||||||
instance.current_analysis = analysis
|
instance.current_analysis = analysis
|
||||||
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
||||||
lookahead_conf, [instance]
|
lookahead_conf, [instance]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -163,14 +163,14 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf
|
|||||||
analysis.false_exit_signals = 10
|
analysis.false_exit_signals = 10
|
||||||
instance = LookaheadAnalysis(lookahead_conf, strategy_obj)
|
instance = LookaheadAnalysis(lookahead_conf, strategy_obj)
|
||||||
instance.current_analysis = analysis
|
instance.current_analysis = analysis
|
||||||
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
||||||
lookahead_conf, [instance]
|
lookahead_conf, [instance]
|
||||||
)
|
)
|
||||||
assert data[0][2].__contains__("error")
|
assert data[0][2].__contains__("error")
|
||||||
|
|
||||||
# edit it into not showing an error
|
# edit it into not showing an error
|
||||||
instance.failed_bias_check = False
|
instance.failed_bias_check = False
|
||||||
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
||||||
lookahead_conf, [instance]
|
lookahead_conf, [instance]
|
||||||
)
|
)
|
||||||
assert data[0][0] == "strategy_test_v3_with_lookahead_bias.py"
|
assert data[0][0] == "strategy_test_v3_with_lookahead_bias.py"
|
||||||
@@ -183,7 +183,7 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf
|
|||||||
|
|
||||||
analysis.false_indicators.append("falseIndicator1")
|
analysis.false_indicators.append("falseIndicator1")
|
||||||
analysis.false_indicators.append("falseIndicator2")
|
analysis.false_indicators.append("falseIndicator2")
|
||||||
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
||||||
lookahead_conf, [instance]
|
lookahead_conf, [instance]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ def test_lookahead_helper_text_table_lookahead_analysis_instances(lookahead_conf
|
|||||||
assert len(data) == 1
|
assert len(data) == 1
|
||||||
|
|
||||||
# check amount of multiple rows
|
# check amount of multiple rows
|
||||||
_table, _headers, data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
data = LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
||||||
lookahead_conf, [instance, instance, instance]
|
lookahead_conf, [instance, instance, instance]
|
||||||
)
|
)
|
||||||
assert len(data) == 3
|
assert len(data) == 3
|
||||||
|
|||||||
@@ -105,9 +105,7 @@ def test_recursive_helper_text_table_recursive_analysis_instances(recursive_conf
|
|||||||
|
|
||||||
instance = RecursiveAnalysis(recursive_conf, strategy_obj)
|
instance = RecursiveAnalysis(recursive_conf, strategy_obj)
|
||||||
instance.dict_recursive = dict_diff
|
instance.dict_recursive = dict_diff
|
||||||
_table, _headers, data = RecursiveAnalysisSubFunctions.text_table_recursive_analysis_instances(
|
data = RecursiveAnalysisSubFunctions.text_table_recursive_analysis_instances([instance])
|
||||||
[instance]
|
|
||||||
)
|
|
||||||
|
|
||||||
# check row contents for a try that has too few signals
|
# check row contents for a try that has too few signals
|
||||||
assert data[0][0] == "rsi"
|
assert data[0][0] == "rsi"
|
||||||
@@ -118,9 +116,7 @@ def test_recursive_helper_text_table_recursive_analysis_instances(recursive_conf
|
|||||||
dict_diff = dict()
|
dict_diff = dict()
|
||||||
instance = RecursiveAnalysis(recursive_conf, strategy_obj)
|
instance = RecursiveAnalysis(recursive_conf, strategy_obj)
|
||||||
instance.dict_recursive = dict_diff
|
instance.dict_recursive = dict_diff
|
||||||
_table, _headers, data = RecursiveAnalysisSubFunctions.text_table_recursive_analysis_instances(
|
data = RecursiveAnalysisSubFunctions.text_table_recursive_analysis_instances([instance])
|
||||||
[instance]
|
|
||||||
)
|
|
||||||
assert len(data) == 0
|
assert len(data) == 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user