Skip to content

Commit

Permalink
Minor automatic reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Zimmermann committed Oct 27, 2021
1 parent 873bd5d commit 352331a
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions esmvaltool/diag_scripts/kcs/global_matching.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
"""Align the target model with the CMIP ensemble."""
import logging
from pathlib import Path
from itertools import product
from pathlib import Path

import matplotlib.pyplot as plt
import pandas as pd
import xarray as xr

from esmvaltool.diag_scripts.shared import (get_diagnostic_filename,
get_plot_filename, run_diagnostic,
select_metadata, ProvenanceLogger)
from esmvaltool.diag_scripts.shared import (
ProvenanceLogger,
get_diagnostic_filename,
get_plot_filename,
run_diagnostic,
select_metadata,
)

logger = logging.getLogger(Path(__file__).name)

Expand Down Expand Up @@ -53,9 +57,9 @@ def get_cmip_dt(metadata, year, percentile):
def get_resampling_period(target_dts, cmip_dt):
"""Return 30-year time bounds of the resampling period.
This is the period for which the target model delta T
matches the cmip delta T for a specific year.
Uses a 30-year rolling window to get the best match.
This is the period for which the target model delta T matches the
cmip delta T for a specific year. Uses a 30-year rolling window to
get the best match.
"""
target_dts = target_dts.rolling(time=30, center=True,
min_periods=30).mean()
Expand Down Expand Up @@ -85,8 +89,8 @@ def _timeline(axes, yloc, interval):
def make_plot(metadata, scenarios, cfg, provenance):
"""Make figure 3, left graph.
Multimodel values as line, reference value in black square,
steering variables in dark dots.
Multimodel values as line, reference value in black square, steering
variables in dark dots.
"""
fig, axes = plt.subplots()
for member in select_metadata(metadata, variable_group='tas_cmip'):
Expand Down

0 comments on commit 352331a

Please sign in to comment.