Skip to content

Commit

Permalink
Merge branch 'release/v0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Feb 25, 2022
2 parents 07d10da + d6acf65 commit c3735e5
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
.. |version| image:: https://img.shields.io/pypi/v/colour-science.svg?style=flat-square
:target: https://pypi.org/project/colour-science
:alt: Package Version
.. |zenodo| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.4445350-blue.svg?style=flat-square
:target: https://dx.doi.org/10.5281/zenodo.4445350
.. |zenodo| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.6288658-blue.svg?style=flat-square
:target: https://dx.doi.org/10.5281/zenodo.6288658
:alt: DOI

.. end-badges
Expand Down
12 changes: 7 additions & 5 deletions TODO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,13 @@ TODO

- colour/hints/__init__.py

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


- colour/algebra/interpolation.py
Expand Down
2 changes: 1 addition & 1 deletion colour/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ def __getattr__(self, attribute) -> Any:

__major_version__ = "0"
__minor_version__ = "4"
__change_version__ = "0"
__change_version__ = "1"
__version__ = ".".join(
(__major_version__, __minor_version__, __change_version__)
)
Expand Down
4 changes: 3 additions & 1 deletion colour/colorimetry/dominant.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ def closest_spectral_locus_wavelength(
np.concatenate((xy_n, xy_e), -1),
np.hstack([xy_s, np.roll(xy_s, 1, axis=0)]),
).xy
xy_wl = xy_wl[~np.isnan(xy_wl).any(axis=-1)]
# Extracting the first intersection per-wavelength.
xy_wl = np.sort(xy_wl, 1)[:, 0, :]

if not len(xy_wl):
raise ValueError(
f"No closest spectral locus wavelength index and coordinates "
Expand Down
16 changes: 14 additions & 2 deletions colour/hints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
from __future__ import annotations

import numpy as np
import numpy.typing as npt

# TODO: Drop mocking when minimal "Numpy" version is 1.20.x.
try:
import numpy.typing as npt
except ImportError: # pragma: no cover
from unittest import mock

npt = mock.MagicMock()
import re
from types import ModuleType
from typing import (
Expand Down Expand Up @@ -163,7 +170,12 @@
# TODO: Revisit to use Protocol.
Dataclass = Any

NestedSequence = npt._NestedSequence
# TODO: Drop mocking when minimal "Numpy" version is 1.21.x.
try:
NestedSequence = npt._NestedSequence
except AttributeError:
NestedSequence = Any # type: ignore[assignment, misc]

ArrayLike = npt.ArrayLike

IntegerOrArrayLike = Union[Integer, ArrayLike]
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "colour"
version = "0.4.0"
version = "0.4.1"
description = "Colour Science for Python"
license = "BSD-3-Clause"
authors = [ "Colour Developers <[email protected]>" ]
Expand Down Expand Up @@ -130,7 +130,6 @@ plotting = [ "matplotlib" ]
read-the-docs = [
"matplotlib",
"networkx",
"numpy",
"pydata-sphinx-theme",
"pygraphviz",
"sphinxcontrib-bibtex",
Expand Down Expand Up @@ -160,5 +159,5 @@ convention = "numpy"
add-ignore = "D104,D200,D202,D205,D301,D400"

[build-system]
requires = [ "poetry>=0.12" ]
build-backend = "poetry.masonry.api"
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
18 changes: 9 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cfgv==3.3.1
charset-normalizer==2.0.12
click==8.0.4
colorama==0.4.4
coverage==6.3.1
coverage==6.3.2
coveralls==3.3.1
cycler==0.11.0
debugpy==1.5.1
Expand All @@ -31,15 +31,15 @@ executing==0.8.2
filelock==3.6.0
flake8==4.0.1
flynt==0.76
identify==2.4.10
identify==2.4.11
idna==3.3
imageio==2.16.0
imagesize==1.3.0
importlib-metadata==4.11.1
iniconfig==1.1.1
invoke==1.6.0
ipykernel==6.9.1
ipython==8.0.1
ipython==8.1.0
ipython-genutils==0.2.0
ipywidgets==7.6.5
jedi==0.18.1
Expand Down Expand Up @@ -111,12 +111,12 @@ QtPy==2.0.1
readme-renderer==32.0
requests==2.27.1
requests-toolbelt==0.9.1
restructuredtext-lint==1.3.2
restructuredtext-lint==1.4.0
rfc3986==2.0.0
scikit-learn==1.0.2
scipy==1.8.0
Send2Trash==1.8.0
setuptools==59.6.0
setuptools==60.5.0
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.3.1
Expand All @@ -130,22 +130,22 @@ sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
stack-data==0.2.0
terminado==0.13.1
testpath==0.5.0
testpath==0.6.0
threadpoolctl==3.1.0
tokenize-rt==4.2.1
toml==0.10.2
tomli==2.0.1
tornado==6.1
tqdm==4.62.3
traitlets==5.1.1
trimesh==3.10.0
trimesh==3.10.2
twine==3.8.0
types-setuptools==57.4.9
typing_extensions==4.1.1
urllib3==1.26.8
virtualenv==20.13.1
virtualenv==20.13.2
wcwidth==0.2.5
webencodings==0.5.1
wheel==0.37.0
wheel==0.37.1
widgetsnbextension==3.5.2
zipp==3.7.0
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@

install_requires = [
"imageio>=2,<3",
"numpy>=1.19,<2",
"scipy>=1.5,<2",
"typing-extensions>=4,<5",
]

extras_require = {
':extra == "read-the-docs"': ["numpy>=1.19,<2"],
"development": [
"biblib-simple",
"black",
Expand Down Expand Up @@ -183,7 +183,7 @@

setup(
name="colour-science",
version="0.4.0",
version="0.4.1",
description="Colour Science for Python",
long_description=codecs.open("README.rst", encoding="utf8").read(),
author="Colour Developers",
Expand Down

0 comments on commit c3735e5

Please sign in to comment.