Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit 8bd9c8d

Browse files
Merge pull request #268 from openclimatefix/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 098200d + 683d0e2 commit 8bd9c8d

File tree

125 files changed

+150
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+150
-24
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_language_version:
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.5.0
6+
rev: v4.6.0
77
hooks:
88
# list of supported hooks: https://pre-commit.com/hooks.html
99
- id: trailing-whitespace
@@ -14,12 +14,12 @@ repos:
1414
# python code formatting/linting
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
1616
# Ruff version.
17-
rev: "v0.1.13"
17+
rev: "v0.4.8"
1818
hooks:
1919
- id: ruff
2020
args: [--fix]
2121
- repo: https://github.com/psf/black
22-
rev: 23.12.1
22+
rev: 24.4.2
2323
hooks:
2424
- id: black
2525
args: [--line-length, "100"]

ocf_datapipes/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OCF Datapipes"""
2+
23
import ocf_datapipes.batch
34
import ocf_datapipes.convert
45
import ocf_datapipes.experimental

ocf_datapipes/batch/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Datapipes for batching together data"""
2+
23
from .batches import BatchKey, NumpyBatch, NWPBatchKey, NWPNumpyBatch, TensorBatch, XarrayBatch
34
from .merge_numpy_examples_to_batch import (
45
MergeNumpyBatchIterDataPipe as MergeNumpyBatch,

ocf_datapipes/batch/fake/fake_batch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Make fake batch """
2+
23
from datetime import datetime, timezone
34
from typing import Optional, Union
45

ocf_datapipes/batch/fake/gsp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Make fake GSP data """
2+
23
from datetime import datetime
34

45
import numpy as np

ocf_datapipes/batch/fake/nwp.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Make fake NWP data """
2+
23
from datetime import datetime
34

45
import numpy as np
@@ -49,12 +50,12 @@ def make_fake_nwp_data(
4950

5051
# main nwp components
5152

52-
source_batch[
53-
NWPBatchKey.nwp_init_time_utc
54-
] = time_utc # Seconds since UNIX epoch (1970-01-01).
55-
source_batch[
56-
NWPBatchKey.nwp_target_time_utc
57-
] = time_utc # Seconds since UNIX epoch (1970-01-01).
53+
source_batch[NWPBatchKey.nwp_init_time_utc] = (
54+
time_utc # Seconds since UNIX epoch (1970-01-01).
55+
)
56+
source_batch[NWPBatchKey.nwp_target_time_utc] = (
57+
time_utc # Seconds since UNIX epoch (1970-01-01).
58+
)
5859
source_batch[NWPBatchKey.nwp] = np.random.random(
5960
(batch_size, n_times, n_channels, n_y_osgb, n_x_osgb)
6061
)

ocf_datapipes/batch/fake/pv.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Make fake PV data """
2+
23
from datetime import datetime
34

45
import numpy as np

ocf_datapipes/batch/fake/satellite.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Make fake Satellite data """
2+
23
from datetime import datetime
34

45
import numpy as np
@@ -80,9 +81,9 @@ def make_fake_satellite_data(
8081
0, 100, (batch_size, width)
8182
)
8283

83-
batch[
84-
getattr(BatchKey, f"{variable}_time_utc")
85-
] = time_utc # Seconds since UNIX epoch (1970-01-01).
84+
batch[getattr(BatchKey, f"{variable}_time_utc")] = (
85+
time_utc # Seconds since UNIX epoch (1970-01-01).
86+
)
8687
# Added by np_batch_processor.Topography:
8788
batch[getattr(BatchKey, f"{variable}_surface_height")] = np.random.randint(
8889
0, 100, (batch_size, height, width)

ocf_datapipes/batch/fake/sun.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Make fake Sun data """
2+
23
import numpy as np
34

45
from ocf_datapipes.batch import BatchKey, NWPBatchKey
@@ -62,11 +63,11 @@ def make_fake_sun_data(configuration: Configuration, batch_size: int = 8):
6263
batch[BatchKey.nwp][nwp_source] = {}
6364

6465
n_nwp_timesteps = get_n_time_steps_from_config(configuration.input_data.nwp[nwp_source])
65-
batch[BatchKey.nwp][nwp_source][
66-
NWPBatchKey.nwp_target_time_solar_azimuth
67-
] = np.random.random((batch_size, n_nwp_timesteps))
68-
batch[BatchKey.nwp][nwp_source][
69-
NWPBatchKey.nwp_target_time_solar_elevation
70-
] = np.random.random((batch_size, n_nwp_timesteps))
66+
batch[BatchKey.nwp][nwp_source][NWPBatchKey.nwp_target_time_solar_azimuth] = (
67+
np.random.random((batch_size, n_nwp_timesteps))
68+
)
69+
batch[BatchKey.nwp][nwp_source][NWPBatchKey.nwp_target_time_solar_elevation] = (
70+
np.random.random((batch_size, n_nwp_timesteps))
71+
)
7172

7273
return batch

ocf_datapipes/batch/fake/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Utils Functions to for fake data """
2+
23
from datetime import timedelta
34

45
import numpy as np

0 commit comments

Comments
 (0)