Skip to content

Commit e871dc9

Browse files
committed
Merge branch 'feature/v0.1.10' into develop
2 parents 8445b54 + 6e68aaf commit e871dc9

File tree

8 files changed

+107
-37
lines changed

8 files changed

+107
-37
lines changed

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
FROM continuumio/miniconda
1+
FROM python:3.6
22

3-
RUN apt-get update
3+
WORKDIR /tmp
4+
COPY ./requirements.txt /tmp
5+
RUN pip install -r requirements.txt \
6+
&& rm /tmp/requirements.txt
47

5-
RUN /opt/conda/bin/conda install -y -c conda-forge colour-science
6-
RUN pip install \
7-
dash \
8-
dash-core-components \
9-
dash-html-components \
10-
dash-renderer \
11-
gunicorn \
12-
plotly
8+
ARG CACHE_DATE
139

1410
RUN mkdir -p /home/dash/colour-dash
1511
WORKDIR /home/dash/colour-dash

README.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,8 @@ Development
3636

3737
.. code-block:: bash
3838
39-
$ conda create -y -n python-colour-dash
40-
$ source activate python-colour-dash
41-
$ conda install -y -c conda-forge colour-science
42-
$ conda install invoke
43-
$ pip install dash dash-core-components dash-html-components dash-renderer plotly
44-
$ python index.py
39+
$ poetry install
40+
$ poetry run invoke docker-run
4541
4642
Code of Conduct
4743
---------------

apps/rgb_colourspace_models_chromatically_adapted_primaries.py renamed to apps/rgb_colourspace_chromatically_adapted_primaries.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
RGB Colourspace Models Chromatically Adapted Primaries Application
4-
==================================================================
3+
RGB Colourspace Chromatically Adapted Primaries Application
4+
===========================================================
55
"""
66

77
from __future__ import division, unicode_literals
88

9-
import numpy as np
10-
import urlparse
9+
import sys
10+
import urllib.parse
1111
from dash.dependencies import Input, Output
1212
from dash_core_components import Dropdown, Link, Markdown, Slider
1313
from dash_html_components import A, Code, Div, H3, H5, Li, Pre, Ul
@@ -30,7 +30,7 @@
3030
'set_primaries_output'
3131
]
3232

33-
APP_NAME = 'RGB Colourspace Models Chromatically Adapted Primaries'
33+
APP_NAME = 'RGB Colourspace Chromatically Adapted Primaries'
3434
"""
3535
App name.
3636
@@ -46,8 +46,8 @@
4646

4747
APP_DESCRIPTION = ('This app computes the '
4848
'*Chromatically Adapted Primaries* of the given '
49-
'*RGB Colourspace Model* to the given *Illuminant*'
50-
' using the given *Chromatic Adaptation Transform*.')
49+
'*RGB Colourspace* to the given *Illuminant* using the '
50+
'given *Chromatic Adaptation Transform*.')
5151
"""
5252
App description.
5353
@@ -116,7 +116,7 @@
116116
className='list-inline-item'),
117117
Li([
118118
A('Permalink',
119-
href=urlparse.urljoin(SERVER_URL, APP_PATH),
119+
href=urllib.parse.urljoin(SERVER_URL, APP_PATH),
120120
target='_blank')
121121
],
122122
className='list-inline-item'),
@@ -153,7 +153,7 @@ def set_primaries_output(colourspace, illuminant,
153153
chromatic_adaptation_transform, formatter, decimals):
154154
"""
155155
Computes and writes the chromatically adapted *primaries *of the given
156-
*RGB* colourspace model to the given *illuminant* using the given
156+
*RGB* colourspace to the given *illuminant* using the given
157157
*chromatic adaptation transform*to into the output :class:`Pre` class
158158
instance.
159159
@@ -185,7 +185,7 @@ def set_primaries_output(colourspace, illuminant,
185185

186186
with colour.utilities.numpy_print_options(
187187
formatter={'float': ('{{: 0.{0}f}}'.format(decimals)).format},
188-
threshold=np.nan):
188+
threshold=sys.maxsize):
189189
if formatter == 'str':
190190
P = str(P)
191191
elif formatter == 'repr':

apps/rgb_colourspace_models_transformation_matrix.py renamed to apps/rgb_colourspace_transformation_matrix.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
RGB Colourspace Models Transformation Matrix Application
4-
========================================================
3+
RGB Colourspace Transformation Matrix Application
4+
=================================================
55
"""
66

77
from __future__ import division, unicode_literals
88

9-
import numpy as np
10-
import urlparse
9+
import urllib.parse
10+
import sys
1111
from dash.dependencies import Input, Output
1212
from dash_core_components import Dropdown, Link, Markdown, Slider
1313
from dash_html_components import A, Code, Div, H3, H5, Li, Pre, Ul
@@ -31,7 +31,7 @@
3131
'set_RGB_to_RGB_matrix_output'
3232
]
3333

34-
APP_NAME = 'RGB Colourspace Models Transformation Matrix'
34+
APP_NAME = 'RGB Colourspace Transformation Matrix'
3535
"""
3636
App name.
3737
@@ -124,7 +124,7 @@
124124
className='list-inline-item'),
125125
Li([
126126
A('Permalink',
127-
href=urlparse.urljoin(SERVER_URL, APP_PATH),
127+
href=urllib.parse.urljoin(SERVER_URL, APP_PATH),
128128
target='_blank')
129129
],
130130
className='list-inline-item'),
@@ -191,7 +191,7 @@ def set_RGB_to_RGB_matrix_output(input_colourspace, output_colourspace,
191191

192192
with colour.utilities.numpy_print_options(
193193
formatter={'float': ('{{: 0.{0}f}}'.format(decimals)).format},
194-
threshold=np.nan):
194+
threshold=sys.maxsize):
195195
if formatter == 'str':
196196
M = str(M)
197197
elif formatter == 'repr':

index.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from dash_core_components import Link, Location, Markdown
1111
from dash_html_components import A, Div, H3, P
1212

13-
import apps.rgb_colourspace_models_transformation_matrix as app_1
14-
import apps.rgb_colourspace_models_chromatically_adapted_primaries as app_2
15-
from app import APP
13+
import apps.rgb_colourspace_transformation_matrix as app_1
14+
import apps.rgb_colourspace_chromatically_adapted_primaries as app_2
15+
from app import APP, SERVER # noqa
1616

1717
__author__ = 'Colour Developers'
1818
__copyright__ = 'Copyright (C) 2018-2019 - Colour Developers'

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ classifiers = [
3939

4040
[tool.poetry.dependencies]
4141
python = "^3.5"
42+
colour-science = "^0.3.14"
43+
dash = "*"
44+
dash-core-components = "*"
45+
dash-html-components = "*"
46+
dash-renderer = "*"
47+
gunicorn = "*"
48+
plotly = "*"
4249

4350
coverage = { version = "*", optional = true } # Development dependency.
4451
flake8 = { version = "*", optional = true } # Development dependency.

requirements.txt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
aspy.yaml==1.3.0
2+
atomicwrites==1.3.0
3+
attrs==19.3.0
4+
cfgv==2.0.1
5+
Click==7.0
6+
colour-science==0.3.14
7+
coverage==4.5.4
8+
dash==1.5.1
9+
dash-core-components==1.4.0
10+
dash-html-components==1.0.1
11+
dash-renderer==1.2.0
12+
dash-table==4.5.0
13+
entrypoints==0.3
14+
flake8==3.7.9
15+
Flask==1.1.1
16+
Flask-Compress==1.4.0
17+
future==0.18.2
18+
gunicorn==19.9.0
19+
identify==1.4.7
20+
imageio==2.6.1
21+
importlib-metadata==0.23
22+
invoke==1.3.0
23+
itsdangerous==1.1.0
24+
Jinja2==2.10.3
25+
MarkupSafe==1.1.1
26+
mccabe==0.6.1
27+
more-itertools==7.2.0
28+
nodeenv==1.3.3
29+
nose==1.3.7
30+
numpy==1.17.3
31+
packaging==19.2
32+
Pillow==6.2.1
33+
plotly==4.2.1
34+
pluggy==0.13.0
35+
pre-commit==1.20.0
36+
py==1.8.0
37+
pycodestyle==2.5.0
38+
pyflakes==2.1.1
39+
pyparsing==2.4.2
40+
pytest==5.2.2
41+
PyYAML==5.1.2
42+
retrying==1.3.3
43+
scipy==1.3.1
44+
six==1.12.0
45+
toml==0.10.0
46+
virtualenv==16.7.7
47+
wcwidth==0.1.7
48+
Werkzeug==0.16.0
49+
yapf==0.23.0
50+
zipp==0.6.0

tasks.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
__all__ = [
2424
'APPLICATION_NAME', 'ORG', 'CONTAINER', 'clean', 'quality', 'formatting',
25-
'docker_build', 'docker_remove', 'docker_run'
25+
'requirements', 'docker_build', 'docker_remove', 'docker_run'
2626
]
2727

2828
APPLICATION_NAME = app.__application_name__
@@ -106,6 +106,27 @@ def formatting(ctx, yapf=False):
106106

107107

108108
@task
109+
def requirements(ctx):
110+
"""
111+
Export the *requirements.txt* file.
112+
113+
Parameters
114+
----------
115+
ctx : invoke.context.Context
116+
Context.
117+
118+
Returns
119+
-------
120+
bool
121+
Task success.
122+
"""
123+
124+
message_box('Exporting "requirements.txt" file...')
125+
ctx.run('poetry run pip freeze | grep -v '
126+
'"github.com/colour-science/colour-dash" > requirements.txt')
127+
128+
129+
@task(requirements)
109130
def docker_build(ctx):
110131
"""
111132
Builds the *docker* image.

0 commit comments

Comments
 (0)