Skip to content

Commit 2be079f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 62a51f0 commit 2be079f

File tree

9 files changed

+16
-25
lines changed

9 files changed

+16
-25
lines changed

colour_hdri/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def __getattr__(self, attribute: str) -> Any:
335335

336336
try:
337337
_version: str = (
338-
subprocess.check_output( # noqa: S603
338+
subprocess.check_output(
339339
["git", "describe"], # noqa: S607
340340
cwd=os.path.dirname(__file__),
341341
stderr=subprocess.STDOUT,

colour_hdri/distortion/vignette.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def apply_radial_gradient(
148148
scale_x, scale_y = tsplit(scale)
149149
offset_x, offset_y = tsplit(offset)
150150

151-
height, width = cast(Tuple, image.shape)[0:2]
151+
height, width = cast("Tuple", image.shape)[0:2]
152152
ratio = height / width
153153

154154
samples_x = np.linspace(-1, 1, height)
@@ -159,7 +159,7 @@ def apply_radial_gradient(
159159
samples_y += offset_y - 0.5
160160

161161
distance = cast(
162-
NDArrayFloat,
162+
"NDArrayFloat",
163163
np.sqrt((samples_x**2)[..., None] + (samples_y**2)[None, ...]),
164164
)
165165

@@ -797,7 +797,7 @@ def vignette_sampling_coordinates(
797797
radial_samples = radial_sampling_function(
798798
samples_rho,
799799
samples_phi,
800-
cast(float, 1 + (np.max(principal_point - 0.5) * 2)),
800+
cast("float", 1 + (np.max(principal_point - 0.5) * 2)),
801801
radial_bias,
802802
)
803803
# NOTE: Some randomisation is required to avoid a

colour_hdri/network/graphs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
7676
super().__init__(*args, **kwargs)
7777

7878
self.description = (
79-
'Process given raw file, e.g., "CR2", "CR3", "NEF", using the'
80-
'"DNG" method'
79+
'Process given raw file, e.g., "CR2", "CR3", "NEF", using the"DNG" method'
8180
)
8281

8382
self.add_input_port("index")

colour_hdri/network/nodes.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def process(self, **kwargs: Any) -> None: # noqa: ARG002
572572
if self.get_input("include_exposure_information"):
573573
text += (
574574
" - "
575-
f"{exif_group['Exposure Time']:.6f}\" "
575+
f'{exif_group["Exposure Time"]:.6f}" '
576576
f"f{exif_group['F Number']} "
577577
f"{exif_group['ISO']}"
578578
)
@@ -752,8 +752,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
752752
super().__init__(*args, **kwargs)
753753

754754
self.description = (
755-
"Compute the input transform from the input metadata using the "
756-
'"DNG" method'
755+
'Compute the input transform from the input metadata using the "DNG" method'
757756
)
758757

759758
self.add_input_port("metadata")
@@ -1150,8 +1149,7 @@ def process(self, **kwargs: Any) -> None: # noqa: ARG002
11501149
self.log("Lens vignette was successfully corrected!")
11511150
else:
11521151
self.log(
1153-
"Lens vignette was not corrected, "
1154-
"the lens might be missing data."
1152+
"Lens vignette was not corrected, the lens might be missing data."
11551153
)
11561154

11571155
if self.get_input("correct_chromatic_aberration"):
@@ -1198,8 +1196,7 @@ def process(self, **kwargs: Any) -> None: # noqa: ARG002
11981196
self.log("Lens distortion was successfully corrected!")
11991197
else:
12001198
self.log(
1201-
"Lens distortion was not corrected, "
1202-
"the lens might be missing data."
1199+
"Lens distortion was not corrected, the lens might be missing data."
12031200
)
12041201

12051202
self.set_output("output_image", output_image)

colour_hdri/sampling/variance_minimization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def light_probe_sampling_variance_minimization_Viriyothai2009(
248248
iterations = np.sqrt(lights_count).astype(np.int_)
249249
if iterations**2 != lights_count:
250250
warning(
251-
f"{lights_count} lights requested, {iterations ** 2} will be "
251+
f"{lights_count} lights requested, {iterations**2} will be "
252252
f"effectively computed!"
253253
)
254254

colour_hdri/tonemapping/global_operators/operators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,4 +855,4 @@ def f(
855855

856856
RGB = f(RGB * exposure_bias, A, B, C, D, E, F)
857857

858-
return cast(NDArrayFloat, RGB * (1 / f(linear_whitepoint, A, B, C, D, E, F)))
858+
return cast("NDArrayFloat", RGB * (1 / f(linear_whitepoint, A, B, C, D, E, F)))

colour_hdri/utilities/image.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def read_data(self, cctf_decoding: Callable | None = None) -> NDArrayFloat:
263263

264264
self.data = data
265265

266-
return cast(NDArrayFloat, data)
266+
return cast("NDArrayFloat", data)
267267

268268
exception = 'The image "path" is undefined!'
269269

@@ -309,8 +309,7 @@ def read_metadata(self) -> Metadata:
309309

310310
if not exif_data.get("EXIF"):
311311
warning(
312-
f'"{self._path}" file has no "Exif" data, metadata will '
313-
f"be undefined!"
312+
f'"{self._path}" file has no "Exif" data, metadata will be undefined!'
314313
)
315314
self.metadata = Metadata(*[None] * 6)
316315
return self.metadata
@@ -369,7 +368,7 @@ def read_metadata(self) -> Metadata:
369368
def _luminance_average_key(image: Image) -> NDArrayFloat | None:
370369
"""Comparison key function."""
371370

372-
metadata = cast(Metadata, image.metadata)
371+
metadata = cast("Metadata", image.metadata)
373372

374373
f_number = metadata.f_number
375374
exposure_time = metadata.exposure_time

colour_hdri/utilities/tests/test_exif.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,7 @@ def test_parse_exif_array(self) -> None:
120120
exif_tag = EXIFTag(
121121
"EXIF",
122122
"Color Matrix 1",
123-
(
124-
"0.5309 -0.0229 -0.0336 "
125-
"-0.6241 1.3265 0.3337 "
126-
"-0.0817 0.1215 0.6664"
127-
),
123+
("0.5309 -0.0229 -0.0336 -0.6241 1.3265 0.3337 -0.0817 0.1215 0.6664"),
128124
"50721",
129125
)
130126
np.testing.assert_array_equal(

utilities/export_todo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def extract_todo_items(root_directory: str) -> dict:
8181

8282
if in_todo and line.startswith("#"):
8383
todo_item.append(line.replace("#", "").strip())
84-
elif len(todo_item):
84+
elif todo_item:
8585
key = filename.replace("../", "")
8686
if not todo_items.get(key):
8787
todo_items[key] = []

0 commit comments

Comments
 (0)