Skip to content

Commit a74482c

Browse files
committed
Fix bug when graph_timestamp_map doesn't exist
1 parent df4c0ee commit a74482c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

switch_model/tools/graph/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def timestamp(self, df, timestamp_col="timestamp"):
205205
- hour: The hour of the timestamp (US/Pacific timezone)
206206
"""
207207
timepoints = self.tools.get_dataframe(
208-
"timepoints.csv", from_inputs=True, drop_scenario_info=False
208+
filename="timepoints.csv", from_inputs=True, drop_scenario_info=False
209209
)
210210
timeseries = self.tools.get_dataframe(
211211
filename="timeseries.csv", from_inputs=True, drop_scenario_info=False
@@ -241,8 +241,8 @@ def timestamp(self, df, timestamp_col="timestamp"):
241241
on="timestamp",
242242
)
243243
except FileNotFoundError:
244-
timestamp_mapping["time_row"] = timestamp_mapping["period"]
245-
timestamp_mapping["time_column"] = timestamp_mapping["timeseries"]
244+
df["time_row"] = df["period"]
245+
df["time_column"] = df["timeseries"]
246246

247247
# Add datetime and hour column
248248
df["datetime"] = (

0 commit comments

Comments
 (0)