Skip to content

Commit

Permalink
three minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sadamov committed May 25, 2024
1 parent 5b71be3 commit 54c44cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions neural_lam/data_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ dataset:
var_units:
- Pa
- Pa
- r"$\mathrm{W}/\mathrm{m}^2$"
- r"$\mathrm{W}/\mathrm{m}^2$"
- $\mathrm{W}/\mathrm{m}^2$
- $\mathrm{W}/\mathrm{m}^2$
- ""
- ""
- K
Expand All @@ -33,9 +33,9 @@ dataset:
- m/s
- m/s
- m/s
- r"$\mathrm{kg}/\mathrm{m}^2$"
- r"$\mathrm{m}^2/\mathrm{s}^2$"
- r"$\mathrm{m}^2/\mathrm{s}^2$"
- $\mathrm{kg}/\mathrm{m}^2$
- $\mathrm{m}^2/\mathrm{s}^2$
- $\mathrm{m}^2/\mathrm{s}^2$
var_longnames:
- pres_heightAboveGround_0_instant
- pres_heightAboveSea_0_instant
Expand Down
4 changes: 2 additions & 2 deletions neural_lam/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def plot_prediction(
1,
2,
figsize=(13, 7),
subplot_kw={"projection": data_config.coords_projection()},
subplot_kw={"projection": data_config.coords_projection},
)

# Plot pred and target
Expand Down Expand Up @@ -136,7 +136,7 @@ def plot_spatial_error(error, obs_mask, data_config, title=None, vrange=None):

fig, ax = plt.subplots(
figsize=(5, 4.8),
subplot_kw={"projection": data_config.coords_projection()},
subplot_kw={"projection": data_config.coords_projection},
)

ax.coastlines() # Add coastline outlines
Expand Down
9 changes: 6 additions & 3 deletions train_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Standard library
import json
import random
import time
from argparse import ArgumentParser
Expand Down Expand Up @@ -202,11 +203,13 @@ def main():
)
parser.add_argument(
"--var_leads_metrics_watch",
type=dict,
default={},
help="Dict with variables and lead times to log watched metrics for",
type=str,
default="{}",
help="JSON string with variables and lead times to log watched metrics"
# e.g. '{"var1": [1, 2], "var2": [3, 4]}'
)
args = parser.parse_args()
args.var_leads_metrics_watch = json.loads(args.var_leads_metrics_watch)

config_loader = config.Config.from_file(args.data_config)

Expand Down

0 comments on commit 54c44cd

Please sign in to comment.