Skip to content

Commit 290cb6f

Browse files
committed
Merge branch 'feature/v0.1.14' into develop
2 parents 1719114 + cd93ec3 commit 290cb6f

File tree

6 files changed

+34
-19
lines changed

6 files changed

+34
-19
lines changed

app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
import dash
77
import os
8+
from colour.hints import Optional
89
from flask import Flask
910

11+
1012
__author__ = "Colour Developers"
1113
__copyright__ = "Copyright 2018 Colour Developers"
1214
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause"
@@ -30,7 +32,7 @@
3032
*Flask* server hosting the *Dash* app.
3133
"""
3234

33-
SERVER_URL: str = os.environ.get("COLOUR_DASH_SERVER")
35+
SERVER_URL: Optional[str] = os.environ.get("COLOUR_DASH_SERVER")
3436
"""
3537
Server url used to construct permanent links for the individual apps.
3638
"""

apps/common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import colour
77

8-
from colour.hints import ArrayLike, Dict, Integer, List
8+
from colour.hints import ArrayLike, Dict, Integer, Iterable, List
99

1010
__author__ = "Colour Developers"
1111
__copyright__ = "Copyright 2018 Colour Developers"
@@ -87,10 +87,10 @@ def nuke_format_matrix(M: ArrayLike, decimals: Integer = 10) -> str:
8787
*The Foundry Nuke* formatted matrix.
8888
"""
8989

90-
def pretty(x: ArrayLike) -> str:
91-
"""
92-
Prettify given number.
93-
"""
90+
M = colour.utilities.as_float_array(M)
91+
92+
def pretty(x: Iterable) -> str:
93+
"""Prettify given number."""
9494

9595
return " ".join(map(f"{{: 0.{decimals}f}}".format, x))
9696

apps/rgb_colourspace_chromatically_adapted_primaries.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
App description.
5656
"""
5757

58-
APP_UID: str = hash(APP_NAME)
58+
APP_UID: Integer = hash(APP_NAME)
5959
"""
6060
App unique id.
6161
"""
@@ -132,7 +132,7 @@
132132
A(
133133
"Permalink",
134134
href=urllib.parse.urljoin(
135-
SERVER_URL, APP_PATH
135+
str(SERVER_URL), APP_PATH
136136
),
137137
target="_blank",
138138
)
@@ -221,8 +221,8 @@ def set_primaries_output(
221221
threshold=sys.maxsize,
222222
):
223223
if formatter == "str":
224-
P = str(P)
224+
P_f = str(P)
225225
elif formatter == "repr":
226-
P = repr(P)
226+
P_f = repr(P)
227227

228-
return P
228+
return P_f

apps/rgb_colourspace_transformation_matrix.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
App description.
5858
"""
5959

60-
APP_UID: str = hash(APP_NAME)
60+
APP_UID: Integer = hash(APP_NAME)
6161
"""
6262
App unique id.
6363
"""
@@ -140,7 +140,7 @@
140140
A(
141141
"Permalink",
142142
href=urllib.parse.urljoin(
143-
SERVER_URL, APP_PATH
143+
str(SERVER_URL), APP_PATH
144144
),
145145
target="_blank",
146146
)
@@ -228,9 +228,9 @@ def set_RGB_to_RGB_matrix_output(
228228
threshold=sys.maxsize,
229229
):
230230
if formatter == "str":
231-
M = str(M)
231+
M_f = str(M)
232232
elif formatter == "repr":
233-
M = repr(M)
233+
M_f = repr(M)
234234
else:
235235

236236
def slugify(string: str) -> str:
@@ -243,12 +243,13 @@ def slugify(string: str) -> str:
243243
string = re.sub(pattern, "_", string)
244244
return string
245245

246-
M = NUKE_COLORMATRIX_NODE_TEMPLATE.format(
246+
M_f = NUKE_COLORMATRIX_NODE_TEMPLATE.format(
247247
nuke_format_matrix(M, decimals),
248248
(
249249
f"{slugify(input_colourspace)}"
250250
f"__to__"
251251
f"{slugify(output_colourspace)}"
252252
),
253253
)
254-
return M
254+
255+
return M_f

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ coveralls = { version = "*", optional = true } # Development dependency.
5555
flake8 = { version = "*", optional = true } # Development dependency.
5656
flynt = { version = "*", optional = true } # Development dependency.
5757
invoke = { version = "*", optional = true } # Development dependency.
58+
mypy = { version = "*", optional = true } # Development dependency.
5859
pre-commit = { version = "*", optional = true } # Development dependency.
5960
pydocstyle = { version = "*", optional = true } # Development dependency.
6061
pytest = { version = "*", optional = true } # Development dependency.
@@ -68,7 +69,8 @@ coveralls = "*"
6869
flake8 = "*"
6970
flynt = "*"
7071
invoke = "*"
71-
pre = "*"
72+
mypy = "*"
73+
pre-commit = "*"
7274
pydocstyle = "*"
7375
pytest = "*"
7476
pytest-cov = "*"
@@ -82,7 +84,8 @@ development = [
8284
"flake8",
8385
"flynt",
8486
"invoke",
85-
"pre",
87+
"mypy",
88+
"pre-commit",
8689
"pydocstyle",
8790
"pytest",
8891
"pytest-cov",

requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ attrs==21.4.0
33
black==22.3.0
44
Brotli==1.0.9
55
certifi==2021.10.8
6+
cfgv==3.3.1
67
charset-normalizer==2.0.12
78
click==8.1.3
89
colour-science==0.4.1
@@ -13,12 +14,15 @@ dash-core-components==2.0.0
1314
dash-html-components==2.0.0
1415
dash-renderer==1.9.1
1516
dash-table==5.0.0
17+
distlib==0.3.4
1618
docopt==0.6.2
19+
filelock==3.6.0
1720
flake8==4.0.1
1821
Flask==2.1.2
1922
Flask-Compress==1.12
2023
flynt==0.76
2124
gunicorn==20.1.0
25+
identify==2.5.0
2226
idna==3.3
2327
imageio==2.18.0
2428
importlib-metadata==4.11.3
@@ -29,6 +33,7 @@ Jinja2==3.1.2
2933
MarkupSafe==2.1.1
3034
mccabe==0.6.1
3135
mypy-extensions==0.4.3
36+
nodeenv==1.6.0
3237
numpy==1.22.3
3338
packaging==21.3
3439
pathspec==0.9.0
@@ -38,6 +43,7 @@ platformdirs==2.5.2
3843
plotly==5.7.0
3944
pluggy==1.0.0
4045
pre==1.3.0
46+
pre-commit==2.18.1
4147
py==1.11.0
4248
pycodestyle==2.8.0
4349
pydocstyle==6.1.1
@@ -46,16 +52,19 @@ pyparsing==3.0.8
4652
pytest==7.1.2
4753
pytest-cov==3.0.0
4854
pyupgrade==2.32.0
55+
PyYAML==6.0
4956
requests==2.27.1
5057
scipy==1.8.0
5158
setuptools==61.3.1
5259
six==1.16.0
5360
snowballstemmer==2.2.0
5461
tenacity==8.0.1
5562
tokenize-rt==4.2.1
63+
toml==0.10.2
5664
tomli==2.0.1
5765
typing_extensions==4.2.0
5866
urllib3==1.26.9
67+
virtualenv==20.14.1
5968
Werkzeug==2.1.2
6069
wheel==0.37.1
6170
zipp==3.8.0

0 commit comments

Comments
 (0)