Skip to content

Commit 45f979d

Browse files
authored
Update precommit hooks (#274)
Changes: * Manually updates the pre-commit hooks in finch
2 parents 9cfc643 + 910f7dc commit 45f979d

File tree

7 files changed

+17
-62
lines changed

7 files changed

+17
-62
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
args: [ '--allow-multiple-documents' ]
2020
- id: debug-statements
2121
- id: pretty-format-json
22-
args: ['--autofix', '--no-ensure-ascii', '--no-sort-keys']
22+
args: [ '--autofix', '--no-ensure-ascii', '--no-sort-keys' ]
2323
exclude: ".geojson"
2424
- repo: https://github.com/pycqa/flake8
2525
rev: 6.0.0
@@ -28,17 +28,17 @@ repos:
2828
additional_dependencies: [ 'flake8-rst-docstrings' ]
2929
args: [ '--config=setup.cfg' ]
3030
- repo: https://github.com/psf/black
31-
rev: 22.12.0
31+
rev: 23.1.0
3232
hooks:
3333
- id: black
3434
args: [ '--target-version=py38' ]
3535
- repo: https://github.com/PyCQA/isort
36-
rev: 5.11.4
36+
rev: 5.12.0
3737
hooks:
3838
- id: isort
3939
args: [ '--settings-file=setup.cfg' ]
4040
- repo: https://github.com/nbQA-dev/nbQA
41-
rev: 1.6.0
41+
rev: 1.6.3
4242
hooks:
4343
- id: nbqa-black
4444
args: [ '--target-version=py38' ]
@@ -53,17 +53,17 @@ repos:
5353
files: ".ipynb"
5454
args: [ '--keep-output', '--keep-count' ]
5555
- repo: https://github.com/pycqa/pydocstyle
56-
rev: 6.1.1
56+
rev: 6.3.0
5757
hooks:
5858
- id: pydocstyle
5959
args: [ '--config=setup.cfg' ]
6060
- repo: https://github.com/keewis/blackdoc
6161
rev: v0.3.8
6262
hooks:
6363
- id: blackdoc
64-
additional_dependencies: [ 'black==22.8.0' ]
64+
additional_dependencies: [ 'black==23.1.0' ]
6565
- repo: https://github.com/adrienverge/yamllint.git
66-
rev: v1.28.0
66+
rev: v1.29.0
6767
hooks:
6868
- id: yamllint
6969
args: [ '--config-file=.yamllint.yaml' ]
@@ -79,6 +79,6 @@ ci:
7979
autofix_prs: true
8080
autoupdate_branch: ''
8181
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
82-
autoupdate_schedule: quarterly
82+
autoupdate_schedule: monthly
8383
skip: [ nbstripout ]
8484
submodules: false

docs/source/notebooks/finch-usage.ipynb

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@
1212
{
1313
"cell_type": "code",
1414
"execution_count": 1,
15-
"metadata": {
16-
"execution": {
17-
"iopub.execute_input": "2023-02-15T22:12:44.628783Z",
18-
"iopub.status.busy": "2023-02-15T22:12:44.628385Z",
19-
"iopub.status.idle": "2023-02-15T22:12:49.311470Z",
20-
"shell.execute_reply": "2023-02-15T22:12:49.310505Z"
21-
}
22-
},
15+
"metadata": {},
2316
"outputs": [],
2417
"source": [
2518
"import os\n",
@@ -44,14 +37,7 @@
4437
{
4538
"cell_type": "code",
4639
"execution_count": 2,
47-
"metadata": {
48-
"execution": {
49-
"iopub.execute_input": "2023-02-15T22:12:49.317558Z",
50-
"iopub.status.busy": "2023-02-15T22:12:49.317052Z",
51-
"iopub.status.idle": "2023-02-15T22:12:49.322861Z",
52-
"shell.execute_reply": "2023-02-15T22:12:49.321899Z"
53-
}
54-
},
40+
"metadata": {},
5541
"outputs": [
5642
{
5743
"name": "stdout",
@@ -123,14 +109,7 @@
123109
{
124110
"cell_type": "code",
125111
"execution_count": 3,
126-
"metadata": {
127-
"execution": {
128-
"iopub.execute_input": "2023-02-15T22:12:49.381966Z",
129-
"iopub.status.busy": "2023-02-15T22:12:49.381176Z",
130-
"iopub.status.idle": "2023-02-15T22:12:51.960351Z",
131-
"shell.execute_reply": "2023-02-15T22:12:51.959248Z"
132-
}
133-
},
112+
"metadata": {},
134113
"outputs": [],
135114
"source": [
136115
"tasmin = \"https://pavics.ouranos.ca/twitcher/ows/proxy/thredds/dodsC/birdhouse/testdata/flyingpigeon/cmip3/tasmin.sresa2.miub_echo_g.run1.atm.da.nc\"\n",
@@ -140,14 +119,7 @@
140119
{
141120
"cell_type": "code",
142121
"execution_count": 4,
143-
"metadata": {
144-
"execution": {
145-
"iopub.execute_input": "2023-02-15T22:12:51.966098Z",
146-
"iopub.status.busy": "2023-02-15T22:12:51.965064Z",
147-
"iopub.status.idle": "2023-02-15T22:12:51.971657Z",
148-
"shell.execute_reply": "2023-02-15T22:12:51.970669Z"
149-
}
150-
},
122+
"metadata": {},
151123
"outputs": [
152124
{
153125
"name": "stdout",
@@ -174,14 +146,7 @@
174146
{
175147
"cell_type": "code",
176148
"execution_count": 5,
177-
"metadata": {
178-
"execution": {
179-
"iopub.execute_input": "2023-02-15T22:12:51.976151Z",
180-
"iopub.status.busy": "2023-02-15T22:12:51.975501Z",
181-
"iopub.status.idle": "2023-02-15T22:12:52.165682Z",
182-
"shell.execute_reply": "2023-02-15T22:12:52.164642Z"
183-
}
184-
},
149+
"metadata": {},
185150
"outputs": [
186151
{
187152
"data": {
@@ -689,14 +654,7 @@
689654
{
690655
"cell_type": "code",
691656
"execution_count": 6,
692-
"metadata": {
693-
"execution": {
694-
"iopub.execute_input": "2023-02-15T22:12:52.171175Z",
695-
"iopub.status.busy": "2023-02-15T22:12:52.170318Z",
696-
"iopub.status.idle": "2023-02-15T22:12:52.539761Z",
697-
"shell.execute_reply": "2023-02-15T22:12:52.538731Z"
698-
}
699-
},
657+
"metadata": {},
700658
"outputs": [
701659
{
702660
"name": "stdout",

finch/processes/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ def compute_indices(
217217
input = input_queue[0]
218218

219219
if isinstance(input, ComplexInput):
220-
221220
if input.supported_formats[0] == FORMATS.JSON:
222221
kwds[name] = json.loads(input.data)
223222

@@ -698,7 +697,6 @@ def zip_files(
698697

699698
n_files = len(all_files)
700699
for n, filename in enumerate(all_files):
701-
702700
percentage = int(n / n_files * 100)
703701
message = f"Zipping file {n + 1} of {n_files}"
704702
log_function(message, percentage)

finch/processes/wps_xsubset_bbox_dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def __init__(self):
6161
}
6262

6363
def _handler(self, request: WPSRequest, response: ExecuteResponse):
64-
6564
convert_to_csv = request.inputs["output_format"][0].data == "csv"
6665
if not convert_to_csv:
6766
del self.status_percentage_steps["convert_to_csv"]

finch/processes/wps_xsubset_point_dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def __init__(self):
7474
}
7575

7676
def _handler(self, request: WPSRequest, response: ExecuteResponse):
77-
7877
convert_to_csv = request.inputs["output_format"][0].data == "csv"
7978
if not convert_to_csv:
8079
del self.status_percentage_steps["convert_to_csv"]

tests/test_wps_ensemble.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ def test_ensemble_heatwave_frequency_bbox_csv(client):
227227
lines = csv.split("\n")
228228
assert lines[0].startswith("lat,lon,time")
229229
n_data_rows = len(lines) - 2
230-
assert n_data_rows == 2 * 2 * 4 # lat=2, lon=2, time=4 (last month is NaN, but kept in CSV)
230+
assert (
231+
n_data_rows == 2 * 2 * 4
232+
) # lat=2, lon=2, time=4 (last month is NaN, but kept in CSV)
231233

232234

233235
def test_ensemble_heatwave_frequency_grid_point_dates(client):

tests/test_wps_xclim_indices.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ class TestFitProcess:
245245
identifier = "fit"
246246

247247
def test_simple(self, client, netcdf_datasets):
248-
249248
inputs = [
250249
wps_input_file("da", netcdf_datasets["discharge"]),
251250
wps_literal_input("dist", "norm"),

0 commit comments

Comments
 (0)