Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into 23-plot-a-validation-sample-after-long-ro…
Browse files Browse the repository at this point in the history
…llout
  • Loading branch information
sahahner committed Aug 14, 2024
2 parents 1c902c7 + 7113de9 commit 66b1804
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Keep it human-readable, your future self will thank you!
- `__future__` annotations for typehints
- Added Typehints where missing
- Added Changelog
- Correct errors in callback plots

### Changed

Expand Down
5 changes: 3 additions & 2 deletions src/anemoi/training/diagnostics/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,9 @@ def plot_histogram(

# Visualization trick for tp
if variable_name in {"tp", "cp"}:
hist_yt *= bins_yt[:-1]
hist_yp *= bins_yp[:-1]
# in-place multiplication does not work here because variables are different numpy types
hist_yt = hist_yt * bins_yt[:-1]
hist_yp = hist_yp * bins_yp[:-1]
# Plot the modified histogram
ax[plot_idx].bar(bins_yt[:-1], hist_yt, width=np.diff(bins_yt), color="blue", alpha=0.7, label="Truth (ERA5)")
ax[plot_idx].bar(bins_yp[:-1], hist_yp, width=np.diff(bins_yp), color="red", alpha=0.7, label="Anemoi")
Expand Down

0 comments on commit 66b1804

Please sign in to comment.