Skip to content

Commit c3735e5

Browse files
committed
Merge branch 'release/v0.4.1'
2 parents 07d10da + d6acf65 commit c3735e5

File tree

8 files changed

+41
-26
lines changed

8 files changed

+41
-26
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
.. |version| image:: https://img.shields.io/pypi/v/colour-science.svg?style=flat-square
2222
:target: https://pypi.org/project/colour-science
2323
:alt: Package Version
24-
.. |zenodo| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.4445350-blue.svg?style=flat-square
25-
:target: https://dx.doi.org/10.5281/zenodo.4445350
24+
.. |zenodo| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.6288658-blue.svg?style=flat-square
25+
:target: https://dx.doi.org/10.5281/zenodo.6288658
2626
:alt: DOI
2727

2828
.. end-badges

TODO.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,13 @@ TODO
167167

168168
- colour/hints/__init__.py
169169

170-
- Line 45 : # TODO: Drop "typing_extensions" when "Google Colab" uses Python >= 3.8.
171-
- Line 160 : # TODO: Use "typing.Literal" when minimal Python version is raised to 3.8.
172-
- Line 163 : # TODO: Revisit to use Protocol.
173-
- Line 180 : # TODO: Use "numpy.typing.NDArray" when minimal Numpy version is raised to 1.21.
174-
- Line 187 : # TODO: Drop when minimal Python is raised to 3.9.
170+
- Line 14 : # TODO: Drop mocking when minimal "Numpy" version is 1.20.x.
171+
- Line 52 : # TODO: Drop "typing_extensions" when "Google Colab" uses Python >= 3.8.
172+
- Line 167 : # TODO: Use "typing.Literal" when minimal Python version is raised to 3.8.
173+
- Line 170 : # TODO: Revisit to use Protocol.
174+
- Line 173 : # TODO: Drop mocking when minimal "Numpy" version is 1.21.x.
175+
- Line 192 : # TODO: Use "numpy.typing.NDArray" when minimal Numpy version is raised to 1.21.
176+
- Line 199 : # TODO: Drop when minimal Python is raised to 3.9.
175177

176178

177179
- colour/algebra/interpolation.py

colour/__init__.py

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

851851
__major_version__ = "0"
852852
__minor_version__ = "4"
853-
__change_version__ = "0"
853+
__change_version__ = "1"
854854
__version__ = ".".join(
855855
(__major_version__, __minor_version__, __change_version__)
856856
)

colour/colorimetry/dominant.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ def closest_spectral_locus_wavelength(
125125
np.concatenate((xy_n, xy_e), -1),
126126
np.hstack([xy_s, np.roll(xy_s, 1, axis=0)]),
127127
).xy
128-
xy_wl = xy_wl[~np.isnan(xy_wl).any(axis=-1)]
128+
# Extracting the first intersection per-wavelength.
129+
xy_wl = np.sort(xy_wl, 1)[:, 0, :]
130+
129131
if not len(xy_wl):
130132
raise ValueError(
131133
f"No closest spectral locus wavelength index and coordinates "

colour/hints/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010
from __future__ import annotations
1111

1212
import numpy as np
13-
import numpy.typing as npt
13+
14+
# TODO: Drop mocking when minimal "Numpy" version is 1.20.x.
15+
try:
16+
import numpy.typing as npt
17+
except ImportError: # pragma: no cover
18+
from unittest import mock
19+
20+
npt = mock.MagicMock()
1421
import re
1522
from types import ModuleType
1623
from typing import (
@@ -163,7 +170,12 @@
163170
# TODO: Revisit to use Protocol.
164171
Dataclass = Any
165172

166-
NestedSequence = npt._NestedSequence
173+
# TODO: Drop mocking when minimal "Numpy" version is 1.21.x.
174+
try:
175+
NestedSequence = npt._NestedSequence
176+
except AttributeError:
177+
NestedSequence = Any # type: ignore[assignment, misc]
178+
167179
ArrayLike = npt.ArrayLike
168180

169181
IntegerOrArrayLike = Union[Integer, ArrayLike]

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "colour"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = "Colour Science for Python"
55
license = "BSD-3-Clause"
66
authors = [ "Colour Developers <[email protected]>" ]
@@ -130,7 +130,6 @@ plotting = [ "matplotlib" ]
130130
read-the-docs = [
131131
"matplotlib",
132132
"networkx",
133-
"numpy",
134133
"pydata-sphinx-theme",
135134
"pygraphviz",
136135
"sphinxcontrib-bibtex",
@@ -160,5 +159,5 @@ convention = "numpy"
160159
add-ignore = "D104,D200,D202,D205,D301,D400"
161160

162161
[build-system]
163-
requires = [ "poetry>=0.12" ]
164-
build-backend = "poetry.masonry.api"
162+
requires = ["poetry_core>=1.0.0"]
163+
build-backend = "poetry.core.masonry.api"

requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cfgv==3.3.1
1717
charset-normalizer==2.0.12
1818
click==8.0.4
1919
colorama==0.4.4
20-
coverage==6.3.1
20+
coverage==6.3.2
2121
coveralls==3.3.1
2222
cycler==0.11.0
2323
debugpy==1.5.1
@@ -31,15 +31,15 @@ executing==0.8.2
3131
filelock==3.6.0
3232
flake8==4.0.1
3333
flynt==0.76
34-
identify==2.4.10
34+
identify==2.4.11
3535
idna==3.3
3636
imageio==2.16.0
3737
imagesize==1.3.0
3838
importlib-metadata==4.11.1
3939
iniconfig==1.1.1
4040
invoke==1.6.0
4141
ipykernel==6.9.1
42-
ipython==8.0.1
42+
ipython==8.1.0
4343
ipython-genutils==0.2.0
4444
ipywidgets==7.6.5
4545
jedi==0.18.1
@@ -111,12 +111,12 @@ QtPy==2.0.1
111111
readme-renderer==32.0
112112
requests==2.27.1
113113
requests-toolbelt==0.9.1
114-
restructuredtext-lint==1.3.2
114+
restructuredtext-lint==1.4.0
115115
rfc3986==2.0.0
116116
scikit-learn==1.0.2
117117
scipy==1.8.0
118118
Send2Trash==1.8.0
119-
setuptools==59.6.0
119+
setuptools==60.5.0
120120
six==1.16.0
121121
snowballstemmer==2.2.0
122122
soupsieve==2.3.1
@@ -130,22 +130,22 @@ sphinxcontrib-qthelp==1.0.3
130130
sphinxcontrib-serializinghtml==1.1.5
131131
stack-data==0.2.0
132132
terminado==0.13.1
133-
testpath==0.5.0
133+
testpath==0.6.0
134134
threadpoolctl==3.1.0
135135
tokenize-rt==4.2.1
136136
toml==0.10.2
137137
tomli==2.0.1
138138
tornado==6.1
139139
tqdm==4.62.3
140140
traitlets==5.1.1
141-
trimesh==3.10.0
141+
trimesh==3.10.2
142142
twine==3.8.0
143143
types-setuptools==57.4.9
144144
typing_extensions==4.1.1
145145
urllib3==1.26.8
146-
virtualenv==20.13.1
146+
virtualenv==20.13.2
147147
wcwidth==0.2.5
148148
webencodings==0.5.1
149-
wheel==0.37.0
149+
wheel==0.37.1
150150
widgetsnbextension==3.5.2
151151
zipp==3.7.0

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@
134134

135135
install_requires = [
136136
"imageio>=2,<3",
137+
"numpy>=1.19,<2",
137138
"scipy>=1.5,<2",
138139
"typing-extensions>=4,<5",
139140
]
140141

141142
extras_require = {
142-
':extra == "read-the-docs"': ["numpy>=1.19,<2"],
143143
"development": [
144144
"biblib-simple",
145145
"black",
@@ -183,7 +183,7 @@
183183

184184
setup(
185185
name="colour-science",
186-
version="0.4.0",
186+
version="0.4.1",
187187
description="Colour Science for Python",
188188
long_description=codecs.open("README.rst", encoding="utf8").read(),
189189
author="Colour Developers",

0 commit comments

Comments
 (0)