Skip to content

Commit f835137

Browse files
committed
Update pre-commit, run and fix issues
1 parent 2c95a6e commit f835137

File tree

10 files changed

+29
-23
lines changed

10 files changed

+29
-23
lines changed

.pre-commit-config.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.0.1
3+
rev: v6.0.0
44
hooks:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- id: check-toml
8-
- repo: https://github.com/psf/black
9-
rev: 22.3.0
10-
hooks:
11-
- id: black
12-
- repo: https://github.com/pycqa/isort
13-
rev: 5.13.2
14-
hooks:
15-
- id: isort
8+
- id: check-yaml
9+
args: [--unsafe]
10+
- id: debug-statements
11+
- id: destroyed-symlinks
12+
- id: detect-private-key
1613
- repo: https://github.com/astral-sh/ruff-pre-commit
1714
# Ruff version.
18-
rev: v0.3.7
15+
rev: v0.13.0
1916
hooks:
2017
# Run the linter.
21-
- id: ruff
18+
- id: ruff-check
19+
# Run the formatter.
20+
- id: ruff-format
21+
- repo: https://github.com/pycqa/isort
22+
rev: 6.0.1
23+
hooks:
24+
- id: isort

evv4esm/ensembles/tools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

3131
"""General tools for working with ensembles."""
32+
3233
import os
3334

3435
import matplotlib.pyplot as plt

evv4esm/extensions/ks_vars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,4 @@
235235
"cosp_sunlit",
236236
"isccp_cldtot"
237237
]
238-
}
238+
}

evv4esm/extensions/kso.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
an empirically derived approximate null distribution of t using resampling
4444
techniques.
4545
"""
46+
4647
import argparse
4748
import os
4849
from collections import OrderedDict
@@ -386,7 +387,6 @@ def main(args):
386387
images = {"accept": [], "reject": [], "-": []}
387388
details = LIVVDict()
388389
for var in sorted(test_vars):
389-
390390
var_1 = e3sm.load_mpas_climatology_ensemble(ens_files[key1], var)
391391
var_2 = e3sm.load_mpas_climatology_ensemble(ens_files[key2], var)
392392

evv4esm/extensions/pg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
simulation for many initial conditions, with each initial condition subject to
3737
multiple perturbations.
3838
"""
39+
3940
import argparse
4041
import math
4142
import os
@@ -220,7 +221,6 @@ def _print_details(details):
220221

221222

222223
def main(args):
223-
224224
nvar = len(args.variables)
225225
nprt = len(args.perturbations)
226226

evv4esm/extensions/tsc.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,11 @@ def main(args):
227227
for ff in truth_files
228228
]
229229
for tt, time in enumerate(times):
230-
with Dataset(truth_ens[instance][tt]) as truth, Dataset(
231-
ref_ens[instance][tt]
232-
) as ref, Dataset(test_ens[instance][tt]) as test:
233-
230+
with (
231+
Dataset(truth_ens[instance][tt]) as truth,
232+
Dataset(ref_ens[instance][tt]) as ref,
233+
Dataset(test_ens[instance][tt]) as test,
234+
):
234235
truth_plt, truth_ps = pressure_layer_thickness(truth)
235236
ref_plt, ref_ps = pressure_layer_thickness(ref)
236237
test_plt, test_ps = pressure_layer_thickness(test)
@@ -809,7 +810,6 @@ def boxplot_delta_rmsd(args, delta_rmsd, null_hypothesis, img_file_format):
809810
list(ax1.get_yticklabels()),
810811
list(ax2.get_yticklabels()),
811812
):
812-
813813
land_var_color = pf_color_picker[
814814
null_hypothesis[
815815
(null_hypothesis["seconds"] == time)
@@ -996,7 +996,6 @@ def errorbars_delta_rmsd(args, delta_rmsd, null_hypothesis, img_file_format):
996996
for ii, var1, var2 in zip(
997997
yvals - 1, list(ax1.get_yticklabels()), list(ax2.get_yticklabels())
998998
):
999-
1000999
var1.set_color(land_colors[ii])
10011000
var2.set_color(ocean_colors[ii])
10021001

evv4esm/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def bib2html(bib, style=None, backend=None):
5353
return _bib2html_bibdata(bib, style=style, backend=backend)
5454
else:
5555
raise NotImplementedError(
56-
"I do not now how to convert a {} type to a bibliography".format(type(bib))
56+
f"I do not now how to convert a {type(bib)} type to a bibliography"
5757
)
5858

5959

test/MVKO_template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
"alpha": 0.05,
1414
"hist-name": "hist.am.timeSeriesStatsClimatology"
1515
}
16-
}
16+
}

test/MVKxx_template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
"img-fmt": "png",
1212
"hist-name": "h"
1313
}
14-
}
14+
}

test/test_evv.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ def gen_data_run_evv(evv_test):
6060
def test_evv_mvko():
6161
gen_data_run_evv("MVKO")
6262

63+
6364
def test_evv_mvkxx():
6465
gen_data_run_evv("MVKxx")
6566

67+
6668
def test_evv_tsc():
6769
gen_data_run_evv("TSC")
6870

71+
6972
def test_evv_mvk():
7073
gen_data_run_evv("MVK")

0 commit comments

Comments
 (0)