Skip to content

Commit

Permalink
Merge branch 'feature/v0.2.6' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Jul 17, 2024
2 parents 7027768 + 77581ad commit f72a4ca
Show file tree
Hide file tree
Showing 46 changed files with 352 additions and 503 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]
python-version: [3.12]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]
python-version: [3.12]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/examples/examples_load.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Showcases *Colour - Datasets* loading."""
"""Showcase *Colour - Datasets* loading."""

from colour.utilities import message_box

Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Abstract Dataset Loader
=======================
Defines the abstract class implementing support for dataset loading:
Define the abstract class implementing support for dataset loading:
- :class:`colour_datasets.loaders.AbstractDatasetLoader`
"""
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/asano2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Observer Function Database - Asano (2015)
=========================================
Defines the objects implementing support for *Asano (2015)* *Observer Function
Define the objects implementing support for *Asano (2015)* *Observer Function
Database* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Asano2015`
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/brendel2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Measured Commercial LED Spectra - Brendel (2020)
================================================
Defines the objects implementing support for *Brendel (2020)*
Define the objects implementing support for *Brendel (2020)*
*Measured Commercial LED Spectra* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Brendel2020`
Expand Down
40 changes: 20 additions & 20 deletions colour_datasets/loaders/dyer2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
RAW to ACES Utility Data - Dyer et al. (2017)
=============================================
Defines the objects implementing support for *Dyer, Forsythe, Irons, Mansencal
Define the objects implementing support for *Dyer, Forsythe, Irons, Mansencal
and Zhu (2017)* *RAW to ACES Utility Data* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Dyer2017`
Expand All @@ -23,7 +23,7 @@
from colour import MultiSpectralDistributions, SpectralDistribution
from colour.continuous import MultiSignals, Signal
from colour.hints import Any, Dict, Literal
from colour.utilities import attest, is_numeric, is_string, optional
from colour.utilities import attest, is_numeric, optional

from colour_datasets.loaders import AbstractDatasetLoader
from colour_datasets.records import datasets
Expand Down Expand Up @@ -168,7 +168,7 @@ def schema_version(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"schema_version" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -198,7 +198,7 @@ def catalog_number(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"catalog_number" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -228,7 +228,7 @@ def description(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"description" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -258,7 +258,7 @@ def document_creator(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"document_creator" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -288,7 +288,7 @@ def unique_identifier(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"unique_identifier" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -318,7 +318,7 @@ def measurement_equipment(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"measurement_equipment" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -348,7 +348,7 @@ def laboratory(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"laboratory" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -378,7 +378,7 @@ def document_creation_date(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"document_creation_date" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -408,7 +408,7 @@ def comments(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"comments" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -438,7 +438,7 @@ def license(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"license" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -627,7 +627,7 @@ def path(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"path" property: "{value}" type is not "str"!',
)
self._path = value
Expand Down Expand Up @@ -719,7 +719,7 @@ def units(

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"units" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -784,7 +784,7 @@ def reflection_geometry(

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"reflection_geometry" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -819,7 +819,7 @@ def transmission_geometry(

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"transmission_geometry" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -1125,7 +1125,7 @@ def path(self, value: str | None):

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"path" property: "{value}" type is not "str"!',
)
self._path = value
Expand Down Expand Up @@ -1217,7 +1217,7 @@ def units(

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"units" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -1282,7 +1282,7 @@ def reflection_geometry(

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"reflection_geometry" property: "{value}" type is not "str"!',
)

Expand Down Expand Up @@ -1317,7 +1317,7 @@ def transmission_geometry(

if value is not None:
attest(
is_string(value),
isinstance(value, str),
f'"transmission_geometry" property: "{value}" type is not "str"!',
)

Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/ebner1998.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Constant Perceived-Hue Data - Ebner and Fairchild (1998)
========================================================
Defines the objects implementing support for *Ebner and Fairchild (1998)*
Define the objects implementing support for *Ebner and Fairchild (1998)*
*Constant Perceived-Hue Data* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Ebner1998`
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/hung1995.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Constant Hue Loci Data - Hung and Berns (1995)
==============================================
Defines the objects implementing support for *Hung and Berns (1995)* *Constant
Define the objects implementing support for *Hung and Berns (1995)* *Constant
Hue Loci Data* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Hung1995`
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/jakob2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Spectral Upsampling Coefficient Tables - Jakob and Hanika (2019)
================================================================
Defines the objects implementing support for *Jakob and Hanika (2019)*
Define the objects implementing support for *Jakob and Hanika (2019)*
*Spectral Upsampling Coefficient Tables* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Jakob2019`
Expand Down
4 changes: 2 additions & 2 deletions colour_datasets/loaders/jiang2013.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Camera Spectral Sensitivity Database - Jiang et al. (2013)
==========================================================
Defines the objects implementing support for *Jiang, Liu, Gu and Süsstrunk
Define the objects implementing support for *Jiang, Liu, Gu and Süsstrunk
(2013)* *Camera Spectral Sensitivity Database* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Jiang2013`
Expand Down Expand Up @@ -113,7 +113,7 @@ def load(self) -> Dict[str, RGB_CameraSensitivities]:

for camera, values in self._content.items():
self._content[camera] = RGB_CameraSensitivities(
np.transpose(as_float_array(values).reshape([3, 33])),
np.transpose(np.reshape(as_float_array(values), (3, 33))),
shape.range(),
name=camera,
)
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/karge2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Spectral Database of Commonly Used Cine Lighting - Karge et al. (2015)
======================================================================
Defines the objects implementing support for *Karge, Froehlich and Eberhardt
Define the objects implementing support for *Karge, Froehlich and Eberhardt
(2015)* *Spectral Database of Commonly Used Cine Lighting* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Karge2015`
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/kuopio.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
University of Kuopio
====================
Defines the objects implementing support for the *University of Kuopio*
Define the objects implementing support for the *University of Kuopio*
datasets loading:
- :class:`colour_datasets.loaders.DatasetLoader_KuopioUniversity`
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/labsphere2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Labsphere SRS-99-020 - Labsphere (2019)
=======================================
Defines the objects implementing support for *Labsphere (2019)* *Labsphere
Define the objects implementing support for *Labsphere (2019)* *Labsphere
SRS-99-020* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Labsphere2019`
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/luo1997.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
LUTCHI Colour Appearance Data - Luo and Rhodes (1997)
=====================================================
Defines the objects implementing support for *Luo and Rhodes (1997)*
Define the objects implementing support for *Luo and Rhodes (1997)*
*LUTCHI Colour Appearance Data* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Luo1997`
Expand Down
6 changes: 3 additions & 3 deletions colour_datasets/loaders/luo1999.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Corresponding-Colour Datasets - Luo and Rhodes (1999)
=====================================================
Defines the objects implementing support for *Luo and Rhodes (1999)*
Define the objects implementing support for *Luo and Rhodes (1999)*
*Corresponding-Colour Datasets* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Luo1999`
Expand Down Expand Up @@ -199,7 +199,7 @@ def load(self) -> Dict[str, CorrespondingColourDataset_Luo1999]:
20,
"D65",
"D65",
np.repeat([10, 50, 1000, 3000], 2, -1).reshape(-1, 2),
np.reshape(np.repeat([10, 50, 1000, 3000], 2, -1), (-1, 2)),
np.tile(20, [4, 2]),
"S",
"Refl.",
Expand All @@ -218,7 +218,7 @@ def load(self) -> Dict[str, CorrespondingColourDataset_Luo1999]:
19,
"D65",
"D65",
np.repeat([10, 50, 1000, 3000], 2, -1).reshape(-1, 2),
np.reshape(np.repeat([10, 50, 1000, 3000], 2, -1), (-1, 2)),
np.tile(20, [4, 2]),
"S",
"Refl.",
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/solomotav2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Camera Dataset - Solomatov and Akkaynak (2023)
==============================================
Defines the objects implementing support for *Solomatov and Akkaynak (2023)*
Define the objects implementing support for *Solomatov and Akkaynak (2023)*
*Camera Dataset* dataset loading:
- :class:`colour_datasets.loaders.DatasetLoader_Solomotav2023`
Expand Down
13 changes: 3 additions & 10 deletions colour_datasets/loaders/tests/test_abstract.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# !/usr/bin/env python
"""Define the unit tests for the :mod:`colour_datasets.loaders.abstract` module."""

import unittest

from colour_datasets.loaders import AbstractDatasetLoader

__author__ = "Colour Developers"
Expand All @@ -17,7 +14,7 @@
]


class TestAbstractDatasetLoader(unittest.TestCase):
class TestAbstractDatasetLoader:
"""
Define :class:`colour_datasets.loaders.abstract.AbstractDatasetLoader`
class unit tests methods.
Expand All @@ -29,16 +26,12 @@ def test_required_attributes(self):
required_attributes = ("ID", "record", "id", "content")

for attribute in required_attributes:
self.assertIn(attribute, dir(AbstractDatasetLoader))
assert attribute in dir(AbstractDatasetLoader)

def test_required_methods(self):
"""Test the presence of required methods."""

required_methods = ("__init__", "load", "sync")

for method in required_methods:
self.assertIn(method, dir(AbstractDatasetLoader))


if __name__ == "__main__":
unittest.main()
assert method in dir(AbstractDatasetLoader)
Loading

0 comments on commit f72a4ca

Please sign in to comment.