Skip to content

Commit de35069

Browse files
committed
Merge branch 'release/v0.1.10'
2 parents d4c5541 + e871dc9 commit de35069

14 files changed

+309
-70
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
.coverage
66
.idea
77
__pycache__
8+
poetry.lock

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://gitlab.com/pycqa/flake8
3+
rev: 3.7.8
4+
hooks:
5+
- id: flake8
6+
exclude: examples
7+
- repo: https://github.com/pre-commit/mirrors-yapf
8+
rev: v0.23.0
9+
hooks:
10+
- id: yapf

CODE_OF_CONDUCT.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others’ private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
28+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
29+
30+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
31+
32+
## Scope
33+
34+
This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
35+
36+
## Enforcement
37+
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting Thomas Mansencal and Michael Mauderer via email at [email protected] and [email protected] respectively. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
40+
41+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.
42+
43+
## Attribution
44+
45+
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html][homepage].
46+
47+
For answers to common questions about this code of conduct, see [https://www.contributor-covenant.org/faq][faq].
48+
49+
50+
[homepage]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
51+
[faq]: https://www.contributor-covenant.org/faq

CONTRIBUTORS.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ About
1212
-----
1313

1414
| **Colour - Dash** by Colour Developers
15-
| Copyright © 2018 – Colour Developers – `[email protected] <[email protected]>`_
16-
| This software is released under terms of New BSD License: http://opensource.org/licenses/BSD-3-Clause
17-
| `http://github.com/colour-science/colour-dash <http://github.com/colour-science/colour-dash>`_
15+
| Copyright © 2018-2019 – Colour Developers – `[email protected] <[email protected]>`__
16+
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
17+
| `https://github.com/colour-science/colour-dash <https://github.com/colour-science/colour-dash>`__

Dockerfile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
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
1612
COPY . /home/dash/colour-dash
1713

1814
CMD sh -c 'if [ -z "${SSL_CERTIFICATE}" ]; then \
19-
gunicorn -b 0.0.0.0:8000 index:SERVER; else \
20-
gunicorn --certfile "${SSL_CERTIFICATE}" --keyfile "${SSL_KEY}" -b 0.0.0.0:8000 index:SERVER; fi'
15+
gunicorn --log-level debug -b 0.0.0.0:8000 index:SERVER; else \
16+
gunicorn --certfile "${SSL_CERTIFICATE}" --keyfile "${SSL_KEY}" --log-level debug -b 0.0.0.0:8000 index:SERVER; fi'

README.rst

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Colour - Dash
66
Introduction
77
------------
88

9-
Various colour science `Dash <https://dash.plot.ly/>`_ apps built on top of
10-
`Colour <https://github.com/colour-science/colour>`_.
9+
Various colour science `Dash <https://dash.plot.ly/>`__ apps built on top of
10+
`Colour <https://github.com/colour-science/colour>`__.
1111

1212
Installation
1313
------------
@@ -36,17 +36,19 @@ 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
41+
42+
Code of Conduct
43+
---------------
44+
45+
The *Code of Conduct*, adapted from the `Contributor Covenant 1.4 <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>`__,
46+
is available on the `Code of Conduct <https://www.colour-science.org/code-of-conduct/>`__ page.
4547

4648
About
4749
-----
4850

4951
| **Colour - Dash** by Colour Developers
50-
| Copyright © 2018 – Colour Developers – `[email protected] <[email protected]>`_
51-
| This software is released under terms of New BSD License: http://opensource.org/licenses/BSD-3-Clause
52-
| `http://github.com/colour-science/colour-dash <http://github.com/colour-science/colour-dash>`_
52+
| Copyright © 2018-2019 – Colour Developers – `[email protected] <[email protected]>`__
53+
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
54+
| `https://github.com/colour-science/colour-dash <https://github.com/colour-science/colour-dash>`__

app.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from flask import Flask
1212

1313
__author__ = 'Colour Developers'
14-
__copyright__ = 'Copyright (C) 2018 - Colour Developers'
15-
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
14+
__copyright__ = 'Copyright (C) 2018-2019 - Colour Developers'
15+
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
1616
__maintainer__ = 'Colour Developers'
1717
__email__ = '[email protected]'
1818
__status__ = 'Production'
@@ -21,7 +21,7 @@
2121

2222
__major_version__ = '0'
2323
__minor_version__ = '1'
24-
__change_version__ = '9'
24+
__change_version__ = '10'
2525
__version__ = '.'.join(
2626
(__major_version__,
2727
__minor_version__,
@@ -33,21 +33,21 @@
3333
"""
3434
*Flask* server hosting the *Dash* app.
3535
36-
SERVER : Flask
36+
SERVER : Flask
3737
"""
3838

3939
SERVER_URL = os.environ.get('COLOUR_DASH_SERVER')
4040
"""
4141
Server url used to construct permanent links for the individual apps.
4242
43-
SERVER_URL : unicode
43+
SERVER_URL : unicode
4444
"""
4545

4646
APP = dash.Dash(__application_name__, server=SERVER)
4747
"""
4848
*Dash* app.
4949
50-
APP : Dash
50+
APP : Dash
5151
"""
5252

5353
APP.config['suppress_callback_exceptions'] = True

apps/common.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import colour
1010

1111
__author__ = 'Colour Developers'
12-
__copyright__ = 'Copyright (C) 2018 - Colour Developers'
13-
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
12+
__copyright__ = 'Copyright (C) 2018-2019 - Colour Developers'
13+
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
1414
__maintainer__ = 'Colour Developers'
1515
__email__ = '[email protected]'
1616
__status__ = 'Production'
@@ -28,7 +28,7 @@
2828
"""
2929
*RGB* colourspace options for a :class:`Dropdown` class instance.
3030
31-
RGB_COLOURSPACES_OPTIONS : list
31+
RGB_COLOURSPACES_OPTIONS : list
3232
"""
3333

3434
CHROMATIC_ADAPTATION_TRANSFORM_OPTIONS = [{
@@ -39,7 +39,7 @@
3939
*Chromatic adaptation transform* options for a :class:`Dropdown` class
4040
instance.
4141
42-
CHROMATIC_ADAPTATION_TRANSFORM_OPTIONS : list
42+
CHROMATIC_ADAPTATION_TRANSFORM_OPTIONS : list
4343
"""
4444

4545
ILLUMINANTS_OPTIONS = [{
@@ -51,7 +51,7 @@
5151
*CIE 1931 2 Degree Standard Observer* illuminant options for a
5252
:class:`Dropdown`class instance.
5353
54-
ILLUMINANTS_OPTIONS : list
54+
ILLUMINANTS_OPTIONS : list
5555
"""
5656

5757
NUKE_COLORMATRIX_NODE_TEMPLATE = """
@@ -90,7 +90,12 @@ def nuke_format_matrix(M, decimals=10):
9090
*The Foundry Nuke* formatted matrix.
9191
"""
9292

93-
pretty = lambda x: ' '.join(map('{{: 0.{0}f}}'.format(decimals).format, x))
93+
def pretty(x):
94+
"""
95+
Prettify given number.
96+
"""
97+
98+
return ' '.join(map('{{: 0.{0}f}}'.format(decimals).format, x))
9499

95100
tcl = '{{{0}}}\n'.format(pretty(M[0]))
96101
tcl += ' {{{0}}}\n'.format(pretty(M[1]))

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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
12-
from dash_core_components import Dropdown, Link, Markdown, Slider, Textarea
12+
from dash_core_components import Dropdown, Link, Markdown, Slider
1313
from dash_html_components import A, Code, Div, H3, H5, Li, Pre, Ul
1414

1515
import colour
@@ -19,8 +19,8 @@
1919
ILLUMINANTS_OPTIONS, RGB_COLOURSPACES_OPTIONS)
2020

2121
__author__ = 'Colour Developers'
22-
__copyright__ = 'Copyright (C) 2018 - Colour Developers'
23-
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
22+
__copyright__ = 'Copyright (C) 2018-2019 - Colour Developers'
23+
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
2424
__maintainer__ = 'Colour Developers'
2525
__email__ = '[email protected]'
2626
__status__ = 'Production'
@@ -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: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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
12-
from dash_core_components import Dropdown, Link, Markdown, Slider, Textarea
12+
from dash_core_components import Dropdown, Link, Markdown, Slider
1313
from dash_html_components import A, Code, Div, H3, H5, Li, Pre, Ul
1414

1515
import colour
@@ -20,8 +20,8 @@
2020
RGB_COLOURSPACES_OPTIONS, nuke_format_matrix)
2121

2222
__author__ = 'Colour Developers'
23-
__copyright__ = 'Copyright (C) 2018 - Colour Developers'
24-
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
23+
__copyright__ = 'Copyright (C) 2018-2019 - Colour Developers'
24+
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
2525
__maintainer__ = 'Colour Developers'
2626
__email__ = '[email protected]'
2727
__status__ = 'Production'
@@ -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':

0 commit comments

Comments
 (0)