Skip to content

Commit

Permalink
Merge branch 'feature/v0.4.5' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Apr 8, 2024
2 parents bb35ab9 + c4f58bd commit 6633487
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions colour/constants/__init__.py
Expand Up @@ -6,7 +6,7 @@
CONSTANT_PLANCK,
)
from .common import (
FLOATING_POINT_NUMBER_PATTERN,
PATTERN_FLOATING_POINT_NUMBER,
INTEGER_THRESHOLD,
EPSILON,
DTYPE_INT_DEFAULT,
Expand All @@ -28,7 +28,7 @@
"CONSTANT_PLANCK",
]
__all__ += [
"FLOATING_POINT_NUMBER_PATTERN",
"PATTERN_FLOATING_POINT_NUMBER",
"INTEGER_THRESHOLD",
"EPSILON",
"DTYPE_INT_DEFAULT",
Expand Down
6 changes: 3 additions & 3 deletions colour/constants/common.py
Expand Up @@ -26,7 +26,7 @@
__status__ = "Production"

__all__ = [
"FLOATING_POINT_NUMBER_PATTERN",
"PATTERN_FLOATING_POINT_NUMBER",
"INTEGER_THRESHOLD",
"EPSILON",
"DTYPE_INT_DEFAULT",
Expand All @@ -37,8 +37,8 @@
"TOLERANCE_RELATIVE_TESTS",
]

FLOATING_POINT_NUMBER_PATTERN: str = "[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"
"""float point number regex matching pattern."""
PATTERN_FLOATING_POINT_NUMBER: str = "[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"
"""Floating point number regex matching pattern."""

INTEGER_THRESHOLD: float = 1e-3
if is_documentation_building(): # pragma: no cover
Expand Down
18 changes: 9 additions & 9 deletions colour/io/image.py
Expand Up @@ -268,12 +268,12 @@ def read_image_OpenImageIO(
bit_depth_specification = MAPPING_BIT_DEPTH[bit_depth]

image_input = ImageInput.open(path)
specification = image_input.spec()
image_specification = image_input.spec()

shape = (
specification.height,
specification.width,
specification.nchannels,
image_specification.height,
image_specification.width,
image_specification.nchannels,
)

image = image_input.read_image(bit_depth_specification.openimageio)
Expand All @@ -284,7 +284,7 @@ def read_image_OpenImageIO(

if attributes:
extra_attributes = []
for attribute in specification.extra_attribs:
for attribute in image_specification.extra_attribs:
extra_attributes.append(
ImageAttribute_Specification(
attribute.name, attribute.value, attribute.type
Expand Down Expand Up @@ -557,7 +557,7 @@ def write_image_OpenImageIO(
else:
height, width, channels = image.shape

specification = ImageSpec(
image_specification = ImageSpec(
width, height, channels, bit_depth_specification.openimageio
)
for attribute in attributes:
Expand All @@ -569,13 +569,13 @@ def write_image_OpenImageIO(
)
type_ = attribute.type_
if attribute.type_ is None:
specification.attribute(name, value)
image_specification.attribute(name, value)
else:
specification.attribute(name, type_, value)
image_specification.attribute(name, type_, value)

image_output = ImageOutput.create(path)

image_output.open(path, specification)
image_output.open(path, image_specification)
image_output.write_image(image)

image_output.close()
Expand Down
10 changes: 5 additions & 5 deletions colour/notation/munsell.py
Expand Up @@ -130,8 +130,8 @@
)
from colour.colorimetry import CCS_ILLUMINANTS, luminance_ASTMD1535
from colour.constants import (
FLOATING_POINT_NUMBER_PATTERN,
INTEGER_THRESHOLD,
PATTERN_FLOATING_POINT_NUMBER,
TOLERANCE_ABSOLUTE_DEFAULT,
TOLERANCE_RELATIVE_DEFAULT,
)
Expand Down Expand Up @@ -225,12 +225,12 @@
"munsell_specification_to_xy",
]

MUNSELL_GRAY_PATTERN: str = f"N(?P<value>{FLOATING_POINT_NUMBER_PATTERN})"
MUNSELL_GRAY_PATTERN: str = f"N(?P<value>{PATTERN_FLOATING_POINT_NUMBER})"
MUNSELL_COLOUR_PATTERN: str = (
f"(?P<hue>{FLOATING_POINT_NUMBER_PATTERN})\\s*"
f"(?P<hue>{PATTERN_FLOATING_POINT_NUMBER})\\s*"
f"(?P<letter>BG|GY|YR|RP|PB|B|G|Y|R|P)\\s*"
f"(?P<value>{FLOATING_POINT_NUMBER_PATTERN})\\s*\\/\\s*"
f"(?P<chroma>[-+]?{FLOATING_POINT_NUMBER_PATTERN})"
f"(?P<value>{PATTERN_FLOATING_POINT_NUMBER})\\s*\\/\\s*"
f"(?P<chroma>[-+]?{PATTERN_FLOATING_POINT_NUMBER})"
)

MUNSELL_GRAY_FORMAT: str = "N{0}"
Expand Down
2 changes: 1 addition & 1 deletion docs/colour.constants.rst
Expand Up @@ -39,7 +39,7 @@ Common
.. autosummary::
:toctree: generated/

FLOATING_POINT_NUMBER_PATTERN
PATTERN_FLOATING_POINT_NUMBER
INTEGER_THRESHOLD
EPSILON
DTYPE_INT_DEFAULT
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Expand Up @@ -161,7 +161,8 @@ select = [
"PGH", # pygrep-hooks
"PL", # pylint
# "PT", # flake8-pytest-style
# "PTH", # flake8-use-pathlib [Enable] "Q", # flake8-quotes
# "PTH", # flake8-use-pathlib [Enable]
"Q", # flake8-quotes
"RET", # flake8-return
"RUF", # Ruff
"S", # flake8-bandit
Expand Down

0 comments on commit 6633487

Please sign in to comment.