Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion climanet/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(
or patch_size[1] > daily_da.sizes[spatial_dims[1]]
):
raise ValueError(
f"Patch size {patch_size} is larger than data dimensions {daily_da.sizes[spatial_dims]}"
f"Patch size {patch_size} is larger than data dimensions {daily_da.sizes}"
)

# Reshape daily → (M, T=31, H, W), monthly → (M, H, W),
Expand Down
8 changes: 4 additions & 4 deletions climanet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ def plot_results(
add_colorbar=False
)
title_1, title_2 = title
axs[t, 0].set_title(f"{title_1}, month={t+1}")
axs[t, 1].set_title(f"{title_2}, month={t+1}")
axs[t, 0].set_title(f"{title_1}, month={target.time.dt.strftime('%Y-%m-%d').values[t]}")
axs[t, 1].set_title(f"{title_2}, month={target.time.dt.strftime('%Y-%m-%d').values[t]}")

# One shared colorbar for the row
cbar = fig.colorbar(
Expand Down Expand Up @@ -369,14 +369,14 @@ def plot_histograms(target, predictions, label="SST K", title=("Target", "Predic

# Target histogram
axs[t, 0].hist(target_t.values.flatten(), bins=30, alpha=0.7, color='blue', density=True)
axs[t, 0].set_title(f"{title_1} Histogram, month={t+1}")
axs[t, 0].set_title(f"{title_1} Histogram, month={target.time.dt.strftime('%Y-%m-%d').values[t]}")
axs[t, 0].set_xlabel(label)
axs[t, 0].set_ylabel("Frequency")
axs[t, 0].grid(True, alpha=0.3)

# Prediction histogram
axs[t, 1].hist(pred_t.values.flatten(), bins=30, alpha=0.7, color='orange', density=True)
axs[t, 1].set_title(f"{title_2} Histogram, month={t+1}")
axs[t, 1].set_title(f"{title_2} Histogram, month={target.time.dt.strftime('%Y-%m-%d').values[t]}")
axs[t, 1].set_xlabel(label)
axs[t, 1].set_ylabel("Frequency")
axs[t, 1].grid(True, alpha=0.3)
Expand Down
125 changes: 63 additions & 62 deletions notebooks/example.ipynb

Large diffs are not rendered by default.