diff --git a/colour/algebra/common.py b/colour/algebra/common.py index 51383a967..8541b11e5 100644 --- a/colour/algebra/common.py +++ b/colour/algebra/common.py @@ -71,18 +71,16 @@ """ -def get_sdiv_mode() -> ( - Literal[ - "Numpy", - "Ignore", - "Warning", - "Raise", - "Ignore Zero Conversion", - "Warning Zero Conversion", - "Ignore Limit Conversion", - "Warning Limit Conversion", - ] -): +def get_sdiv_mode() -> Literal[ + "Numpy", + "Ignore", + "Warning", + "Raise", + "Ignore Zero Conversion", + "Warning Zero Conversion", + "Ignore Limit Conversion", + "Warning Limit Conversion", +]: """ Return *Colour* safe division mode. diff --git a/colour/algebra/interpolation.py b/colour/algebra/interpolation.py index 72131d812..339e431cf 100644 --- a/colour/algebra/interpolation.py +++ b/colour/algebra/interpolation.py @@ -1136,8 +1136,7 @@ def y(self, value: ArrayLike) -> None: attest( len(value) >= 6, - '"y" dependent variable values count must be equal to or ' - "greater than 6!", + '"y" dependent variable values count must be equal to or greater than 6!', ) self._y = value diff --git a/colour/characterisation/aces_it.py b/colour/characterisation/aces_it.py index 8e4db2ca8..ac955cd1d 100644 --- a/colour/characterisation/aces_it.py +++ b/colour/characterisation/aces_it.py @@ -733,9 +733,9 @@ def whitepoint_preserving_matrix( return M -def optimisation_factory_rawtoaces_v1() -> ( - Tuple[NDArrayFloat, Callable, Callable, Callable] -): +def optimisation_factory_rawtoaces_v1() -> Tuple[ + NDArrayFloat, Callable, Callable, Callable +]: """ Produce the objective function and *CIE XYZ* colourspace to optimisation colourspace/colour model function according to *RAW to ACES* v1. @@ -862,9 +862,9 @@ def finaliser_function(M: ArrayLike) -> NDArrayFloat: ) -def optimisation_factory_Oklab_15() -> ( - Tuple[NDArrayFloat, Callable, Callable, Callable] -): +def optimisation_factory_Oklab_15() -> Tuple[ + NDArrayFloat, Callable, Callable, Callable +]: """ Produce the objective function and *CIE XYZ* colourspace to optimisation colourspace/colour model function based on the *Oklab* colourspace. diff --git a/colour/colorimetry/spectrum.py b/colour/colorimetry/spectrum.py index 04e4b7bcc..6b6b0c290 100644 --- a/colour/colorimetry/spectrum.py +++ b/colour/colorimetry/spectrum.py @@ -1885,8 +1885,7 @@ def display_labels(self, value: Sequence) -> None: attest( is_iterable(value), - f'"display_labels" property: "{value}" is not an "iterable" like ' - f"object!", + f'"display_labels" property: "{value}" is not an "iterable" like object!', ) attest( diff --git a/colour/colorimetry/tristimulus_values.py b/colour/colorimetry/tristimulus_values.py index e9ac620aa..5a0925465 100644 --- a/colour/colorimetry/tristimulus_values.py +++ b/colour/colorimetry/tristimulus_values.py @@ -1274,8 +1274,7 @@ def sd_to_XYZ( if isinstance(sd, MultiSpectralDistributions): runtime_warning( - "A multi-spectral distributions was passed, enforcing integration " - "method!" + "A multi-spectral distributions was passed, enforcing integration method!" ) function = sd_to_XYZ_integration else: diff --git a/colour/continuous/multi_signals.py b/colour/continuous/multi_signals.py index 925c68699..6d95b6dbb 100644 --- a/colour/continuous/multi_signals.py +++ b/colour/continuous/multi_signals.py @@ -1510,8 +1510,7 @@ def multi_signals_unpack_data( for signal in signals.values(): attest( len(domain_array) == len(signal.domain), - 'User "domain" length is not compatible with unpacked ' - '"signals"!', + 'User "domain" length is not compatible with unpacked "signals"!', ) signal.domain = domain_array diff --git a/colour/examples/models/examples_models.py b/colour/examples/models/examples_models.py index 0de71d373..ee866b7e7 100644 --- a/colour/examples/models/examples_models.py +++ b/colour/examples/models/examples_models.py @@ -413,8 +413,7 @@ Lab = np.array([0.51634019, 0.15469500, 0.06289579]) message_box( - f'Converting to "CIE XYZ" tristimulus values from "Oklab" colourspace:\n\n' - f"\t{Lab}" + f'Converting to "CIE XYZ" tristimulus values from "Oklab" colourspace:\n\n\t{Lab}' ) print(colour.Oklab_to_XYZ(Lab)) diff --git a/colour/examples/models/examples_rgb.py b/colour/examples/models/examples_rgb.py index 8660ea802..e2e77fe84 100644 --- a/colour/examples/models/examples_rgb.py +++ b/colour/examples/models/examples_rgb.py @@ -75,8 +75,7 @@ print("\n") message_box( - f"Transfer Characteristics: " - f"{list(colour.TRANSFER_CHARACTERISTICS_ITUTH273.keys())}" + f"Transfer Characteristics: {list(colour.TRANSFER_CHARACTERISTICS_ITUTH273.keys())}" ) colour.models.describe_video_signal_transfer_characteristics(1) diff --git a/colour/examples/plotting/examples_colorimetry_plots.py b/colour/examples/plotting/examples_colorimetry_plots.py index aa958865d..5b7c89045 100644 --- a/colour/examples/plotting/examples_colorimetry_plots.py +++ b/colour/examples/plotting/examples_colorimetry_plots.py @@ -36,8 +36,7 @@ print("\n") message_box( - 'Plotting "CIE Standard Illuminant "A", "B", and "C" with their ' - "normalised colours." + 'Plotting "CIE Standard Illuminant "A", "B", and "C" with their normalised colours.' ) plot_multi_illuminant_sds( ["A", "B", "C"], diff --git a/colour/examples/plotting/examples_models_plots.py b/colour/examples/plotting/examples_models_plots.py index c0b99df99..41a344e23 100644 --- a/colour/examples/plotting/examples_models_plots.py +++ b/colour/examples/plotting/examples_models_plots.py @@ -87,8 +87,7 @@ print("\n") message_box( - 'Plotting a single custom "RGB" colourspace in the ' - '"CIE 1931 Chromaticity Diagram".' + 'Plotting a single custom "RGB" colourspace in the "CIE 1931 Chromaticity Diagram".' ) AWFUL_RGB = colour.RGB_Colourspace( "Awful RGB", @@ -107,21 +106,18 @@ print("\n") message_box( - 'Plotting a single "RGB" colourspace encoding colour component transfer ' - "function." + 'Plotting a single "RGB" colourspace encoding colour component transfer function.' ) plot_single_cctf("ITU-R BT.709") print("\n") message_box( - 'Plotting multiple "RGB" colourspaces encoding colour component transfer ' - "functions." + 'Plotting multiple "RGB" colourspaces encoding colour component transfer functions.' ) plot_multi_cctfs(["ITU-R BT.709", "sRGB"]) message_box( - 'Plotting multiple "RGB" colourspaces decoding colour component transfer ' - "functions." + 'Plotting multiple "RGB" colourspaces decoding colour component transfer functions.' ) plot_multi_cctfs(["ACES2065-1", "ProPhoto RGB"], cctf_decoding=True) diff --git a/colour/examples/quality/examples_cfi.py b/colour/examples/quality/examples_cfi.py index 1fb6c56fa..bb58dce03 100644 --- a/colour/examples/quality/examples_cfi.py +++ b/colour/examples/quality/examples_cfi.py @@ -21,8 +21,7 @@ print("\n") message_box( - 'Computing "F2" illuminant "Colour Fidelity Index" (CFI) with detailed ' - "output data." + 'Computing "F2" illuminant "Colour Fidelity Index" (CFI) with detailed output data.' ) pprint( colour.colour_fidelity_index(colour.SDS_ILLUMINANTS["FL2"], additional_data=True) diff --git a/colour/examples/volume/examples_rgb.py b/colour/examples/volume/examples_rgb.py index d4125227f..855f86fd6 100644 --- a/colour/examples/volume/examples_rgb.py +++ b/colour/examples/volume/examples_rgb.py @@ -16,8 +16,7 @@ samples = int(10e4) message_box( - f'Computing the "ProPhoto RGB" RGB colourspace volume using {samples} ' - f"samples." + f'Computing the "ProPhoto RGB" RGB colourspace volume using {samples} samples.' ) print( colour.RGB_colourspace_volume_MonteCarlo( diff --git a/colour/io/fichet2021.py b/colour/io/fichet2021.py index 8ac30fc6f..77711f894 100644 --- a/colour/io/fichet2021.py +++ b/colour/io/fichet2021.py @@ -852,13 +852,13 @@ def write_spectral_image_Fichet2021( for i, wavelength in enumerate(wavelengths): component_type = str(component)[0] if component_type == "S": # Emissive Component Type # noqa: SIM114 - channel_name = f'{component}.{str(wavelength).replace(".", ",")}nm' + channel_name = f"{component}.{str(wavelength).replace('.', ',')}nm" elif component_type == "T": # Reflectance et al. Component Type - channel_name = f'{component}.{str(wavelength).replace(".", ",")}nm' + channel_name = f"{component}.{str(wavelength).replace('.', ',')}nm" else: # Bi-spectral Component Type channel_name = ( - f'T.{str(component).replace(".", ",")}nm.' - f'{str(wavelength).replace(".", ",")}nm' + f"T.{str(component).replace('.', ',')}nm." + f"{str(wavelength).replace('.', ',')}nm" ) channels[channel_name] = values[..., i] diff --git a/colour/io/luts/operator.py b/colour/io/luts/operator.py index 2f2e31494..49cddbeaf 100644 --- a/colour/io/luts/operator.py +++ b/colour/io/luts/operator.py @@ -403,7 +403,7 @@ def __repr__(self) -> str: [ f"{representation[:-1]},", f"{indentation}" - f'{repr(self._offset).replace("array(", "").replace(")", "")},', + f"{repr(self._offset).replace('array(', '').replace(')', '')},", f"{indentation}name='{self._name}'{comments})", ] ) diff --git a/colour/io/luts/sequence.py b/colour/io/luts/sequence.py index c980559da..81e65b9d8 100644 --- a/colour/io/luts/sequence.py +++ b/colour/io/luts/sequence.py @@ -141,8 +141,7 @@ def sequence(self, value: Sequence[ProtocolLUTSequenceItem]) -> None: for item in value: attest( isinstance(item, ProtocolLUTSequenceItem), - '"value" items must implement the "ProtocolLUTSequenceItem" ' - "protocol!", + '"value" items must implement the "ProtocolLUTSequenceItem" protocol!', ) self._sequence = list(value) @@ -179,8 +178,7 @@ def __setitem__(self, index: int | slice, value: Any) -> None: for item in value if is_iterable(value) else [value]: attest( isinstance(item, ProtocolLUTSequenceItem), - '"value" items must implement the "ProtocolLUTSequenceItem" ' - "protocol!", + '"value" items must implement the "ProtocolLUTSequenceItem" protocol!', ) self._sequence[index] = value diff --git a/colour/io/tm2714.py b/colour/io/tm2714.py index db6d7c96f..267401ea0 100644 --- a/colour/io/tm2714.py +++ b/colour/io/tm2714.py @@ -1676,8 +1676,7 @@ def read(self) -> SpectralDistribution_IESTM2714: namespace = match.group(1) else: error = ( - 'The "IES TM-27-14" spectral distribution namespace ' - "was not found!" + 'The "IES TM-27-14" spectral distribution namespace was not found!' ) raise ValueError(error) diff --git a/colour/io/uprtek_sekonic.py b/colour/io/uprtek_sekonic.py index d976e8db4..9677027fe 100644 --- a/colour/io/uprtek_sekonic.py +++ b/colour/io/uprtek_sekonic.py @@ -279,10 +279,7 @@ def __str__(self) -> str: representation = super().__str__() return representation.replace( - ( - "IES TM-27-14 Spectral Distribution\n" - "==================================" - ), + ("IES TM-27-14 Spectral Distribution\n=================================="), "UPRTek\n======", ) diff --git a/colour/notation/munsell.py b/colour/notation/munsell.py index c774f787e..2963c5d46 100644 --- a/colour/notation/munsell.py +++ b/colour/notation/munsell.py @@ -352,9 +352,9 @@ def _munsell_value_ASTMD1535_interpolator() -> Extrapolator: return extrapolator -def _munsell_maximum_chromas_from_renotation() -> ( - Tuple[Tuple[Tuple[float, float], float], ...] -): +def _munsell_maximum_chromas_from_renotation() -> Tuple[ + Tuple[Tuple[float, float], float], ... +]: """ Return the maximum *Munsell* chromas from *Munsell Renotation System* data and caches them if not existing. @@ -1658,8 +1658,7 @@ def munsell_specification_to_munsell_colour( hue = round(hue, hue_decimals) attest( 0 <= hue <= 10, - f'"{specification!r}" specification hue must be normalised to ' - f"domain [0, 10]!", + f'"{specification!r}" specification hue must be normalised to domain [0, 10]!', ) value = round(value, value_decimals) @@ -2055,8 +2054,7 @@ def interpolation_method_from_renotation_ovoid( attest( abs(2 * (chroma / 2 - round(chroma / 2))) <= THRESHOLD_INTEGER, - f'"{specification}" specification chroma must be an int and ' - f"multiple of 2!", + f'"{specification}" specification chroma must be an int and multiple of 2!', ) chroma = 2 * round(chroma / 2) @@ -2318,8 +2316,7 @@ def xy_from_renotation_ovoid(specification: ArrayLike) -> NDArrayFloat: attest( 1 <= value <= 9, - f'"{specification}" specification value must be normalised to ' - f"domain [1, 9]!", + f'"{specification}" specification value must be normalised to domain [1, 9]!', ) attest( @@ -2331,8 +2328,7 @@ def xy_from_renotation_ovoid(specification: ArrayLike) -> NDArrayFloat: attest( 2 <= chroma <= 50, - f'"{specification}" specification chroma must be normalised to ' - f"domain [2, 50]!", + f'"{specification}" specification chroma must be normalised to domain [2, 50]!', ) attest( @@ -2398,7 +2394,7 @@ def xy_from_renotation_ovoid(specification: ArrayLike) -> NDArrayFloat: attest( interpolation_method is not None, - f"Interpolation method must be one of: \"{'Linear, Radial'}\"", + f'Interpolation method must be one of: "{"Linear, Radial"}"', ) hue_angle_lower_upper = np.squeeze([hue_angle_lower, hue_angle_upper]) @@ -2615,8 +2611,7 @@ def munsell_specification_to_xy(specification: ArrayLike) -> NDArrayFloat: attest( 0 <= value <= 10, - f'"{specification}" specification value must be normalised to ' - f"domain [0, 10]!", + f'"{specification}" specification value must be normalised to domain [0, 10]!', ) attest( diff --git a/colour/plotting/common.py b/colour/plotting/common.py index 640a1795d..df8f59b72 100644 --- a/colour/plotting/common.py +++ b/colour/plotting/common.py @@ -225,7 +225,7 @@ # affecting *Matplotplib* ones. for _scaling, _value in CONSTANTS_COLOUR_STYLE.font.scaling.items(): matplotlib.font_manager.font_scalings[ - f'{_scaling.replace("_", "-")}-colour-science' + f"{_scaling.replace('_', '-')}-colour-science" ] = _value del _scaling, _value diff --git a/colour/plotting/quality.py b/colour/plotting/quality.py index 95fe64b77..82bf15684 100644 --- a/colour/plotting/quality.py +++ b/colour/plotting/quality.py @@ -490,8 +490,7 @@ def plot_multi_sds_colour_quality_scales_bars( _figure, axes = plot_colour_quality_bars(specifications, **settings) title = ( - f"Colour Quality Scale - " - f"{', '.join([sd.display_name for sd in sds_converted])}" + f"Colour Quality Scale - {', '.join([sd.display_name for sd in sds_converted])}" ) settings = {"axes": axes, "title": title} diff --git a/colour/plotting/temperature.py b/colour/plotting/temperature.py index 17e151cdf..0749cd591 100644 --- a/colour/plotting/temperature.py +++ b/colour/plotting/temperature.py @@ -512,7 +512,7 @@ def plot_planckian_locus( axes.text( lines_itl[i][-1, 0], lines_itl[i][-1, 1], - f'{as_int_scalar(label)}{"M" if planckian_locus_mireds else "K"}', + f"{as_int_scalar(label)}{'M' if planckian_locus_mireds else 'K'}", clip_on=True, ha="left", va="bottom", diff --git a/colour/utilities/network.py b/colour/utilities/network.py index f869725f2..0cf3af293 100644 --- a/colour/utilities/network.py +++ b/colour/utilities/network.py @@ -741,8 +741,7 @@ def node(self, value: PortNode | None) -> None: attest( value is None or isinstance(value, PortNode), - f'"node" property: "{value}" is not "None" or ' - f'its type is not "PortNode"!', + f'"node" property: "{value}" is not "None" or its type is not "PortNode"!', ) self._node = value diff --git a/colour/utilities/verbose.py b/colour/utilities/verbose.py index 0ea54485c..e32297121 100644 --- a/colour/utilities/verbose.py +++ b/colour/utilities/verbose.py @@ -207,9 +207,9 @@ def inner(text: str) -> str: """Format and pads inner text for the message box.""" return ( - f'*{" " * padding}' - f'{text}{" " * (width - len(text) - padding * 2 - 2)}' - f'{" " * padding}*' + f"*{' ' * padding}" + f"{text}{' ' * (width - len(text) - padding * 2 - 2)}" + f"{' ' * padding}*" ) print_callable("=" * width) @@ -322,7 +322,7 @@ def warning(*args: Any, **kwargs: Any) -> None: kwargs["category"] = kwargs.get("category", ColourWarning) - warn(*args, **kwargs) # noqa: B028 + warn(*args, **kwargs) def runtime_warning(*args: Any, **kwargs: Any) -> None: