Skip to content

Commit 6a9202e

Browse files
Update pre-commit dependencies and ruff hook ID (#991)
Co-authored-by: Tom Vo <[email protected]>
1 parent 821c84e commit 6a9202e

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ repos:
1111
- id: check-yaml
1212

1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.9.2
14+
rev: v0.12.2
1515
hooks:
1616
# Sort the imports
17-
- id: ruff
17+
- id: ruff-check
1818
name: ruff-sort-imports
1919
args: [--select, I, --fix]
2020
# Run the linter.
21-
- id: ruff
21+
- id: ruff-check
2222
args: [--fix]
2323
# Run the formatter.
2424
- id: ruff-format
2525

2626
- repo: https://github.com/pre-commit/mirrors-mypy
27-
rev: v1.14.1
27+
rev: v1.16.1
2828
hooks:
2929
- id: mypy
3030
args: [--config=pyproject.toml]

conda-env/dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ 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 >=3.0.0
42+
- pre-commit >=4.2.0
4343
- types-PyYAML >=6.0.0
44-
- ruff=0.9.2
45-
- mypy=1.14.1
44+
- ruff=0.12.2
45+
- mypy=1.16.1
4646
# Developer Tools
4747
# =======================
4848
- tbump=6.9.0

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)