generate_filename should be private

This commit is contained in:
Matthias 2024-04-16 18:02:00 +02:00
parent a0a22f62e0
commit 18a4d6972d

View File

@ -11,7 +11,7 @@ from freqtrade.types import BacktestResultType
logger = logging.getLogger(__name__)
def generate_filename(recordfilename: Path, appendix: str, suffix: str) -> Path:
def _generate_filename(recordfilename: Path, appendix: str, suffix: str) -> Path:
"""
Generates a filename based on the provided parameters.
:param recordfilename: Path object, which can either be a filename or a directory.
@ -38,7 +38,7 @@ def store_backtest_stats(
:param stats: Dataframe containing the backtesting statistics
:param dtappendix: Datetime to use for the filename
"""
filename = generate_filename(recordfilename, dtappendix, '.json')
filename = _generate_filename(recordfilename, dtappendix, '.json')
# Store metadata separately.
file_dump_json(get_backtest_metadata_filename(filename), stats['metadata'])
@ -69,7 +69,7 @@ def _store_backtest_analysis_data(
:param dtappendix: Datetime to use for the filename
:param name: Name to use for the file, e.g. signals, rejected
"""
filename = generate_filename(recordfilename, f"{dtappendix}_{name}", '.pkl')
filename = _generate_filename(recordfilename, f"{dtappendix}_{name}", '.pkl')
file_dump_joblib(filename, data)