Small fixes while tsting

This commit is contained in:
Matthias 2019-07-28 15:11:41 +02:00
parent 14b43b504b
commit 73ac98da80
2 changed files with 3 additions and 3 deletions

View File

@ -176,6 +176,7 @@ class Configuration(object):
elif 'user_data_dir' not in config: elif 'user_data_dir' not in config:
# Default to cwd/user_data (legacy option ...) # Default to cwd/user_data (legacy option ...)
config.update({'user_data_dir': str(Path.cwd() / "user_data")}) config.update({'user_data_dir': str(Path.cwd() / "user_data")})
# reset to user_data_dir so this contains the absolute path. # reset to user_data_dir so this contains the absolute path.
config['user_data_dir'] = create_userdata_dir(config['user_data_dir']) config['user_data_dir'] = create_userdata_dir(config['user_data_dir'])
logger.info('Using user-data directory: %s ...', config['user_data_dir']) logger.info('Using user-data directory: %s ...', config['user_data_dir'])

View File

@ -20,8 +20,8 @@ def create_datadir(config: Dict[str, Any], datadir: Optional[str] = None) -> str
return str(folder) return str(folder)
def create_userdata_dir(directory: str) -> str: def create_userdata_dir(directory: str) -> Path:
sub_dirs = ["backtest_results", "data", "hyperopts", "plots", "strategies", ] sub_dirs = ["backtest_results", "data", "hyperopts", "plot", "strategies", ]
folder = Path(directory) folder = Path(directory)
if not folder.is_dir(): if not folder.is_dir():
folder.mkdir(parents=True) folder.mkdir(parents=True)
@ -32,5 +32,4 @@ def create_userdata_dir(directory: str) -> str:
subfolder = folder / f subfolder = folder / f
if not subfolder.is_dir(): if not subfolder.is_dir():
subfolder.mkdir(parents=False) subfolder.mkdir(parents=False)
# TODO: convert this to return Path
return folder return folder