-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/v0.2.2' into develop
- Loading branch information
Showing
63 changed files
with
467 additions
and
549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[run] | ||
source = colour_datasets | ||
sigterm = True | ||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
*.pyc | ||
*.pyo | ||
.DS_Store | ||
.coverage | ||
.coverage* | ||
.fleet | ||
.idea | ||
.ipynb_checkpoints | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,5 @@ About | |
|
||
| **Colour - Datasets** by Colour Developers | ||
| Copyright 2019 Colour Developers – `[email protected] <[email protected]>`__ | ||
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause | ||
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause | ||
| `https://github.com/colour-science/colour-datasets <https://github.com/colour-science/colour-datasets>`__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,11 @@ | ||
Copyright 2019 Colour Developers | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of the Colour Developers nor the | ||
names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL COLOUR DEVELOPERS BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
Copyright for portions of project openpyxl are held by Openpyxl Developers, | ||
2010 as part of project openpyxl distributed under the MIT Licence. | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,11 @@ Colour science datasets for use with | |
`Colour <https://github.com/colour-science/colour>`__ or any Python package | ||
manipulating colours. The datasets are hosted in `Zenodo <https://zenodo.org>`__ | ||
under the | ||
`Colour Science - Datasets <https://zenodo.org/communities/colour-science-datasets/>`__ | ||
`Colour Science - Datasets <https://zenodo.org/communities/colour-science-datasets>`__ | ||
community. | ||
|
||
It is open source and freely available under the | ||
`New BSD License <https://opensource.org/licenses/BSD-3-Clause>`__ terms. | ||
`BSD-3-Clause <https://opensource.org/licenses/BSD-3-Clause>`__ terms. | ||
|
||
.. contents:: **Table of Contents** | ||
:backlinks: none | ||
|
@@ -50,7 +50,7 @@ when trying to access or use colour science datasets: | |
|
||
**Colour - Datasets** offers all the above: it allows users to ingest and load | ||
colour science datasets with a single function call. The datasets information | ||
is hosted on `Zenodo <https://zenodo.org/communities/colour-science-datasets/>`__ | ||
is hosted on `Zenodo <https://zenodo.org/communities/colour-science-datasets>`__ | ||
where the record for a dataset typically contain: | ||
|
||
- An *urls.txt* file describing the urls to source the dataset files from. | ||
|
@@ -156,14 +156,14 @@ Primary Dependencies | |
|
||
**Colour - Datasets** requires various dependencies in order to run: | ||
|
||
- `python >= 3.8, < 4 <https://www.python.org/download/releases/>`__ | ||
- `cachetools <https://pypi.org/project/cachetools/>`__ | ||
- `colour-science >= 4 <https://pypi.org/project/colour-science/>`__ | ||
- `imageio >= 2, < 3 <https://imageio.github.io/>`__ | ||
- `numpy >= 1.19, < 2 <https://pypi.org/project/numpy/>`__ | ||
- `scipy >= 1.5, < 2 <https://pypi.org/project/scipy/>`__ | ||
- `tqdm <https://pypi.org/project/tqdm/>`__ | ||
- `xlrd <https://pypi.org/project/xlrd/>`__ | ||
- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__ | ||
- `cachetools <https://pypi.org/project/cachetools>`__ | ||
- `colour-science >= 4.3 <https://pypi.org/project/colour-science>`__ | ||
- `imageio >= 2, < 3 <https://imageio.github.io>`__ | ||
- `numpy >= 1.22, < 2 <https://pypi.org/project/numpy>`__ | ||
- `scipy >= 1.8, < 2 <https://pypi.org/project/scipy>`__ | ||
- `tqdm <https://pypi.org/project/tqdm>`__ | ||
- `xlrd <https://pypi.org/project/xlrd>`__ | ||
|
||
Pypi | ||
~~~~ | ||
|
@@ -182,7 +182,7 @@ Contributing | |
^^^^^^^^^^^^ | ||
|
||
If you would like to contribute to `Colour - Datasets <https://github.com/colour-science/colour-datasets>`__, | ||
please refer to the following `Contributing <https://www.colour-science.org/contributing/>`__ | ||
please refer to the following `Contributing <https://www.colour-science.org/contributing>`__ | ||
guide for `Colour <https://github.com/colour-science/colour>`__. | ||
|
||
Bibliography | ||
|
@@ -202,7 +202,7 @@ Code of Conduct | |
--------------- | ||
|
||
The *Code of Conduct*, adapted from the `Contributor Covenant 1.4 <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>`__, | ||
is available on the `Code of Conduct <https://www.colour-science.org/code-of-conduct/>`__ page. | ||
is available on the `Code of Conduct <https://www.colour-science.org/code-of-conduct>`__ page. | ||
|
||
Contact & Social | ||
---------------- | ||
|
@@ -220,5 +220,5 @@ About | |
|
||
| **Colour - Datasets** by Colour Developers | ||
| Copyright 2019 Colour Developers – `[email protected] <[email protected]>`__ | ||
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause | ||
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause | ||
| `https://github.com/colour-science/colour-datasets <https://github.com/colour-science/colour-datasets>`__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,5 @@ About | |
|
||
| **Colour - Datasets** by Colour Developers | ||
| Copyright 2019 Colour Developers – `[email protected] <[email protected]>`__ | ||
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause | ||
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause | ||
| `https://github.com/colour-science/colour-datasets <https://github.com/colour-science/colour-datasets>`__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
`Colour <https://github.com/colour-science/colour>`__ or any Python package | ||
manipulating colours. The datasets are hosted in | ||
`Zenodo <https://zenodo.org>`__ under the `Colour Science - Datasets \ | ||
<https://zenodo.org/communities/colour-science-datasets/>`__ community. | ||
<https://zenodo.org/communities/colour-science-datasets>`__ community. | ||
Subpackages | ||
----------- | ||
|
@@ -18,7 +18,7 @@ | |
import contextlib | ||
import numpy as np | ||
import os | ||
import subprocess # nosec | ||
import subprocess | ||
|
||
import colour | ||
|
||
|
@@ -29,7 +29,7 @@ | |
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2019 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -60,8 +60,8 @@ | |
|
||
try: | ||
_version = ( | ||
subprocess.check_output( # nosec | ||
["git", "describe"], | ||
subprocess.check_output( | ||
["git", "describe"], # noqa: S603, S607 | ||
cwd=os.path.dirname(__file__), | ||
stderr=subprocess.STDOUT, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2019 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ | |
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2019 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -253,11 +253,9 @@ def parse_workbook_Asano2015( | |
(LMS_ConeFundamentals, "LMS"), | ||
] | ||
): | ||
|
||
for j, degree in enumerate( | ||
[(2, "2$^\\circ$"), (10, "10$^\\circ$")] | ||
): | ||
|
||
sheet = book.sheet_by_index(j + (i * 2)) | ||
|
||
x = np.transpose( | ||
|
@@ -336,7 +334,7 @@ def build_Asano2015(load: bool = True) -> DatasetLoader_Asano2015: | |
:cite:`Asano2015` | ||
""" | ||
|
||
global _DATASET_LOADER_ASANO2015 | ||
global _DATASET_LOADER_ASANO2015 # noqa: PLW0603 | ||
|
||
if _DATASET_LOADER_ASANO2015 is None: | ||
_DATASET_LOADER_ASANO2015 = DatasetLoader_Asano2015() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2019 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -136,7 +136,7 @@ def build_Brendel2020(load: bool = True) -> DatasetLoader_Brendel2020: | |
:cite:`Brendel2020` | ||
""" | ||
|
||
global _DATASET_LOADER_BRENDEL2020 | ||
global _DATASET_LOADER_BRENDEL2020 # noqa: PLW0603 | ||
|
||
if _DATASET_LOADER_BRENDEL2020 is None: | ||
_DATASET_LOADER_BRENDEL2020 = DatasetLoader_Brendel2020() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,22 +22,15 @@ | |
|
||
from colour import MultiSpectralDistributions, SpectralDistribution | ||
from colour.continuous import MultiSignals, Signal | ||
from colour.hints import ( | ||
Any, | ||
Dict, | ||
Literal, | ||
Type, | ||
Union, | ||
cast, | ||
) | ||
from colour.hints import Any, Dict, Literal | ||
from colour.utilities import attest, is_numeric, is_string, optional | ||
|
||
from colour_datasets.loaders import AbstractDatasetLoader | ||
from colour_datasets.records import datasets | ||
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2019 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -1520,14 +1513,10 @@ def load( | |
|
||
for directory in ("camera", "cmf", "illuminant", "training"): | ||
self._content[directory] = {} | ||
factory = cast( | ||
Union[ | ||
Type[SpectralDistribution_AMPAS], | ||
Type[MultiSpectralDistributions_AMPAS], | ||
], | ||
factory = ( | ||
SpectralDistribution_AMPAS | ||
if directory == "illuminant" | ||
else MultiSpectralDistributions_AMPAS, | ||
else MultiSpectralDistributions_AMPAS | ||
) | ||
glob_pattern = os.path.join( | ||
self.record.repository, "dataset", "data", directory, "*.json" | ||
|
@@ -1567,7 +1556,7 @@ def build_Dyer2017(load: bool = True) -> DatasetLoader_Dyer2017: | |
:cite:`Dyer2017` | ||
""" | ||
|
||
global _DATASET_LOADER_DYER2017 | ||
global _DATASET_LOADER_DYER2017 # noqa: PLW0603 | ||
|
||
if _DATASET_LOADER_DYER2017 is None: | ||
_DATASET_LOADER_DYER2017 = DatasetLoader_Dyer2017() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2019 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -149,7 +149,7 @@ def _parse_float_values(data: str) -> NDArrayFloat: | |
if line.startswith("White Point"): | ||
XYZ_r = _parse_float_values(line.split(":")[-1]) | ||
elif line.startswith("reference hue"): | ||
line = line.replace("reference hue ", "") | ||
line = line.replace("reference hue ", "") # noqa: PLW2901 | ||
attribute, value = line.split("\t", 1) | ||
hue, data = int(attribute), _parse_float_values(value) | ||
|
||
|
@@ -194,7 +194,7 @@ def build_Ebner1998(load: bool = True) -> DatasetLoader_Ebner1998: | |
:cite:`Ebner1998` | ||
""" | ||
|
||
global _DATASET_LOADER_EBNER1998 | ||
global _DATASET_LOADER_EBNER1998 # noqa: PLW0603 | ||
|
||
if _DATASET_LOADER_EBNER1998 is None: | ||
_DATASET_LOADER_EBNER1998 = DatasetLoader_Ebner1998() | ||
|
Oops, something went wrong.