Skip to content

Commit

Permalink
fix: wrong date range;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Jun 25, 2024
1 parent f83a5af commit 1d4c38a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions tsdb/loading_funcs/pems_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ def load_pems_traffic(local_path):
dir_path = os.path.join(local_path, "traffic.txt")

# make columns names
col_names = [str(i) for i in range(861)]
col_names.append("OT")

col_names = [str(i) for i in range(862)]
df = pd.read_csv(dir_path, index_col=None, names=col_names)
date = pd.date_range("2016-07-01 02:00:00", "2018-07-02 01:00:00", freq="H")
date = pd.date_range(
start="2015-01-01 00:00:00",
end="2016-12-31 23:00:00",
freq="H",
)
df["date"] = date
col_names.insert(0, "date")
df = df[col_names]
Expand Down
4 changes: 2 additions & 2 deletions tsdb/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def purge_path(path: str, ignore_errors: bool = True) -> None:
os.remove(path)
# check if succeed
if not os.path.exists(path):
logger.info(f"Successfully deleted {path}.")
logger.info(f"Successfully deleted {path}")
else:
cached_dataset_dir = determine_data_home()
raise FileExistsError(
Expand Down Expand Up @@ -126,7 +126,7 @@ def determine_data_home():
if os.path.abspath(data_home_path) != os.path.abspath(default_path):
logger.warning(
f"‼️ The preset data_home path '{data_home_path}' doesn't exist. "
f"Using the default path '{default_path}'."
f"Using the default path '{default_path}'"
)
return cached_dataset_dir

Expand Down

0 comments on commit 1d4c38a

Please sign in to comment.