Skip to content

Commit 07d10da

Browse files
committed
Merge branch 'release/v0.4.0'
2 parents 4494cb4 + 22dd196 commit 07d10da

File tree

720 files changed

+119605
-79799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

720 files changed

+119605
-79799
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Bug Report
2+
description: Report an issue or a bug.
3+
title: "[BUG]: << Please use a comprehensive title... >>"
4+
labels: [ Defect ]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: >
10+
Thank you for taking the time to file a bug report. Before continuing, please take some time to check the existing [issues](https://github.com/colour-science/colour/issues) and also the [draft release notes](https://gist.github.com/KelSolaar/4a6ebe9ec3d389f0934b154fec8df51d).
11+
The issue could already be fixed in the [develop](https://github.com/colour-science/colour) branch. If you have an installation problem, the [installation guide](https://www.colour-science.org/installation-guide/) describes the recommended process.
12+
13+
- type: textarea
14+
attributes:
15+
label: "Description"
16+
description: >
17+
Please describe the issue in a few short sentences.
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
attributes:
23+
label: "Code for Reproduction"
24+
description: >
25+
If possible, please provide a minimum self-contained example reproducing the issue.
26+
placeholder: |
27+
<< Your code here... >>
28+
render: python
29+
30+
- type: textarea
31+
attributes:
32+
label: "Exception Message"
33+
description: >
34+
If any, please paste the *full* exception message.
35+
placeholder: |
36+
<< Full traceback starting from `Traceback (most recent call last):`... >>
37+
render: shell
38+
39+
- type: textarea
40+
attributes:
41+
label: "Environment Information"
42+
description: If possible, please paste the output from `import colour; colour.utilities.describe_environment()`.
43+
render: shell
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Documentation Improvement
2+
description: Report a documentation improvement.
3+
title: "[DOCUMENTATION]: << Please use a comprehensive title... >>"
4+
labels: [ Documentation ]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: >
10+
Thank you for taking the time to file a documentation improvement report. Before continuing, please take some time to check the existing [issues](https://github.com/colour-science/colour/issues).
11+
12+
- type: input
13+
attributes:
14+
label: Documentation Link
15+
description: >
16+
Please link to any documentation or examples that you are referencing. Suggested improvements should be based on the [development version of the documentation](https://colour.readthedocs.io/en/develop/).
17+
placeholder: >
18+
<< https://colour.readthedocs.io/en/develop/... >>
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
attributes:
24+
label: Description
25+
description: >
26+
Please describe what is missing, unclear or incorrect.
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
attributes:
32+
label: Suggested Improvement
33+
description: >
34+
Please describe how the documentation could be improved.
35+
36+
- type: textarea
37+
attributes:
38+
label: "Environment Information"
39+
description: If possible, please paste the output from `import colour; colour.utilities.describe_environment()`.
40+
render: shell
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Feature Request
2+
description: Suggest a new feature to implement.
3+
title: "[FEATURE]: << Please use a comprehensive title... >>"
4+
labels: [ Feature ]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: >
10+
Thank you for taking the time to file a feature request. Before continuing, please take some time to check the existing [issues](https://github.com/colour-science/colour/issues) and also the [draft release notes](https://gist.github.com/KelSolaar/4a6ebe9ec3d389f0934b154fec8df51d).
11+
12+
- type: textarea
13+
attributes:
14+
label: "Description"
15+
description: >
16+
Please describe the new feature in a few short sentences.
17+
validations:
18+
required: true
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Question
2+
description: Ask a question.
3+
title: "[DISCUSSION]: << Please use a comprehensive title... >>"
4+
labels: [ Discussion ]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: Thank you for taking the time to ask a question or discuss. Before continuing, we would be glad if you were to start this discussion in the dedicated [discussions](https://github.com/colour-science/colour/discussions) area.
10+
11+
- type: textarea
12+
attributes:
13+
label: "Question"
14+
description: >
15+
If you are still here, please consider using the dedicated [discussions](https://github.com/colour-science/colour/discussions) area.
16+
placeholder: >
17+
<< The discussions area is this way: https://github.com/colour-science/colour/discussions... >>

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--
2+
Thank you for taking the time to create this pull request. If it is the first
3+
time you are contributing to a colour-science repository, a contributing guide
4+
is available to guide the process: https://www.colour-science.org/contributing/.
5+
-->
6+
7+
# Summary
8+
9+
<!-- Please write a summary describing the changes that this PR implements. -->
10+
11+
# Preflight
12+
13+
<!-- Please mark any checkboxes that do not apply to this pull request as [N/A]. -->
14+
15+
**Code Style and Quality**
16+
17+
- [ ] Unit tests have been implemented and passed.
18+
- [ ] Mypy static checking has been run and passed.
19+
- [ ] Pre-commit hooks have been run and passed.
20+
- [ ] New transformations have been added to the *Automatic Colour Conversion Graph*.
21+
- [ ] New transformations have been exported to the relevant namespaces, e.g. `colour`, `colour.models`.
22+
23+
<!-- The unit tests can be invoked with `poetry run invoke tests` -->
24+
<!-- Mypy can be started with `dmypy run -- --show-error-codes --warn-unused-ignores --warn-redundant-casts --install-types --non-interactive -p colour` -->
25+
26+
**Documentation**
27+
28+
- [ ] New features are documented along with examples if relevant.
29+
- [ ] The documentation is [Sphinx](https://www.sphinx-doc.org/en/master/) and [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) compliant.
30+
31+
<!--
32+
Thank you again!
33+
-->
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Continuous Integration - Documentation
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
continuous-integration-documentation:
7+
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-20.04]
11+
python-version: [3.8]
12+
fail-fast: false
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Environment Variables
17+
run: |
18+
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
19+
echo "CI_PACKAGE=colour" >> $GITHUB_ENV
20+
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
21+
echo "MPLBACKEND=AGG" >> $GITHUB_ENV
22+
echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV
23+
shell: bash
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v1
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install Dependencies
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get --yes install graphviz graphviz-dev latexmk texlive-full
32+
- name: Install Poetry
33+
run: |
34+
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
35+
python get-poetry.py
36+
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
37+
shell: bash
38+
- name: Install Package Dependencies
39+
run: |
40+
poetry run python -m pip install --upgrade pip
41+
poetry install --extras "read-the-docs"
42+
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
43+
shell: bash
44+
- name: Build Documentation
45+
run: |
46+
poetry run invoke docs
47+
shell: bash
48+
- uses: actions/upload-artifact@v2
49+
with:
50+
name: ${{ env.CI_PACKAGE }}-plots
51+
path: |
52+
docs/_static/Basics_*.png
53+
docs/_static/Examples_*.png
54+
docs/_static/Plotting_*.png
55+
docs/_static/Tutorial_*.png

.github/workflows/continuous-integration.yml renamed to .github/workflows/continuous-integration-quality-unit-tests.yml

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Continuous Integration
1+
name: Continuous Integration - Quality & Unit Tests
22

33
on: [push, pull_request]
44

55
jobs:
6-
continuous-integration:
6+
continuous-integration-package:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [macOS-latest, ubuntu-18.04, windows-latest]
11-
python-version: [2.7, 3.6, 3.7, 3.8]
10+
os: [macOS-latest, ubuntu-20.04, windows-latest]
11+
python-version: [3.8, 3.9, '3.10']
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
@@ -18,72 +18,69 @@ jobs:
1818
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
1919
echo "CI_PACKAGE=colour" >> $GITHUB_ENV
2020
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
21-
echo "CI_OPENIMAGEIO_VERSION=2.1.10.1" >> $GITHUB_ENV
22-
echo "CI_OPENIMAGEIO_ARTIFACT=https://github.com/colour-science/artifacts/releases/download/OpenImageIO-Release-2.1.10.1/OpenImageIO-Release-2.1.10.1.zip" >> $GITHUB_ENV
21+
echo "CI_OPENIMAGEIO_VERSION=2.2.18.0" >> $GITHUB_ENV
22+
echo "CI_OPENIMAGEIO_ARTIFACT=https://github.com/colour-science/artifacts/releases/download/OpenImageIO-Release-2.2.18.0/OpenImageIO-Release-2.2.18.0.zip" >> $GITHUB_ENV
2323
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
2424
echo "MPLBACKEND=AGG" >> $GITHUB_ENV
2525
shell: bash
2626
- name: Set up Python ${{ matrix.python-version }}
2727
uses: actions/setup-python@v1
2828
with:
2929
python-version: ${{ matrix.python-version }}
30-
- name: Update OS & Install APT Dependencies (Ubuntu)
31-
if: matrix.os == 'ubuntu-18.04'
32-
run: |
33-
sudo apt-get --yes install libboost-all-dev libilmbase-dev libopenexr-dev libpng-dev libtiff5-dev
34-
- name: Update OS & Install APT Dependencies (macOs)
30+
- name: Install Dependencies (macOS)
3531
if: matrix.os == 'macOS-latest'
3632
run: |
37-
brew install gnu-sed
33+
brew install gnu-sed graphviz
3834
ln -s /usr/local/bin/gsed /usr/local/bin/sed
3935
shell: bash
36+
- name: Install Dependencies (Ubuntu)
37+
if: matrix.os == 'ubuntu-20.04'
38+
run: |
39+
sudo apt-get --yes install graphviz graphviz-dev libboost-all-dev libilmbase-dev libopenexr-dev libpng-dev libtiff5-dev
4040
- name: Install Poetry
4141
run: |
4242
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
43-
python get-poetry.py --version 1.0.10
43+
python get-poetry.py --version 1.1.12
4444
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
4545
shell: bash
46-
- name: Update pyproject.toml file (Python 2.7)
47-
if: matrix.python-version == '2.7'
46+
- name: Install Package Dependencies (macOS & Ubuntu)
47+
if: matrix.os == 'macOS-latest' || matrix.os == 'ubuntu-20.04'
4848
run: |
49-
sed -i.bak 's/python = "~2.7 || ^3.6"/python = "~2.7"/g' pyproject.toml
50-
sed -i.bak '/scipy = "\^1\.1\.0"/ a qtconsole = "4.7.7"' pyproject.toml
51-
shell: bash
52-
- name: Update pyproject.toml file (Windows, Python 2.7)
53-
if: matrix.os == 'windows-latest' && matrix.python-version == '2.7'
54-
run: |
55-
sed -i.bak '/scipy = "\^1\.1\.0"/ a pywin32 = "228"' pyproject.toml
56-
shell: bash
57-
- name: Update pyproject.toml file (Python 3.x)
58-
if: matrix.python-version != '2.7'
59-
run: |
60-
sed -i.bak 's/python = "~2.7 || ^3.6"/python = "^3.6"/g' pyproject.toml
49+
poetry run python -m pip install --upgrade pip
50+
poetry install --extras "graphviz meshing optional plotting"
51+
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
6152
shell: bash
62-
- name: Install Package Dependencies
53+
- name: Install Package Dependencies (Windows)
54+
if: matrix.os == 'windows-latest'
6355
run: |
64-
poetry install --extras "optional plotting"
56+
poetry run python -m pip install --upgrade pip
57+
poetry install --extras "meshing optional plotting"
6558
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
6659
shell: bash
6760
- name: Install OpenImageIO (Ubuntu)
68-
if: matrix.os == 'ubuntu-18.04' && matrix.python-version == '3.6'
61+
if: matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.8'
6962
run: |
7063
curl -L $CI_OPENIMAGEIO_ARTIFACT -o OpenImageIO-Release-$CI_OPENIMAGEIO_VERSION.zip
7164
unzip OpenImageIO-Release-$CI_OPENIMAGEIO_VERSION.zip -d OpenImageIO-Release-$CI_OPENIMAGEIO_VERSION
7265
sudo cp OpenImageIO-Release-$CI_OPENIMAGEIO_VERSION/linux64/bin/* /usr/bin/
7366
sudo cp -r OpenImageIO-Release-$CI_OPENIMAGEIO_VERSION/linux64/lib/* /usr/lib/
7467
sudo rm -rf /usr/lib/python$CI_PYTHON_VERSION
75-
cp OpenImageIO-Release-$CI_OPENIMAGEIO_VERSION/linux64/lib/python$CI_PYTHON_VERSION/site-packages/OpenImageIO.so $(poetry env info -p)/lib/python$CI_PYTHON_VERSION/site-packages/
68+
cp OpenImageIO-Release-$CI_OPENIMAGEIO_VERSION/linux64/lib/python$CI_PYTHON_VERSION/site-packages/OpenImageIO.*.so $(poetry env info -p)/lib/python$CI_PYTHON_VERSION/site-packages/OpenImageIO.so
69+
shell: bash
70+
- name: Pre-Commit (All Files)
71+
run: |
72+
poetry run pre-commit run --all-files
7673
shell: bash
77-
- name: Lint with flake8
74+
- name: Test Optimised Python Execution
7875
run: |
79-
poetry run flake8 $CI_PACKAGE --count --show-source --statistics
76+
poetry run python -OO -c "import $CI_PACKAGE"
8077
shell: bash
81-
- name: Test with nosetests
78+
- name: Test with Pytest
8279
run: |
83-
poetry run python -W ignore -m nose -q -v --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
80+
poetry run python -W ignore -m py.test --disable-warnings --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
8481
shell: bash
8582
- name: Upload Coverage to coveralls.io
86-
if: matrix.python-version == '3.6' || matrix.python-version == '3.7' || matrix.python-version == '3.8'
83+
if: matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.8'
8784
run: |
8885
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
8986
shell: bash
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Continuous Integration - Static Type Checking
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
continuous-integration-package:
7+
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
8+
strategy:
9+
matrix:
10+
os: [macOS-latest]
11+
python-version: [3.9]
12+
fail-fast: false
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Environment Variables
17+
run: |
18+
echo "CI_PACKAGE=colour" >> $GITHUB_ENV
19+
shell: bash
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install Dependencies (macOS)
25+
run: |
26+
brew install gnu-sed graphviz
27+
ln -s /usr/local/bin/gsed /usr/local/bin/sed
28+
shell: bash
29+
- name: Static Type Checking
30+
run: |
31+
pip install -r requirements.txt
32+
mypy --install-types --non-interactive --show-error-codes --warn-unused-ignores --warn-redundant-casts -p $CI_PACKAGE

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
*.pyo
44
.DS_Store
55
.coverage
6+
.dmypy.json
67
.idea
8+
.mypy_cache
79
__pycache__
810
build
911
dist

0 commit comments

Comments
 (0)