Skip to content

Commit 751c549

Browse files
committed
Merge branch 'release/v0.1.2'
2 parents 3265ba8 + 519680c commit 751c549

22 files changed

+423
-320
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 21 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -3,134 +3,49 @@ name: Continuous Integration
33
on: [push, pull_request]
44

55
jobs:
6-
unix-build:
7-
name: Unix Build
6+
continuous-integration:
7+
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [ubuntu-18.04, macOS-10.14]
11-
python-version: [3.6, 3.7]
10+
os: [macOS-latest, ubuntu-18.04, windows-2019]
11+
python-version: [3.6, 3.7, 3.8]
12+
fail-fast: false
1213
runs-on: ${{ matrix.os }}
1314
steps:
1415
- uses: actions/checkout@v1
1516
with:
1617
submodules: true
1718
- name: Environment Variables
1819
run: |
19-
CI_PYTHON_VERSION=${{ matrix.python-version }}
20-
CI_PACKAGE=colour_checker_detection
21-
CI_SHA=${{ github.sha }}
22-
CI_SLACK_WEBHOOK=${{ secrets.SLACK_WEBHOOK }}
23-
CI_SLACK_SUCCESS_NOTIFICATION="payload={\"attachments\": [{\"color\": \"#4CAF50\", \"author_name\": \"Python ${{ matrix.python-version }} build on ${{ matrix.os }}\", \"text\": \"Build for commit *${CI_SHA:0:7}* succeeded!\", \"title\": \"${{ github.repository }}@${{ github.ref }}\", \"title_link\": \"https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks\", \"footer\": \"Triggered by ${{ github.actor }}\"}], \"username\":\"Github Actions @ ${{ github.repository }}\", \"channel\":\"#continuous-integration\", \"icon_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}"
24-
CI_SLACK_FAILURE_NOTIFICATION="${CI_SLACK_SUCCESS_NOTIFICATION/4CAF50/F44336}"
25-
CI_SLACK_FAILURE_NOTIFICATION="${CI_SLACK_FAILURE_NOTIFICATION/succeeded/failed}"
26-
COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
27-
echo ::set-env name=CI_PYTHON_VERSION::$CI_PYTHON_VERSION
28-
echo ::set-env name=CI_PACKAGE::$CI_PACKAGE
29-
echo ::set-env name=CI_SHA::$CI_SHA
30-
echo ::set-env name=CI_SLACK_WEBHOOK::$CI_SLACK_WEBHOOK
31-
echo ::set-env name=CI_SLACK_SUCCESS_NOTIFICATION::$CI_SLACK_SUCCESS_NOTIFICATION
32-
echo ::set-env name=CI_SLACK_FAILURE_NOTIFICATION::$CI_SLACK_FAILURE_NOTIFICATION
33-
echo ::set-env name=COVERALLS_REPO_TOKEN::$COVERALLS_REPO_TOKEN
20+
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
21+
echo "CI_PACKAGE=colour_checker_detection" >> $GITHUB_ENV
22+
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
23+
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
24+
shell: bash
3425
- name: Set up Python ${{ matrix.python-version }}
3526
uses: actions/setup-python@v1
3627
with:
3728
python-version: ${{ matrix.python-version }}
3829
- name: Install Poetry
3930
run: |
4031
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
41-
python get-poetry.py --preview
42-
PATH=$HOME/.poetry/bin:$PATH
43-
echo ::set-env name=PATH::$PATH
32+
python get-poetry.py --version 1.0.10
33+
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
34+
shell: bash
4435
- name: Install Package Dependencies
4536
run: |
4637
poetry install
47-
source $(poetry env info -p)/bin/activate
48-
python -c "import imageio;imageio.plugins.freeimage.download()"
38+
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
39+
shell: bash
4940
- name: Lint with flake8
5041
run: |
51-
source $(poetry env info -p)/bin/activate
52-
flake8 $CI_PACKAGE --count --show-source --statistics
42+
poetry run flake8 $CI_PACKAGE --count --show-source --statistics
43+
shell: bash
5344
- name: Test with nosetests
5445
run: |
55-
source $(poetry env info -p)/bin/activate
56-
python -W ignore -m nose -v --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
46+
poetry run python -W ignore -m nose -q -v --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=$CI_PACKAGE $CI_PACKAGE
47+
shell: bash
5748
- name: Upload Coverage to coveralls.io
58-
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
5949
run: |
60-
source $(poetry env info -p)/bin/activate
61-
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else coveralls; fi
62-
- name: Notify Slack
63-
if: always()
64-
run: |
65-
if [ "${{ job.status }}" == "Success" ]; then CI_SLACK_NOTIFICATION="$CI_SLACK_SUCCESS_NOTIFICATION"; else CI_SLACK_NOTIFICATION="$CI_SLACK_FAILURE_NOTIFICATION"; fi
66-
if [ -z "$CI_SLACK_WEBHOOK" ]; then echo \"SLACK_WEBHOOK\" secret is undefined!; else curl -k -d "$CI_SLACK_NOTIFICATION" -X POST $CI_SLACK_WEBHOOK; fi
67-
windows-build:
68-
name: Windows Build
69-
strategy:
70-
matrix:
71-
os: [windows-2019]
72-
python-version: [3.6, 3.7]
73-
runs-on: ${{ matrix.os }}
74-
steps:
75-
- uses: actions/checkout@v1
76-
with:
77-
submodules: true
78-
- name: Environment Variables
79-
run: |
80-
set CI_PYTHON_VERSION=${{ matrix.python-version }}
81-
set CI_PACKAGE=colour_checker_detection
82-
set CI_SHA=${{ github.sha }}
83-
set CI_SLACK_WEBHOOK=${{ secrets.SLACK_WEBHOOK }}
84-
set CI_SLACK_SUCCESS_NOTIFICATION="payload={\"attachments\": [{\"color\": \"#4CAF50\", \"author_name\": \"Python ${{ matrix.python-version }} build on ${{ matrix.os }}\", \"text\": \"Build for commit *"%CI_SHA:~0,7%"* succeeded!\", \"title\": \"${{ github.repository }}@${{ github.ref }}\", \"title_link\": \"https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks\", \"footer\": \"Triggered by ${{ github.actor }}\"}], \"username\":\"Github Actions @ ${{ github.repository }}\", \"channel\":\"#continuous-integration\", \"icon_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}"
85-
set CI_SLACK_FAILURE_NOTIFICATION=%CI_SLACK_SUCCESS_NOTIFICATION:4CAF50=F44336%
86-
set CI_SLACK_FAILURE_NOTIFICATION=%CI_SLACK_FAILURE_NOTIFICATION:succeeded=failed%
87-
set COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}
88-
echo ::set-env name=CI_PYTHON_VERSION::%CI_PYTHON_VERSION%
89-
echo ::set-env name=CI_PACKAGE::%CI_PACKAGE%
90-
echo ::set-env name=CI_SHA::%CI_SHA%
91-
echo ::set-env name=CI_SLACK_WEBHOOK::%CI_SLACK_WEBHOOK%
92-
echo ::set-env name=CI_SLACK_SUCCESS_NOTIFICATION::%CI_SLACK_SUCCESS_NOTIFICATION%
93-
echo ::set-env name=CI_SLACK_FAILURE_NOTIFICATION::%CI_SLACK_FAILURE_NOTIFICATION%
94-
echo ::set-env name=COVERALLS_REPO_TOKEN::%COVERALLS_REPO_TOKEN%
95-
shell: cmd
96-
- name: Set up Python ${{ matrix.python-version }}
97-
uses: actions/setup-python@v1
98-
with:
99-
python-version: ${{ matrix.python-version }}
100-
- name: Install Poetry
101-
run: |
102-
curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py
103-
python get-poetry.py --preview
104-
set PATH=%USERPROFILE%\.poetry\bin;%PATH%
105-
echo ::set-env name=PATH::%PATH%
106-
shell: cmd
107-
- name: Install Package Dependencies
108-
run: |
109-
call poetry install
110-
FOR /F %%a IN ('poetry env info -p') DO SET CI_VIRTUAL_ENVIRONMENT=%%a
111-
echo ::set-env name=CI_VIRTUAL_ENVIRONMENT::%CI_VIRTUAL_ENVIRONMENT%
112-
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
113-
python -c "import imageio;imageio.plugins.freeimage.download()"
114-
shell: cmd
115-
- name: Lint with flake8
116-
run: |
117-
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
118-
flake8 %CI_PACKAGE% --count --show-source --statistics
119-
shell: cmd
120-
- name: Test with nosetests
121-
run: |
122-
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
123-
python -W ignore -m nose -v --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=%CI_PACKAGE% %CI_PACKAGE%
124-
shell: cmd
125-
- name: Upload Coverage to coveralls.io
126-
if: matrix.python-version == '3.6' || matrix.python-version == '3.7'
127-
run: |
128-
call %CI_VIRTUAL_ENVIRONMENT%\scripts\activate
129-
IF "%COVERALLS_REPO_TOKEN%"=="" (echo "COVERALLS_REPO_TOKEN" secret is undefined!) ELSE (coveralls)
130-
shell: cmd
131-
- name: Notify Slack
132-
if: always()
133-
run: |
134-
IF "${{ job.status }}"=="Success" (set CI_SLACK_NOTIFICATION=%CI_SLACK_SUCCESS_NOTIFICATION%) ELSE (set CI_SLACK_NOTIFICATION=%CI_SLACK_FAILURE_NOTIFICATION%)
135-
IF "%CI_SLACK_WEBHOOK%"=="" (echo "SLACK_WEBHOOK" secret is undefined!) ELSE (curl -k -d %CI_SLACK_NOTIFICATION% -X POST %CI_SLACK_WEBHOOK%)
136-
shell: cmd
50+
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
51+
shell: bash

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ repos:
33
rev: 3.7.8
44
hooks:
55
- id: flake8
6-
exclude: examples
6+
exclude: examples|setup\.py
77
- repo: https://github.com/pre-commit/mirrors-yapf
88
rev: v0.23.0
99
hooks:
1010
- id: yapf
11+
exclude: setup\.py

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ build:
22
image: latest
33

44
python:
5-
version: 3.6
5+
version: 3.7
66
pip_install: true
77
extra_requirements:
88
- read-the-docs

BIBLIOGRAPHY.bib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@misc{Abecassis2011,
2+
title = {OpenCV - Rotation (Deskewing)},
23
author = {Abecassis, Felix},
3-
title = {{OpenCV - Rotation (Deskewing)}},
4+
year = 2011,
45
url = {http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/},
56
urldate = {2018-10-27},
6-
year = 2011,
77
}

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This Code of Conduct applies within all project spaces, and it also applies when
3636
## Enforcement
3737

3838

39-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting Thomas Mansencal and Michael Mauderer via email at thomas.mansencal@gmail.com and michael@mauderer.me 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.
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting Thomas Mansencal and Michael Mauderer via email at thomas@colour-science.org and michael@colour-science.org 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.
4040

4141
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.
4242

CONTRIBUTORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ About
1616
-----
1717

1818
| **Colour - Checker Detection** by Colour Developers
19-
| Copyright © 2018-2019 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`__
19+
| Copyright © 2018-2020 – Colour Developers – `colour-developers@colour-science.org <colour-developers@colour-science.org>`__
2020
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
2121
| `https://github.com/colour-science/colour-checker-detection <https://github.com/colour-science/colour-checker-detection>`__

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018-2019, Colour Developers
1+
Copyright (c) 2018-2020, Colour Developers
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Colour - Checker Detection
55
66
|actions| |coveralls| |codacy| |version|
77

8-
.. |actions| image:: https://github.com/colour-science/colour-checker-detection/workflows/Continuous%20Integration/badge.svg
8+
.. |actions| image:: https://img.shields.io/github/workflow/status/colour-science/colour-checker-detection/Continuous%20Integration?label=actions&logo=github&style=flat-square
99
:target: https://github.com/colour-science/colour-checker-detection/actions
1010
:alt: Develop Build Status
1111
.. |coveralls| image:: http://img.shields.io/coveralls/colour-science/colour-checker-detection/develop.svg?style=flat-square
@@ -57,22 +57,22 @@ Primary Dependencies
5757

5858
**Colour - Checker Detection** requires various dependencies in order to run:
5959

60-
- `Python >=3.5 <https://www.python.org/download/releases/>`__
61-
- `Colour Science <https://www.colour-science.org>`__
62-
- `opencv-python >=4 <https://pypi.org/project/opencv-python/>`__
60+
- `python>=3.5 <https://www.python.org/download/releases/>`__
61+
- `colour-science <https://pypi.org/project/colour-science/>`__
62+
- `opencv-python>=4 <https://pypi.org/project/opencv-python/>`__
6363

6464
Pypi
6565
^^^^
6666

67-
Once the dependencies satisfied, **Colour - Checker Detection** can be installed from
67+
Once the dependencies are satisfied, **Colour - Checker Detection** can be installed from
6868
the `Python Package Index <http://pypi.python.org/pypi/colour-checker-detection>`__ by
6969
issuing this command in a shell::
7070

71-
pip install colour-checker-detection
71+
pip install --user colour-checker-detection
7272

7373
The overall development dependencies are installed as follows::
7474

75-
pip install 'colour-checker-detection[development]'
75+
pip install --user 'colour-checker-detection[development]'
7676

7777
Usage
7878
-----
@@ -113,6 +113,6 @@ About
113113
-----
114114

115115
| **Colour - Checker Detection** by Colour Developers
116-
| Copyright © 2018-2019 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`__
116+
| Copyright © 2018-2020 – Colour Developers – `colour-developers@colour-science.org <colour-developers@colour-science.org>`__
117117
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
118118
| `https://github.com/colour-science/colour-checker-detection <https://github.com/colour-science/colour-checker-detection>`__

TODO.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ TODO
1111

1212
- colour_checker_detection/detection/tests/test_segmentation.py
1313

14-
- Line 207 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
15-
- Line 492 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
14+
- Line 227 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
15+
- Line 517 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
1616

1717
About
1818
-----
1919

2020
| **Colour - Checker Detection** by Colour Developers
21-
| Copyright © 2018-2019 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`__
21+
| Copyright © 2018-2020 – Colour Developers – `colour-developers@colour-science.org <colour-developers@colour-science.org>`__
2222
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
2323
| `https://github.com/colour-science/colour-checker-detection <https://github.com/colour-science/colour-checker-detection>`__

colour_checker_detection/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
detect_colour_checkers_segmentation)
2525

2626
__author__ = 'Colour Developers'
27-
__copyright__ = 'Copyright (C) 2018-2019 - Colour Developers'
27+
__copyright__ = 'Copyright (C) 2018-2020 - Colour Developers'
2828
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
2929
__maintainer__ = 'Colour Developers'
30-
__email__ = 'colour-science@googlegroups.com'
30+
__email__ = 'colour-developers@colour-science.org'
3131
__status__ = 'Production'
3232

3333
__all__ = [
@@ -46,7 +46,7 @@
4646

4747
__major_version__ = '0'
4848
__minor_version__ = '1'
49-
__change_version__ = '1'
49+
__change_version__ = '2'
5050
__version__ = '.'.join(
5151
(__major_version__,
5252
__minor_version__,

colour_checker_detection/detection/segmentation.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
References
1313
----------
1414
- :cite:`Abecassis2011` : Abecassis, F. (2011). OpenCV - Rotation
15-
(Deskewing). Retrieved October 27, 2018, from
16-
http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/
15+
(Deskewing). Retrieved October 27, 2018, from http://felix.abecassis.me/\
16+
2011/10/opencv-rotation-deskewing/
1717
"""
1818

1919
from __future__ import division, unicode_literals
@@ -26,10 +26,10 @@
2626
from colour.utilities import as_float_array, as_int_array, as_int
2727

2828
__author__ = 'Colour Developers'
29-
__copyright__ = 'Copyright (C) 2018-2019 - Colour Developers'
29+
__copyright__ = 'Copyright (C) 2018-2020 - Colour Developers'
3030
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
3131
__maintainer__ = 'Colour Developers'
32-
__email__ = 'colour-science@googlegroups.com'
32+
__email__ = 'colour-developers@colour-science.org'
3333
__status__ = 'Production'
3434

3535
__all__ = [
@@ -155,15 +155,15 @@ def swatch_masks(width, height, swatches_h, swatches_v, samples):
155155
Examples
156156
--------
157157
>>> from pprint import pprint
158-
>>> pprint(swatch_masks(16, 8, 4, 2, 1))
159-
[array([2, 2, 2, 2]),
160-
array([2, 2, 6, 6]),
161-
array([ 2, 2, 10, 10]),
162-
array([ 2, 2, 14, 14]),
163-
array([6, 6, 2, 2]),
164-
array([6, 6, 6, 6]),
165-
array([ 6, 6, 10, 10]),
166-
array([ 6, 6, 14, 14])]
158+
>>> pprint(swatch_masks(16, 8, 4, 2, 1)) # doctest: +ELLIPSIS
159+
[array([2, 2, 2, 2]...),
160+
array([2, 2, 6, 6]...),
161+
array([ 2, 2, 10, 10]...),
162+
array([ 2, 2, 14, 14]...),
163+
array([6, 6, 2, 2]...),
164+
array([6, 6, 6, 6]...),
165+
array([ 6, 6, 10, 10]...),
166+
array([ 6, 6, 14, 14]...)]
167167
"""
168168

169169
samples = as_int(samples / 2)
@@ -520,11 +520,11 @@ def colour_checkers_coordinates_segmentation(image, additional_data=False):
520520
... 'colour_checker_detection', 'detection',
521521
... 'IMG_1967.png')
522522
>>> image = read_image(path)
523-
>>> colour_checkers_coordinates_segmentation(image)
523+
>>> colour_checkers_coordinates_segmentation(image) # doctest: +ELLIPSIS
524524
[array([[1065, 707],
525525
[ 369, 688],
526526
[ 382, 226],
527-
[1078, 246]])]
527+
[1078, 246]]...)]
528528
"""
529529

530530
image = as_8_bit_BGR_image(adjust_image(image, WORKING_WIDTH))

0 commit comments

Comments
 (0)