Skip to content

Commit 50560b9

Browse files
committed
Address mypy issues
- Pin `pre-commit >=4.2.0`
1 parent 55f4ec5 commit 50560b9

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

conda-env/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies:
3939
# =======================
4040
# Run `pre-commit autoupdate` to get the latest pinned versions of 'rev' in
4141
# `.pre-commit.config.yaml`, then update the pinned versions here.
42-
- pre-commit >=5.0.0
42+
- pre-commit >=4.2.0
4343
- types-PyYAML >=6.0.0
4444
- ruff=0.12.2
4545
- mypy=1.16.1

e3sm_diags/driver/qbo_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def _get_psd_from_deseason(xraw, period_new):
319319
# (interpolating values of amplitude0_flipped and psd_x0_flipped from period0_flipped to period_new).
320320
# For that interpolation, we want the period to be increasing.
321321
# Therefore, we will flip the following values:
322-
period0_flipped = period0[::-1] # type: ignore
322+
period0_flipped = period0[::-1]
323323
amplitude0_flipped = amplitude0[::-1]
324324
psd_x0_flipped = psd_x0[::-1]
325325

e3sm_diags/plot/enso_diags_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def _add_colormap(
261261

262262
if conf is not None:
263263
conf = _make_lon_cyclic(conf)
264-
conf = conf.squeeze() # type: ignore
264+
conf = conf.squeeze()
265265

266266
# Values in conf will be either 0 or 1. Thus, there are only two levels -
267267
# represented by the no-hatching and hatching levels.

e3sm_diags/viewer/enso_diags_viewer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22

33
from e3sm_diags.logger import _setup_child_logger
4+
from e3sm_diags.parameter.enso_diags_parameter import EnsoDiagsParameter
45
from e3sm_diags.viewer.core_viewer import OutputViewer
56

67
from .default_viewer import create_metadata
@@ -21,16 +22,21 @@ def create_viewer(root_dir, parameters):
2122
# The name that's displayed on the viewer.
2223
display_name = "ENSO Diagnostics"
2324
set_name = "enso_diags"
25+
2426
# The title of the colums on the webpage.
2527
# Appears in the second and third columns of the bolded rows.
2628
cols = ["Description", "Plot"]
2729
viewer.add_page(display_name, short_name=set_name, columns=cols)
28-
param_dict: dict[str, list[str]] = {}
30+
param_dict: dict[str, list[EnsoDiagsParameter]] = {}
31+
2932
for param in parameters:
3033
key = param.plot_type
34+
3135
if key not in param_dict.keys():
3236
param_dict[key] = []
37+
3338
param_dict[key].append(param)
39+
3440
for plot_type in param_dict.keys():
3541
# Appears in the first column of the bolded rows.
3642
viewer.add_group(plot_type.capitalize())

0 commit comments

Comments
 (0)