Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
wgifford committed Aug 21, 2024
1 parent b9b6b1b commit 224d683
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions notebooks/hfdemo/tinytimemixer/ttm_m4_hourly.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
" t = range(len(true))\n",
" ax.plot(t, preds, label=\"Prediction\", linestyle=\"--\", color=\"orange\", linewidth=2)\n",
" ax.plot(t, true, label=\"GroundTruth\", linestyle=\"-\", color=\"blue\", linewidth=2)\n",
" ax.axvline(x=border-1, color=\"r\", linestyle=\"-\")\n",
" ax.axvline(x=border - 1, color=\"r\", linestyle=\"-\")\n",
" ax.set_title(f\"Example {index}\")\n",
" ax.legend(loc=\"center left\")\n",
"\n",
Expand Down Expand Up @@ -868,8 +868,8 @@
" fig, axs = plt.subplots(num_plots, 1, figsize=(10, 15))\n",
" random_indices = np.random.choice(preds.shape[0], size=num_plots, replace=False)\n",
" for idx, i in enumerate(random_indices):\n",
" gt = np.concatenate((x[i, -forecast_length * 2:, 0], trues[i]), axis=0)\n",
" prd = np.concatenate((x[i, -forecast_length * 2:, 0], preds[i, :, 0]), axis=0)\n",
" gt = np.concatenate((x[i, -forecast_length * 2 :, 0], trues[i]), axis=0)\n",
" prd = np.concatenate((x[i, -forecast_length * 2 :, 0], preds[i, :, 0]), axis=0)\n",
" m4_visual(\n",
" ax=axs[idx],\n",
" true=gt,\n",
Expand Down
2 changes: 1 addition & 1 deletion tsfm_public/toolkit/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def plot_predictions(
# Adjust figure size and subplot spacing
assert num_plots >= 1
fig, axs = plt.subplots(num_plots, 1, figsize=(10, 2 * num_plots))
if num_plots==1:
if num_plots == 1:
axs = [axs]

for i, ri in enumerate(random_indices):
Expand Down

0 comments on commit 224d683

Please sign in to comment.