Revert condition sequence to simplify conditions

This commit is contained in:
Matthias 2022-09-08 06:59:14 +02:00
parent 1ef1fc269e
commit f3417a8690

View File

@ -55,17 +55,16 @@ def merge_informative_pair(dataframe: pd.DataFrame, informative: pd.DataFrame,
# Rename columns to be unique # Rename columns to be unique
date_merge = 'date_merge' date_merge = 'date_merge'
if append_timeframe and not suffix: if suffix and append_timeframe:
raise ValueError("You can not specify `append_timeframe` as True and a `suffix`.")
elif append_timeframe:
date_merge = f'date_merge_{timeframe_inf}' date_merge = f'date_merge_{timeframe_inf}'
informative.columns = [f"{col}_{timeframe_inf}" for col in informative.columns] informative.columns = [f"{col}_{timeframe_inf}" for col in informative.columns]
elif suffix and not append_timeframe: elif suffix:
date_merge = f'date_merge_{suffix}' date_merge = f'date_merge_{suffix}'
informative.columns = [f"{col}_{suffix}" for col in informative.columns] informative.columns = [f"{col}_{suffix}" for col in informative.columns]
elif suffix and append_timeframe:
raise ValueError("You can not specify `append_timeframe` as True and a `suffix`.")
# Combine the 2 dataframes # Combine the 2 dataframes
# all indicators on the informative sample MUST be calculated before this point # all indicators on the informative sample MUST be calculated before this point
if ffill: if ffill: