Skip to content

Commit

Permalink
Merge branch 'feature/v0.4.7' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Jan 26, 2025
2 parents 9c00f80 + 8e66ed5 commit 4349fb7
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 38 deletions.
4 changes: 2 additions & 2 deletions colour/algebra/extrapolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def left(self) -> Real | None:
Returns
-------
:py:data:`None` or Real
Real or :py:data:`None`
Left value to return for x < xi[0].
"""

Expand Down Expand Up @@ -272,7 +272,7 @@ def right(self) -> Real | None:
Returns
-------
:py:data:`None` or Real
Real or :py:data:`None`
Right value to return for x > xi[-1].
"""

Expand Down
12 changes: 4 additions & 8 deletions colour/io/fichet2021.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ def spectrum_attribute_to_sd_Fichet2021(
parts = spectrum_attribute.split(";")
for part in parts:
domain, range_ = part.split(":")
match = pattern.match(domain.replace(".", ","))
if match is not None:
if (match := pattern.match(domain.replace(".", ","))) is not None:
multiplier, units = match.group(3, 4)
wavelength = match_groups_to_nm(match.group(1), multiplier, units)
data[wavelength] = float(range_)
Expand Down Expand Up @@ -370,8 +369,7 @@ def from_spectral_image(path: str | Path) -> Specification_Fichet2021:
channels = image_specification.channelnames

for i, channel in enumerate(channels):
match = pattern_emissive.match(channel)
if match:
if (match := pattern_emissive.match(channel)) is not None:
is_emissive = True

component = match.group(1)
Expand All @@ -382,8 +380,7 @@ def from_spectral_image(path: str | Path) -> Specification_Fichet2021:
if len(components) > 1:
is_polarised = True

match = pattern_bispectral.match(channel)
if match:
if (match := pattern_bispectral.match(channel)) is not None:
is_bispectral = True

input_multiplier, input_units = match.group(3, 4)
Expand All @@ -396,8 +393,7 @@ def from_spectral_image(path: str | Path) -> Specification_Fichet2021:
)
components[input_wavelength][output_wavelength] = i

match = pattern_reflective.match(channel)
if match:
if (match := pattern_reflective.match(channel)) is not None:
multiplier, units = match.group(3, 4)
wavelength = match_groups_to_nm(match.group(1), multiplier, units)
components["T"][wavelength] = i
Expand Down
34 changes: 17 additions & 17 deletions colour/io/tm2714.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def manufacturer(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Manufacturer.
"""

Expand Down Expand Up @@ -287,7 +287,7 @@ def catalog_number(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Catalog number.
"""

Expand Down Expand Up @@ -317,7 +317,7 @@ def description(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Description.
"""

Expand Down Expand Up @@ -347,7 +347,7 @@ def document_creator(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Document creator.
"""

Expand Down Expand Up @@ -377,7 +377,7 @@ def unique_identifier(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Unique identifier.
"""

Expand Down Expand Up @@ -407,7 +407,7 @@ def measurement_equipment(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Measurement equipment.
"""

Expand Down Expand Up @@ -437,7 +437,7 @@ def laboratory(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Laboratory.
"""

Expand Down Expand Up @@ -467,7 +467,7 @@ def report_number(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Report number.
"""

Expand Down Expand Up @@ -497,7 +497,7 @@ def report_date(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Report date.
"""

Expand Down Expand Up @@ -527,7 +527,7 @@ def document_creation_date(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Document creation date.
"""

Expand Down Expand Up @@ -557,7 +557,7 @@ def comments(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Comments.
"""

Expand Down Expand Up @@ -1025,7 +1025,7 @@ def path(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Path.
"""

Expand Down Expand Up @@ -1104,7 +1104,7 @@ def spectral_quantity(
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Spectral quantity.
"""

Expand Down Expand Up @@ -1171,7 +1171,7 @@ def reflection_geometry(
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Reflection geometry.
"""

Expand Down Expand Up @@ -1222,7 +1222,7 @@ def transmission_geometry(
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Transmission geometry.
"""

Expand Down Expand Up @@ -1255,7 +1255,7 @@ def bandwidth_FWHM(self) -> float | None:
Returns
-------
:py:data:`None` or :class:`float`
:class:`float` or :py:data:`None`
Full-width half-maximum bandwidth.
"""

Expand Down Expand Up @@ -1288,7 +1288,7 @@ def bandwidth_corrected(self) -> bool | None:
Returns
-------
:py:data:`None` or :class:`bool`
:class:`bool` or :py:data:`None`
Whether bandwidth correction has been applied to the measured data.
"""

Expand Down
5 changes: 3 additions & 2 deletions colour/io/uprtek_sekonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,9 @@ def as_array(a: Any) -> list:
attribute, tokens = row[0], row[1:]
value = tokens[0] if len(tokens) == 1 else tokens

match = re.match(self._SPECTRAL_DATA_PATTERN, attribute)
if match:
if (
match := re.match(self._SPECTRAL_DATA_PATTERN, attribute)
) is not None:
wavelength = match.group(1)

if wavelength == self._SPECTRAL_SECTION:
Expand Down
6 changes: 3 additions & 3 deletions colour/models/rgb/rgb_colourspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def whitepoint_name(self) -> str | None:
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
*RGB* colourspace whitepoint name.
"""

Expand Down Expand Up @@ -506,7 +506,7 @@ def cctf_encoding(self) -> Callable | None:
Returns
-------
:py:data:`None` or Callable
Callable or :py:data:`None`
Encoding colour component transfer function (Encoding CCTF) /
opto-electronic transfer function (OETF).
"""
Expand Down Expand Up @@ -540,7 +540,7 @@ def cctf_decoding(self) -> Callable | None:
Returns
-------
:py:data:`None` or Callable
Callable or :py:data:`None`
Decoding colour component transfer function (Decoding CCTF) /
electro-optical transfer function (EOTF).
"""
Expand Down
2 changes: 1 addition & 1 deletion colour/notation/munsell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ def interpolation_method_from_renotation_ovoid(
Returns
-------
:py:data:`None` or :class:`str`
:class:`str` or :py:data:`None`
Interpolation method.
References
Expand Down
2 changes: 1 addition & 1 deletion colour/recovery/otsu2018.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def mean(self) -> NDArrayFloat | None:
Returns
-------
:py:data:`None` or :class:`numpy.ndarray`
:class:`numpy.ndarray` or :py:data:`None`
Mean distribution.
"""

Expand Down
6 changes: 2 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ def examples(ctx: Context, plots: bool = False) -> None:
@task(formatting, quality, precommit, tests, examples)
def preflight(ctx: Context) -> None: # noqa: ARG001
"""
Perform the preflight tasks, i.e., *formatting*, *tests*, *quality*, and
*examples*.
Perform the preflight tasks.
Parameters
----------
Expand Down Expand Up @@ -361,8 +360,7 @@ def requirements(ctx: Context) -> None:
@task(literalise, clean, preflight, docs, todo, requirements)
def build(ctx: Context) -> None:
"""
Build the project and runs dependency tasks, i.e., *docs*, *todo*, and
*preflight*.
Build the project and runs dependency tasks.
Parameters
----------
Expand Down

0 comments on commit 4349fb7

Please sign in to comment.