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 Oct 12, 2024
2 parents e4027ea + 0e513e3 commit 3608b43
Show file tree
Hide file tree
Showing 36 changed files with 423 additions and 363 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ is available to guide the process: https://www.colour-science.org/contributing/.
- [ ] Pyright static checking has been run and passed.
- [ ] Pre-commit hooks have been run and passed.

<!-- The unit tests can be invoked with `poetry run invoke tests` -->
<!-- Pyright can be started with `pyright --skipunannotated` -->
<!-- The unit tests can be invoked with `uv run invoke tests` -->
<!-- Pyright can be started with `pyright --threads --skipunannotated` -->

**Documentation**

Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/continuous-integration-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.12]
python-version: [3.13]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -22,25 +22,23 @@ jobs:
echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get --yes install latexmk texlive-full
- name: Install Poetry
- name: Install uv
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
pip install uv
shell: bash
- name: Install Package Dependencies
run: |
poetry run python -m pip install --upgrade pip
poetry install
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
uv sync --all-extras --no-dev
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
shell: bash
- name: Build Documentation
run: |
poetry run invoke docs
uv run invoke docs
shell: bash
27 changes: 13 additions & 14 deletions .github/workflows/continuous-integration-quality-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.12]
python-version: [3.13]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -20,37 +20,36 @@ jobs:
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
shell: bash
- name: Set up Python 3.9 for Pre-Commit
uses: actions/setup-python@v4
- name: Set up Python 3.10 for Pre-Commit
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.10"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
- name: Install uv
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
pip install uv
shell: bash
- name: Install Package Dependencies
run: |
poetry run python -m pip install --upgrade pip
poetry install
uv sync --all-extras --no-dev
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
shell: bash
- name: Pre-Commit (All Files)
run: |
poetry run pre-commit run --all-files
uv run pre-commit run --all-files
shell: bash
- name: Test Optimised Python Execution
run: |
poetry run python -OO -c "import $CI_PACKAGE"
uv run python -OO -c "import $CI_PACKAGE"
shell: bash
- name: Test with Pytest
run: |
poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
uv run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
shell: bash
- name: Upload Coverage to coveralls.io
run: |
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else uv run coveralls; fi
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
echo "CI_PACKAGE=colour_datasets" >> $GITHUB_ENV
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Package Dependencies
run: |
pip install -r requirements.txt
cat requirements.txt | grep -Eo '(^[^#]+)' | xargs -n 1 pip install || true
- name: Static Type Checking
run: |
pyright --skipunannotated
pyright --threads --skipunannotated
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.fleet
.idea
.ipynb_checkpoints
.python-version
.sandbox
.vs
.vscode
Expand All @@ -18,4 +19,4 @@ docs/_build
docs/generated
references
zenodo
poetry.lock
uv.lock
2 changes: 1 addition & 1 deletion CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors
Development & Technical Support
-------------------------------

- **Thomas Mansencal**, *Technology Supervisor @ Wētā FX*
- **Thomas Mansencal**, *Principal Pipeline Programmer @ Epic Games*

Project coordination, overall development.

Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ when trying to access or use colour science datasets:

- No straightforward ingestion path for dataset content.
- No simple loading mechanism for dataset content.
- Unavailability of the dataset, e.g. download url is down, dataset content is
- Unavailability of the dataset, e.g., download url is down, dataset content is
passed directly from hand to hand.
- No information regarding the definitive origination of the dataset.

Expand Down Expand Up @@ -160,14 +160,14 @@ Primary Dependencies

**Colour - Datasets** requires various dependencies in order to run:

- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__
- `python >= 3.10, < 3.14 <https://www.python.org/download/releases>`__
- `cachetools <https://pypi.org/project/cachetools>`__
- `colour-science >= 4.3 <https://pypi.org/project/colour-science>`__
- `colour-science >= 4.4 <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>`__
- `numpy >= 1.24, < 3 <https://pypi.org/project/numpy>`__
- `scipy >= 1.10, < 2 <https://pypi.org/project/scipy>`__
- `tqdm <https://pypi.org/project/tqdm>`__
- `xlrd <https://pypi.org/project/xlrd>`__
- `xlrd >=1.2, <2 <https://pypi.org/project/xlrd>`__

Pypi
~~~~
Expand Down
14 changes: 7 additions & 7 deletions TODO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ TODO

- colour_datasets/__init__.py

- Line 78 : # TODO: Remove legacy printing support when deemed appropriate.
- Line 74 : # TODO: Remove legacy printing support when deemed appropriate.


- colour_datasets/records/zenodo.py

- Line 450 : # TODO: Remove the following space escaping: The new Zenodo API is not quoting filenames properly thus we are temporarily escaping spaces for now. https://github.com/colour-science/colour-datasets/issues/ 36issuecomment-1773464695
- Line 433 : # TODO: Remove the following space escaping: The new Zenodo API is not quoting filenames properly thus we are temporarily escaping spaces for now. https://github.com/colour-science/colour-datasets/issues/ 36issuecomment-1773464695


- colour_datasets/utilities/common.py

- Line 42 : # TODO: Use *colour* definition.
- Line 43 : # TODO: Use *colour* definition.


- colour_datasets/loaders/kuopio.py

- Line 310 : # TODO: Implement support for *Natural Colors*: https://sandbox.zenodo.org/record/315640 http://www.uef.fi/web/spectral/natural-colors
- Line 304 : # TODO: Implement support for *Natural Colors*: https://sandbox.zenodo.org/record/315640 http://www.uef.fi/web/spectral/natural-colors


- colour_datasets/loaders/xrite2016.py

- Line 109 : # TODO: Implement support for "CGATS" file format in "Colour": https://github.com/colour-science/colour/issues/354
- Line 108 : # TODO: Implement support for "CGATS" file format in "Colour": https://github.com/colour-science/colour/issues/354


- colour_datasets/loaders/dyer2017.py

- Line 141 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114. Those attributes are currently stored in "self._kwargs".
- Line 928 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114.
- Line 1430 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114.
- Line 923 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114.
- Line 1420 : # TODO: Re-instate "manufacturer", "model", "illuminant" and "type" attributes according to outcome of https://github.com/ampas/rawtoaces/issues/114.

About
-----
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

__major_version__ = "0"
__minor_version__ = "2"
__change_version__ = "5"
__change_version__ = "6"
__version__ = ".".join((__major_version__, __minor_version__, __change_version__))

try:
Expand Down
4 changes: 2 additions & 2 deletions colour_datasets/loaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@

def load(dataset: int | str) -> Any:
"""
Load given dataset: The dataset is pulled locally, i.e. synced if required
Load given dataset: The dataset is pulled locally, i.e., synced if required
and then its data is loaded.
Parameters
----------
dataset
Dataset id, i.e. the *Zenodo* record number or title.
Dataset id, i.e., the *Zenodo* record number or title.
Returns
-------
Expand Down
6 changes: 3 additions & 3 deletions colour_datasets/loaders/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class AbstractDatasetLoader(ABC):
"""

ID: str = "Undefined"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self, record: Record) -> None:
self._record: Record = record
Expand Down Expand Up @@ -119,12 +119,12 @@ def load(self) -> Any:
-----
- Sub-classes are required to call
:meth:`colour_datasets.loaders.AbstractDatasetLoader.sync` method
when they implement it, e.g. ``super().sync()``.
when they implement it, e.g., ``super().sync()``.
"""

def sync(self):
"""
Sync the dataset content, i.e. checks whether it is synced and pulls
Sync the dataset content, i.e., checks whether it is synced and pulls
it if required.
"""

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 @@ -115,7 +115,7 @@ class DatasetLoader_Asano2015(AbstractDatasetLoader):
"""

ID: str = "3252742"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Asano2015.ID])
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 @@ -59,7 +59,7 @@ class DatasetLoader_Brendel2020(AbstractDatasetLoader):
"""

ID: str = "4051012"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Brendel2020.ID])
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/dyer2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ class DatasetLoader_Dyer2017(AbstractDatasetLoader):
"""

ID: str = "3372171"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Dyer2017.ID])
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 @@ -91,7 +91,7 @@ class DatasetLoader_Ebner1998(AbstractDatasetLoader):
"""

ID: str = "3362536"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Ebner1998.ID])
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 @@ -90,7 +90,7 @@ class DatasetLoader_Hung1995(AbstractDatasetLoader):
"""

ID: str = "3367463"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Hung1995.ID])
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 @@ -59,7 +59,7 @@ class DatasetLoader_Jakob2019(AbstractDatasetLoader):
"""

ID: str = "4050598"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Jakob2019.ID])
Expand Down
2 changes: 1 addition & 1 deletion colour_datasets/loaders/jiang2013.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DatasetLoader_Jiang2013(AbstractDatasetLoader):
"""

ID: str = "3245883"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Jiang2013.ID])
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 @@ -62,7 +62,7 @@ class DatasetLoader_Karge2015(AbstractDatasetLoader):
"""

ID: str = "4642271"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Karge2015.ID])
Expand Down
4 changes: 2 additions & 2 deletions colour_datasets/loaders/kuopio.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class DatasetLoader_KuopioUniversity(AbstractDatasetLoader):
"""

ID: str = "Undefined"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

METADATA: ClassVar[Dict] = {}
"""
Expand Down Expand Up @@ -203,7 +203,7 @@ def _build_dataset_loader_class_KuopioUniversity(
Parameters
----------
id_
Dataset record id, i.e. the *Zenodo* record number.
Dataset record id, i.e., the *Zenodo* record number.
title
*University of Kuopio* dataset loader title.
citation_key
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 @@ -56,7 +56,7 @@ class DatasetLoader_Labsphere2019(AbstractDatasetLoader):
"""

ID: str = "3245875"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Labsphere2019.ID])
Expand Down
6 changes: 3 additions & 3 deletions colour_datasets/loaders/luo1997.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ExperimentalGroupLuo1997(
):
"""
Define a *Luo and Rhodes (1997)* *LUTCHI Colour Appearance Data*
experimental group, i.e. a group of experimental phases.
experimental group, i.e., a group of experimental phases.
Parameters
----------
Expand Down Expand Up @@ -112,7 +112,7 @@ class ExperimentalPhaseLuo1997(
and measured using a telespectroradiometer (TSR).
S_Y_c
Scaling factor :math:`S_Y` of the Y values used for adjusting those in
the colorimetric file, i.e. *CIE xyY* colourspace array :math:`xyY_c`.
the colorimetric file, i.e., *CIE xyY* colourspace array :math:`xyY_c`.
Y_b
Relative luminance of background :math:`Y_b` in :math:`cd/m^2`.
Y_r
Expand Down Expand Up @@ -144,7 +144,7 @@ class DatasetLoader_Luo1997(AbstractDatasetLoader):
"""

ID: str = "4394536"
"""Dataset record id, i.e. the *Zenodo* record number."""
"""Dataset record id, i.e., the *Zenodo* record number."""

def __init__(self) -> None:
super().__init__(datasets()[DatasetLoader_Luo1997.ID])
Expand Down
Loading

0 comments on commit 3608b43

Please sign in to comment.