Skip to content

Commit

Permalink
fix: error in data_home;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Jan 15, 2024
1 parent bf23dd5 commit 6ce9090
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tsdb/config.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[path]
data_home = .tsdb
data_home = ~/.tsdb
5 changes: 4 additions & 1 deletion tsdb/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
tsdb_config_path = os.path.join(os.path.dirname(__file__), "config.ini")
config.read(tsdb_config_path)

data_home_path = os.path.abspath(config.get("path", "data_home"))
# read from the config file
data_home_path = config.get("path", "data_home")
# replace '~' with the absolute path if existing in the path
data_home_path = data_home_path.replace("~", os.path.expanduser("~"))
old_cached_dataset_dir = os.path.join(os.path.expanduser("~"), ".tsdb_cached_datasets")

if os.path.exists(old_cached_dataset_dir):
Expand Down

0 comments on commit 6ce9090

Please sign in to comment.