From dbfbac3b317352a8e3768fd915f9b9db83c3c4f1 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 4 Dec 2022 14:00:23 +1300 Subject: [PATCH 01/30] Update "continuous-integration-documentation.yml" file. --- .github/workflows/continuous-integration-documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration-documentation.yml b/.github/workflows/continuous-integration-documentation.yml index 8b36d5f..b8022b8 100644 --- a/.github/workflows/continuous-integration-documentation.yml +++ b/.github/workflows/continuous-integration-documentation.yml @@ -16,7 +16,7 @@ jobs: - name: Environment Variables run: | echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV - echo "CI_PACKAGE=colour" >> $GITHUB_ENV + echo "CI_PACKAGE=colour_demosaicing" >> $GITHUB_ENV echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV echo "MPLBACKEND=AGG" >> $GITHUB_ENV echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV From a57edf13acec2ae009e669be814b25159fb0164d Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 13 Jan 2023 07:11:52 +1300 Subject: [PATCH 02/30] Update "pyproject.toml" file. --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1f139bb..826b582 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,6 +121,7 @@ development = [ "pydocstyle", "pytest", "pytest-cov", + "pytest-xdist", "pyupgrade", "restructuredtext-lint", "sphinx", From a168e16b5c8cd7a0bbb76046311aab4c1f2ecb3f Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Mon, 23 Jan 2023 21:29:31 +1300 Subject: [PATCH 03/30] Update "Github Actions" badge. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1effd02..6910c2e 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ Colour - Demosaicing |actions| |coveralls| |codacy| |version| -.. |actions| image:: https://img.shields.io/github/workflow/status/colour-science/colour-demosaicing/Continuous%20Integration%20-%20Quality%20&%20Unit%20Tests?label=actions&logo=github&style=flat-square +.. |actions| image:: https://img.shields.io/github/actions/workflow/status/colour-science/colour-demosaicing/.github/workflows/continuous-integration-quality-unit-tests.yml?branch=develop&style=flat-square :target: https://github.com/colour-science/colour-demosaicing/actions :alt: Develop Build Status .. |coveralls| image:: http://img.shields.io/coveralls/colour-science/colour-demosaicing/develop.svg?style=flat-square From efd9eeb85db439b72c043c7c9f0175e8bf56485a Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 11 Dec 2022 16:09:00 +1300 Subject: [PATCH 04/30] Replace "Mypy" with "Pyright". --- .github/PULL_REQUEST_TEMPLATE.md | 4 +- ...nuous-integration-static-type-checking.yml | 2 +- .gitignore | 2 - colour_demosaicing/__init__.py | 4 +- .../bayer/demosaicing/bilinear.py | 4 +- .../bayer/demosaicing/malvar2004.py | 4 +- .../bayer/demosaicing/menon2007.py | 17 ++++-- docs/conf.py | 29 ++++------ pyproject.toml | 22 ++++--- requirements.txt | 54 +++++++++++------- tasks.py | 57 +++++++------------ 11 files changed, 96 insertions(+), 103 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f04c387..32e3642 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,11 +15,11 @@ is available to guide the process: https://www.colour-science.org/contributing/. **Code Style and Quality** - [ ] Unit tests have been implemented and passed. -- [ ] Mypy static checking has been run and passed. +- [ ] Pyright static checking has been run and passed. - [ ] Pre-commit hooks have been run and passed. - + **Documentation** diff --git a/.github/workflows/continuous-integration-static-type-checking.yml b/.github/workflows/continuous-integration-static-type-checking.yml index 66f4fd8..88ec0fd 100644 --- a/.github/workflows/continuous-integration-static-type-checking.yml +++ b/.github/workflows/continuous-integration-static-type-checking.yml @@ -26,4 +26,4 @@ jobs: pip install -r requirements.txt - name: Static Type Checking run: | - mypy --install-types --non-interactive --show-error-codes --warn-unused-ignores --warn-redundant-casts $CI_PACKAGE + pyright --skipunannotated diff --git a/.gitignore b/.gitignore index a0529fb..ece08fe 100644 --- a/.gitignore +++ b/.gitignore @@ -3,11 +3,9 @@ *.pyo .DS_Store .coverage -.dmypy.json .fleet .idea .ipynb_checkpoints -.mypy_cache .sandbox .vs .vscode diff --git a/colour_demosaicing/__init__.py b/colour_demosaicing/__init__.py index 6429d9c..969d560 100644 --- a/colour_demosaicing/__init__.py +++ b/colour_demosaicing/__init__.py @@ -70,9 +70,9 @@ .decode("utf-8") ) except Exception: - _version: str = __version__ # type: ignore[no-redef] + _version: str = __version__ -colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[ +colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[ # pyright: ignore "colour-demosaicing" ] = _version diff --git a/colour_demosaicing/bayer/demosaicing/bilinear.py b/colour_demosaicing/bayer/demosaicing/bilinear.py index 3e5ea3c..bb38907 100644 --- a/colour_demosaicing/bayer/demosaicing/bilinear.py +++ b/colour_demosaicing/bayer/demosaicing/bilinear.py @@ -15,7 +15,7 @@ from scipy.ndimage.filters import convolve -from colour.hints import ArrayLike, Literal, NDArray, Union +from colour.hints import ArrayLike, Literal, NDArrayFloat, Union from colour.utilities import as_float_array, tstack from colour_demosaicing.bayer import masks_CFA_Bayer @@ -35,7 +35,7 @@ def demosaicing_CFA_Bayer_bilinear( CFA: ArrayLike, pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", -) -> NDArray: +) -> NDArrayFloat: """ Return the demosaiced *RGB* colourspace array from given *Bayer* CFA using bilinear interpolation. diff --git a/colour_demosaicing/bayer/demosaicing/malvar2004.py b/colour_demosaicing/bayer/demosaicing/malvar2004.py index 2a367a5..7c2d423 100644 --- a/colour_demosaicing/bayer/demosaicing/malvar2004.py +++ b/colour_demosaicing/bayer/demosaicing/malvar2004.py @@ -18,7 +18,7 @@ import numpy as np from scipy.ndimage.filters import convolve -from colour.hints import ArrayLike, Literal, NDArray, Union +from colour.hints import ArrayLike, Literal, NDArrayFloat, Union from colour.utilities import as_float_array, ones, tstack from colour_demosaicing.bayer import masks_CFA_Bayer @@ -38,7 +38,7 @@ def demosaicing_CFA_Bayer_Malvar2004( CFA: ArrayLike, pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", -) -> NDArray: +) -> NDArrayFloat: """ Return the demosaiced *RGB* colourspace array from given *Bayer* CFA using *Malvar (2004)* demosaicing algorithm. diff --git a/colour_demosaicing/bayer/demosaicing/menon2007.py b/colour_demosaicing/bayer/demosaicing/menon2007.py index 0f837f8..2f5856e 100644 --- a/colour_demosaicing/bayer/demosaicing/menon2007.py +++ b/colour_demosaicing/bayer/demosaicing/menon2007.py @@ -17,7 +17,7 @@ import numpy as np from scipy.ndimage.filters import convolve, convolve1d -from colour.hints import ArrayLike, Boolean, Literal, NDArray, Union +from colour.hints import ArrayLike, Literal, NDArrayFloat, Union from colour.utilities import as_float_array, ones, tsplit, tstack from colour_demosaicing.bayer import masks_CFA_Bayer @@ -36,13 +36,13 @@ ] -def _cnv_h(x: ArrayLike, y: ArrayLike) -> NDArray: +def _cnv_h(x: ArrayLike, y: ArrayLike) -> NDArrayFloat: """Perform horizontal convolution.""" return convolve1d(x, y, mode="mirror") -def _cnv_v(x: ArrayLike, y: ArrayLike) -> NDArray: +def _cnv_v(x: ArrayLike, y: ArrayLike) -> NDArrayFloat: """Perform vertical convolution.""" return convolve1d(x, y, mode="mirror", axis=0) @@ -51,7 +51,7 @@ def _cnv_v(x: ArrayLike, y: ArrayLike) -> NDArray: def demosaicing_CFA_Bayer_Menon2007( CFA: ArrayLike, pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", - refining_step: Boolean = True, + refining_step: bool = True, ): """ Return the demosaiced *RGB* colourspace array from given *Bayer* CFA using @@ -140,7 +140,12 @@ def demosaicing_CFA_Bayer_Menon2007( C_V = np.where(B_m == 1, B - G_V, C_V) D_H = np.abs(C_H - np.pad(C_H, ((0, 0), (0, 2)), mode="reflect")[:, 2:]) - D_V = np.abs(C_V - np.pad(C_V, ((0, 2), (0, 0)), mode="reflect")[2:, :]) + D_V = np.abs( + C_V + - np.pad(C_V, ((0, 2), (0, 0)), mode="reflect")[ # pyright: ignore + 2:, : + ] + ) del h_0, h_1, CFA, C_V, C_H @@ -233,7 +238,7 @@ def demosaicing_CFA_Bayer_Menon2007( def refining_step_Menon2007( RGB: ArrayLike, RGB_m: ArrayLike, M: ArrayLike -) -> NDArray: +) -> NDArrayFloat: """ Perform the refining step on given *RGB* colourspace array. diff --git a/docs/conf.py b/docs/conf.py index 4d0fb35..1868380 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -43,27 +43,20 @@ autodoc_typehints = "both" autodoc_type_aliases = { "ArrayLike": "ArrayLike", - "Boolean": "Boolean", - "BooleanOrArrayLike": "BooleanOrArrayLike", - "BooleanOrNDArray": "BooleanOrNDArray", "DType": "DType", "DTypeBoolean": "DTypeBoolean", "DTypeComplex": "DTypeComplex", - "DTypeFloating": "DTypeFloating", - "DTypeInteger": "DTypeInteger", - "DTypeNumber": "DTypeNumber", - "Floating": "Floating", - "FloatingOrArrayLike": "FloatingOrArrayLike", - "FloatingOrNDArray": "FloatingOrNDArray", - "Integer": "Integer", - "IntegerOrArrayLike": "IntegerOrArrayLike", - "IntegerOrNDArray": "IntegerOrNDArray", - "NestedSequence": "NestedSequence", - "Number": "Number", - "NumberOrArrayLike": "NumberOrArrayLike", - "NumberOrNDArray": "NumberOrNDArray", - "StrOrArrayLike": "StrOrArrayLike", - "StrOrNDArray": "StrOrNDArray", + "DTypeFloat": "DTypeFloat", + "DTypeInt": "DTypeInt", + "DTypeReal": "DTypeReal", + "Dataclass": "Dataclass", + "NDArrayBoolean": "NDArrayBoolean", + "NDArrayComplex": "NDArrayComplex", + "NDArrayFloat": "NDArrayFloat", + "NDArrayInt": "NDArrayInt", + "NDArrayReal": "NDArrayReal", + "NDArrayStr": "NDArrayStr", + "Real": "Real", } autodoc_preserve_defaults = True diff --git a/pyproject.toml b/pyproject.toml index 826b582..8ea9e89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ colour-science = ">= 0.4.2" imageio = ">= 2, < 3" numpy = ">= 1.20, < 2" scipy = ">= 1.7, < 2" -typing-extensions = ">= 4, < 5" # Convenience for Google Colab. +typing-extensions = ">= 4, < 5" matplotlib = { version = ">= 3.5, != 3.5.0, != 3.5.1", optional = true } @@ -66,10 +66,10 @@ flake8 = { version = "*", optional = true } # Development dependency. flynt = { version = "*", optional = true } # Development dependency. invoke = { version = "*", optional = true } # Development dependency. jupyter = { version = "*", optional = true } # Development dependency. -mypy = { version = "*", optional = true } # Development dependency. pre-commit = { version = "*", optional = true } # Development dependency. pydata-sphinx-theme = { version = "*", optional = true } # Development dependency. pydocstyle = { version = "*", optional = true } # Development dependency. +pyright = { version = "*", optional = true } # Development dependency. pytest = { version = "*", optional = true } # Development dependency. pytest-cov = { version = "*", optional = true } # Development dependency. pytest-xdist = { version = "*", optional = true} #Development dependency @@ -90,10 +90,10 @@ flake8 = "*" flynt = "*" invoke = "*" jupyter = "*" -mypy = "*" pre-commit = "*" pydata-sphinx-theme = "*" pydocstyle = "*" +pyright = "*" pytest = "*" pytest-cov = "*" pytest-xdist = "*" @@ -115,10 +115,10 @@ development = [ "flynt", "invoke", "jupyter", - "mypy", "pre-commit", "pydata-sphinx-theme", "pydocstyle", + "pyright", "pytest", "pytest-cov", "pytest-xdist", @@ -137,7 +137,6 @@ line-length = 79 exclude = ''' /( \.git - | \.mypy_cache | build | dist )/ @@ -146,14 +145,19 @@ exclude = ''' [tool.flynt] line_length=999 -[tool.mypy] -plugins = "numpy.typing.mypy_plugin" -ignore_missing_imports = true - [tool.pydocstyle] convention = "numpy" add-ignore = "D104,D200,D202,D205,D301,D400" +[tool.pyright] +reportMissingImports = false +reportMissingModuleSource = false +reportUnboundVariable = false +reportUnnecessaryCast = true +reportUnnecessaryTypeIgnoreComment = true +reportUnsupportedDunderAll = false +reportUnusedExpression = false + [tool.pytest.ini_options] addopts = "-n auto --dist=loadscope --durations=5" diff --git a/requirements.txt b/requirements.txt index 3955033..870f442 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,22 +3,24 @@ anyio==3.6.2 appnope==0.1.3 argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 +arrow==1.2.3 astor==0.8.1 -asttokens==2.2.0 +asttokens==2.2.1 attrs==22.1.0 Babel==2.11.0 backcall==0.2.0 beautifulsoup4==4.11.1 biblib-simple==0.1.2 -black==22.10.0 +black==22.12.0 blackdoc==0.3.8 bleach==5.0.1 -certifi==2022.9.24 +certifi==2022.12.7 cffi==1.15.1 cfgv==3.3.1 charset-normalizer==2.1.1 click==8.1.3 colour-science==0.4.2 +comm==0.1.2 commonmark==0.9.1 contourpy==1.0.6 coverage==6.5.0 @@ -34,10 +36,11 @@ entrypoints==0.4 execnet==1.9.0 executing==1.2.0 fastjsonschema==2.16.2 -filelock==3.8.0 +filelock==3.8.2 flake8==6.0.0 flynt==0.77 fonttools==4.38.0 +fqdn==1.5.1 identify==2.5.9 idna==3.4 imageio==2.22.4 @@ -45,21 +48,25 @@ imagesize==1.4.1 importlib-metadata==5.1.0 iniconfig==1.1.1 invoke==1.7.3 -ipykernel==6.17.1 +ipykernel==6.19.2 ipython==8.7.0 ipython-genutils==0.2.0 -ipywidgets==8.0.2 +ipywidgets==8.0.3 +isoduration==20.11.0 jaraco.classes==3.2.3 jedi==0.18.2 Jinja2==3.1.2 +jsonpointer==2.3 jsonschema==4.17.3 jupyter==1.0.0 -jupyter_client==7.4.7 +jupyter_client==7.4.8 jupyter-console==6.4.4 jupyter_core==5.1.0 -jupyter-server==1.23.3 +jupyter-events==0.5.0 +jupyter_server==2.0.1 +jupyter_server_terminals==0.4.2 jupyterlab-pygments==0.2.2 -jupyterlab-widgets==3.0.3 +jupyterlab-widgets==3.0.4 keyring==23.11.0 kiwisolver==1.4.4 latexcodec==2.0.1 @@ -69,31 +76,30 @@ matplotlib-inline==0.1.6 mccabe==0.7.0 mistune==2.0.4 more-itertools==9.0.0 -mypy==0.991 mypy-extensions==0.4.3 nbclassic==0.4.8 nbclient==0.7.2 -nbconvert==7.2.5 +nbconvert==7.2.6 nbformat==5.7.0 nest-asyncio==1.5.6 nodeenv==1.7.0 notebook==6.5.2 notebook_shim==0.2.2 numpy==1.23.5 -packaging==21.3 +packaging==22.0 pandocfilters==1.5.0 parso==0.8.3 -pathspec==0.10.2 +pathspec==0.10.3 pexpect==4.8.0 pickleshare==0.7.5 Pillow==9.3.0 pip==22.3.1 pkginfo==1.9.2 -platformdirs==2.5.4 +platformdirs==2.6.0 pluggy==1.0.0 pre-commit==2.20.0 prometheus-client==0.15.0 -prompt-toolkit==3.0.33 +prompt-toolkit==3.0.36 psutil==5.9.4 ptyprocess==0.7.0 pure-eval==0.2.2 @@ -106,13 +112,15 @@ pydocstyle==6.1.1 pyflakes==3.0.1 Pygments==2.13.0 pyparsing==3.0.9 +pyright==1.1.283 pyrsistent==0.19.2 pytest==7.2.0 pytest-cov==4.0.0 -pytest-xdist==3.0.2 +pytest-xdist==3.1.0 python-dateutil==2.8.2 +python-json-logger==2.0.4 pytz==2022.6 -pyupgrade==3.2.3 +pyupgrade==3.3.1 PyYAML==6.0 pyzmq==24.0.1 qtconsole==5.4.0 @@ -121,7 +129,9 @@ readme-renderer==37.3 requests==2.28.1 requests-toolbelt==0.10.1 restructuredtext-lint==1.4.0 +rfc3339-validator==0.1.4 rfc3986==2.0.0 +rfc3986-validator==0.1.1 rich==12.6.0 scipy==1.9.3 Send2Trash==1.8.0 @@ -140,21 +150,23 @@ sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 stack-data==0.6.2 -terminado==0.17.0 +terminado==0.17.1 tinycss2==1.2.1 tokenize-rt==5.0.0 toml==0.10.2 tomli==2.0.1 tornado==6.2 -traitlets==5.6.0 +traitlets==5.7.0 twine==4.0.2 types-setuptools==65.6.0.1 typing_extensions==4.4.0 +uri-template==1.2.0 urllib3==1.26.13 -virtualenv==20.17.0 +virtualenv==20.17.1 wcwidth==0.2.5 +webcolors==1.12 webencodings==0.5.1 websocket-client==1.4.2 wheel==0.38.4 -widgetsnbextension==4.0.3 +widgetsnbextension==4.0.4 zipp==3.11.0 diff --git a/tasks.py b/tasks.py index 3663f54..a2eeeda 100644 --- a/tasks.py +++ b/tasks.py @@ -11,15 +11,13 @@ import re import uuid -from colour.hints import Boolean - import colour_demosaicing from colour.utilities import message_box import inspect if not hasattr(inspect, "getargspec"): - inspect.getargspec = inspect.getfullargspec + inspect.getargspec = inspect.getfullargspec # pyright: ignore from invoke import Context, task @@ -69,10 +67,9 @@ @task def clean( ctx: Context, - docs: Boolean = True, - bytecode: Boolean = False, - mypy: Boolean = True, - pytest: Boolean = True, + docs: bool = True, + bytecode: bool = False, + pytest: bool = True, ): """ Clean the project. @@ -85,8 +82,6 @@ def clean( Whether to clean the *docs* directory. bytecode Whether to clean the bytecode files, e.g. *.pyc* files. - mypy - Whether to clean the *Mypy* cache directory. pytest Whether to clean the *Pytest* cache directory. """ @@ -103,9 +98,6 @@ def clean( patterns.append("**/__pycache__") patterns.append("**/*.pyc") - if mypy: - patterns.append(".mypy_cache") - if pytest: patterns.append(".pytest_cache") @@ -116,8 +108,8 @@ def clean( @task def formatting( ctx: Context, - asciify: Boolean = True, - bibtex: Boolean = True, + asciify: bool = True, + bibtex: bool = True, ): """ Convert unicode characters to ASCII and cleanup the *BibTeX* file. @@ -163,37 +155,26 @@ def formatting( @task def quality( ctx: Context, - mypy: Boolean = True, - rstlint: Boolean = True, + pyright: bool = True, + rstlint: bool = True, ): """ - Check the codebase with *Mypy* and lints various *restructuredText* + Check the codebase with *Pyright* and lints various *restructuredText* files with *rst-lint*. Parameters ---------- ctx Context. - flake8 - Whether to check the codebase with *Flake8*. - mypy - Whether to check the codebase with *Mypy*. + pyright + Whether to check the codebase with *Pyright*. rstlint Whether to lint various *restructuredText* files with *rst-lint*. """ - if mypy: - message_box('Checking codebase with "Mypy"...') - ctx.run( - f"mypy " - f"--install-types " - f"--non-interactive " - f"--show-error-codes " - f"--warn-unused-ignores " - f"--warn-redundant-casts " - f"{PYTHON_PACKAGE_NAME} " - f"|| true" - ) + if pyright: + message_box('Checking codebase with "Pyright"...') + ctx.run("pyright --skipunannotated") if rstlint: message_box('Linting "README.rst" file...') @@ -272,7 +253,7 @@ def preflight(ctx: Context): @task -def docs(ctx: Context, html: Boolean = True, pdf: Boolean = True): +def docs(ctx: Context, html: bool = True, pdf: bool = True): """ Build the documentation. @@ -408,7 +389,7 @@ def sub_callable(match): @task -def virtualise(ctx: Context, tests: Boolean = True): +def virtualise(ctx: Context, tests: bool = True): """ Create a virtual environment for the project build. @@ -470,17 +451,17 @@ def tag(ctx: Context): file_content = file_handle.read() major_version = re.search( '__major_version__\\s+=\\s+"(.*)"', file_content - ).group( # type: ignore[union-attr] + ).group( # pyright: ignore 1 ) minor_version = re.search( '__minor_version__\\s+=\\s+"(.*)"', file_content - ).group( # type: ignore[union-attr] + ).group( # pyright: ignore 1 ) change_version = re.search( '__change_version__\\s+=\\s+"(.*)"', file_content - ).group( # type: ignore[union-attr] + ).group( # pyright: ignore 1 ) From 0243d138a736ec4a92f321e8fb91cca7ea5d4ffb Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Wed, 1 Feb 2023 21:11:46 +1300 Subject: [PATCH 05/30] Update "tasks.py" file. --- tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index a2eeeda..6099250 100644 --- a/tasks.py +++ b/tasks.py @@ -174,7 +174,7 @@ def quality( if pyright: message_box('Checking codebase with "Pyright"...') - ctx.run("pyright --skipunannotated") + ctx.run("pyright --skipunannotated --level warning") if rstlint: message_box('Linting "README.rst" file...') From 2942e6ab22a14d0651ed60f3cc86814d03977e7b Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Thu, 2 Feb 2023 21:46:36 +1300 Subject: [PATCH 06/30] Implement support for "Ruff". --- .flake8 | 3 - .pre-commit-config.yaml | 20 +--- colour_demosaicing/__init__.py | 5 +- colour_demosaicing/bayer/__init__.py | 2 +- .../bayer/demosaicing/bilinear.py | 4 +- .../bayer/demosaicing/malvar2004.py | 4 +- .../bayer/demosaicing/menon2007.py | 4 +- colour_demosaicing/bayer/masks.py | 6 +- colour_demosaicing/bayer/mosaicing.py | 4 +- docs/conf.py | 6 +- pyproject.toml | 105 +++++++++++++++--- tasks.py | 40 +++---- utilities/export_todo.py | 6 +- 13 files changed, 137 insertions(+), 72 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 8dd399a..0000000 --- a/.flake8 +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -max-line-length = 88 -extend-ignore = E203 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3743cf6..3345920 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,12 @@ repos: -- repo: https://github.com/asottile/pyupgrade - rev: v3.2.2 - hooks: - - id: pyupgrade - args: [--py39-plus] - repo: https://github.com/ikamensh/flynt/ rev: '0.77' hooks: - id: flynt +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.0.239' + hooks: + - id: ruff - repo: https://github.com/psf/black rev: 22.10.0 hooks: @@ -18,14 +17,3 @@ repos: hooks: - id: blackdoc language_version: python3.9 -- repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 - hooks: - - id: flake8 -- repo: https://github.com/pycqa/pydocstyle - rev: 6.1.1 - hooks: - - id: pydocstyle - args: - - --convention=numpy - - --add-ignore=D104,D200,D202,D205,D301,D400 diff --git a/colour_demosaicing/__init__.py b/colour_demosaicing/__init__.py index 969d560..dd82e6d 100644 --- a/colour_demosaicing/__init__.py +++ b/colour_demosaicing/__init__.py @@ -11,6 +11,7 @@ from __future__ import annotations +import contextlib import numpy as np import os import subprocess # nosec @@ -79,7 +80,5 @@ del _version # TODO: Remove legacy printing support when deemed appropriate. -try: +with contextlib.suppress(TypeError): np.set_printoptions(legacy="1.13") -except TypeError: - pass diff --git a/colour_demosaicing/bayer/__init__.py b/colour_demosaicing/bayer/__init__.py index c655646..8ca8b75 100644 --- a/colour_demosaicing/bayer/__init__.py +++ b/colour_demosaicing/bayer/__init__.py @@ -1,6 +1,6 @@ from .masks import masks_CFA_Bayer from .mosaicing import mosaicing_CFA_Bayer -from .demosaicing import * # noqa +from .demosaicing import * # noqa: F403 from . import demosaicing __all__ = [] diff --git a/colour_demosaicing/bayer/demosaicing/bilinear.py b/colour_demosaicing/bayer/demosaicing/bilinear.py index bb38907..fb452ac 100644 --- a/colour_demosaicing/bayer/demosaicing/bilinear.py +++ b/colour_demosaicing/bayer/demosaicing/bilinear.py @@ -15,7 +15,7 @@ from scipy.ndimage.filters import convolve -from colour.hints import ArrayLike, Literal, NDArrayFloat, Union +from colour.hints import ArrayLike, Literal, NDArrayFloat from colour.utilities import as_float_array, tstack from colour_demosaicing.bayer import masks_CFA_Bayer @@ -34,7 +34,7 @@ def demosaicing_CFA_Bayer_bilinear( CFA: ArrayLike, - pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", + pattern: Literal["RGGB", "BGGR", "GRBG", "GBRG"] | str = "RGGB", ) -> NDArrayFloat: """ Return the demosaiced *RGB* colourspace array from given *Bayer* CFA using diff --git a/colour_demosaicing/bayer/demosaicing/malvar2004.py b/colour_demosaicing/bayer/demosaicing/malvar2004.py index 7c2d423..ed507ab 100644 --- a/colour_demosaicing/bayer/demosaicing/malvar2004.py +++ b/colour_demosaicing/bayer/demosaicing/malvar2004.py @@ -18,7 +18,7 @@ import numpy as np from scipy.ndimage.filters import convolve -from colour.hints import ArrayLike, Literal, NDArrayFloat, Union +from colour.hints import ArrayLike, Literal, NDArrayFloat from colour.utilities import as_float_array, ones, tstack from colour_demosaicing.bayer import masks_CFA_Bayer @@ -37,7 +37,7 @@ def demosaicing_CFA_Bayer_Malvar2004( CFA: ArrayLike, - pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", + pattern: Literal["RGGB", "BGGR", "GRBG", "GBRG"] | str = "RGGB", ) -> NDArrayFloat: """ Return the demosaiced *RGB* colourspace array from given *Bayer* CFA using diff --git a/colour_demosaicing/bayer/demosaicing/menon2007.py b/colour_demosaicing/bayer/demosaicing/menon2007.py index 2f5856e..ca5357c 100644 --- a/colour_demosaicing/bayer/demosaicing/menon2007.py +++ b/colour_demosaicing/bayer/demosaicing/menon2007.py @@ -17,7 +17,7 @@ import numpy as np from scipy.ndimage.filters import convolve, convolve1d -from colour.hints import ArrayLike, Literal, NDArrayFloat, Union +from colour.hints import ArrayLike, Literal, NDArrayFloat from colour.utilities import as_float_array, ones, tsplit, tstack from colour_demosaicing.bayer import masks_CFA_Bayer @@ -50,7 +50,7 @@ def _cnv_v(x: ArrayLike, y: ArrayLike) -> NDArrayFloat: def demosaicing_CFA_Bayer_Menon2007( CFA: ArrayLike, - pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", + pattern: Literal["RGGB", "BGGR", "GRBG", "GBRG"] | str = "RGGB", refining_step: bool = True, ): """ diff --git a/colour_demosaicing/bayer/masks.py b/colour_demosaicing/bayer/masks.py index 1bfb680..10db1e1 100644 --- a/colour_demosaicing/bayer/masks.py +++ b/colour_demosaicing/bayer/masks.py @@ -9,7 +9,7 @@ import numpy as np -from colour.hints import Literal, NDArray, Tuple, Union +from colour.hints import Literal, NDArray, Tuple from colour.utilities import validate_method __author__ = "Colour Developers" @@ -25,8 +25,8 @@ def masks_CFA_Bayer( - shape: Union[int, Tuple[int, ...]], - pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", + shape: int | Tuple[int, ...], + pattern: Literal["RGGB", "BGGR", "GRBG", "GBRG"] | str = "RGGB", ) -> Tuple[NDArray, ...]: """ Return the *Bayer* CFA red, green and blue masks for given pattern. diff --git a/colour_demosaicing/bayer/mosaicing.py b/colour_demosaicing/bayer/mosaicing.py index a03cbc4..333537d 100644 --- a/colour_demosaicing/bayer/mosaicing.py +++ b/colour_demosaicing/bayer/mosaicing.py @@ -7,7 +7,7 @@ from __future__ import annotations -from colour.hints import ArrayLike, Literal, NDArray, Union +from colour.hints import ArrayLike, Literal, NDArray from colour.utilities import as_float_array, tsplit from colour_demosaicing.bayer import masks_CFA_Bayer @@ -26,7 +26,7 @@ def mosaicing_CFA_Bayer( RGB: ArrayLike, - pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", + pattern: Literal["RGGB", "BGGR", "GRBG", "GBRG"] | str = "RGGB", ) -> NDArray: """ Return the *Bayer* CFA mosaic for a given *RGB* colourspace array. diff --git a/docs/conf.py b/docs/conf.py index 1868380..2cfa06c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -74,7 +74,7 @@ master_doc = "index" project = package.__application_name__ -copyright = package.__copyright__.replace("Copyright (C)", "") +copyright = package.__copyright__.replace("Copyright (C)", "") # noqa: A001 version = f"{package.__major_version__}.{package.__minor_version__}" release = package.__version__ @@ -185,7 +185,9 @@ epub_exclude_files = ["search.html"] -def autodoc_process_docstring(app, what, name, obj, options, lines): +def autodoc_process_docstring( + app, what, name, obj, options, lines # noqa: ARG001 +): """Process the docstrings to remove the *# noqa* *flake8* pragma.""" for i, line in enumerate(lines): diff --git a/pyproject.toml b/pyproject.toml index 8ea9e89..1d48615 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,19 +62,17 @@ black = { version = "*", optional = true } # Development dependency. blackdoc = { version = "*", optional = true } # Development dependency. coverage = { version = "!= 6.3", optional = true } # Development dependency. coveralls = { version = "*", optional = true } # Development dependency. -flake8 = { version = "*", optional = true } # Development dependency. flynt = { version = "*", optional = true } # Development dependency. invoke = { version = "*", optional = true } # Development dependency. jupyter = { version = "*", optional = true } # Development dependency. pre-commit = { version = "*", optional = true } # Development dependency. pydata-sphinx-theme = { version = "*", optional = true } # Development dependency. -pydocstyle = { version = "*", optional = true } # Development dependency. pyright = { version = "*", optional = true } # Development dependency. pytest = { version = "*", optional = true } # Development dependency. pytest-cov = { version = "*", optional = true } # Development dependency. pytest-xdist = { version = "*", optional = true} #Development dependency -pyupgrade = { version = "*", optional = true } # Development dependency. restructuredtext-lint = { version = "*", optional = true } # Development dependency. +ruff = { version = "*", optional = true } # Development dependency. sphinx = { version = ">= 4, < 5", optional = true } # Development dependency. sphinxcontrib-bibtex = { version = "*", optional = true } # Development dependency. toml = { version = "*", optional = true } # Development dependency. @@ -86,19 +84,17 @@ black = "*" blackdoc = "*" coverage = "!= 6.3" coveralls = "*" -flake8 = "*" flynt = "*" invoke = "*" jupyter = "*" pre-commit = "*" pydata-sphinx-theme = "*" -pydocstyle = "*" pyright = "*" pytest = "*" pytest-cov = "*" pytest-xdist = "*" -pyupgrade = "*" restructuredtext-lint = "*" +ruff = "*" sphinx = ">= 4, < 5" sphinxcontrib-bibtex = "*" toml = "*" @@ -111,19 +107,17 @@ development = [ "blackdoc", "coverage", "coveralls", - "flake8", "flynt", "invoke", "jupyter", "pre-commit", "pydata-sphinx-theme", - "pydocstyle", "pyright", "pytest", "pytest-cov", "pytest-xdist", - "pyupgrade", "restructuredtext-lint", + "ruff", "sphinx", "sphinxcontrib-bibtex", "toml", @@ -145,10 +139,6 @@ exclude = ''' [tool.flynt] line_length=999 -[tool.pydocstyle] -convention = "numpy" -add-ignore = "D104,D200,D202,D205,D301,D400" - [tool.pyright] reportMissingImports = false reportMissingModuleSource = false @@ -161,6 +151,95 @@ reportUnusedExpression = false [tool.pytest.ini_options] addopts = "-n auto --dist=loadscope --durations=5" +[tool.ruff] +target-version = "py39" +line-length = 88 +select = [ + "A", # flake8-builtins + "ARG", # flake8-unused-arguments + # "ANN", # flake8-annotations + "B", # flake8-bugbear + # "BLE", # flake8-blind-except + "C4", # flake8-comprehensions + # "C90", # mccabe + # "COM", # flake8-commas + "DTZ", # flake8-datetimez + "D", # pydocstyle + "E", # pydocstyle + # "ERA", # eradicate + # "EM", # flake8-errmsg + "EXE", # flake8-executable + "F", # flake8 + # "FBT", # flake8-boolean-trap + "G", # flake8-logging-format + "I", # isort + "ICN", # flake8-import-conventions + "INP", # flake8-no-pep420 + "ISC", # flake8-implicit-str-concat + "N", # pep8-naming + # "PD", # pandas-vet + "PIE", # flake8-pie + "PGH", # pygrep-hooks + "PL", # pylint + # "PT", # flake8-pytest-style + # "PTH", # flake8-use-pathlib [Enable] + "Q", # flake8-quotes + "RET", # flake8-return + "RUF", # Ruff + "S", # flake8-bandit + "SIM", # flake8-simplify + "T10", # flake8-debugger + "T20", # flake8-print + # "TCH", # flake8-type-checking + "TID", # flake8-tidy-imports + "TRY", # tryceratops + "UP", # pyupgrade + "W", # pydocstyle + "YTT" # flake8-2020 +] +ignore = [ + "B008", + "B905", + "D104", + "D200", + "D202", + "D205", + "D301", + "D400", + "I001", + "N801", + "N802", + "N803", + "N806", + "N813", + "N815", + "N816", + "PIE804", + "PLE0605", + "PLR0913", + "PLR2004", + "RET504", + "RET505", + "RET506", + "RET507", + "RET508", + "TRY003", + "TRY300", +] +typing-modules = ["colour.hints"] +fixable = ["B", "C", "E", "F", "PIE", "RUF", "SIM", "UP", "W"] + +[tool.ruff.pydocstyle] +convention = "numpy" + +[tool.ruff.per-file-ignores] +"colour_demosaicing/examples/*" = ["INP", "T201", "T203"] +"docs/*" = ["INP"] +"setup.py" = ["INP"] +"tasks.py" = ["INP"] +"utilities/*" = ["EXE001", "INP"] +"utilities/unicode_to_ascii.py" = ["RUF001"] + [build-system] requires = [ "poetry_core>=1.0.0" ] build-backend = "poetry.core.masonry.api" diff --git a/tasks.py b/tasks.py index 6099250..fe47dac 100644 --- a/tasks.py +++ b/tasks.py @@ -6,6 +6,7 @@ from __future__ import annotations import biblib.bib +import contextlib import fnmatch import os import re @@ -138,10 +139,8 @@ def formatting( ) for entry in sorted(entries.values(), key=lambda x: x.key): - try: + with contextlib.suppress(KeyError): del entry["file"] - except KeyError: - pass for key, value in entry.items(): entry[key] = re.sub("(?`__ | This software is released under terms of New BSD License: \ https://opensource.org/licenses/BSD-3-Clause @@ -108,9 +108,9 @@ def export_todo_items(todo_items: dict, file_path: str): """ todo_rst = [] - for module, todo_items in todo_items.items(): + for module, module_todo_items in todo_items.items(): todo_rst.append(f"- {module}\n") - for line_numer, todo_item in todo_items: + for line_numer, todo_item in module_todo_items: todo_rst.append(f" - Line {line_numer} : {todo_item}") todo_rst.append("\n") From 1b6e8ac600e629eb8f6fd0f50a36325b2ecaa5a7 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Thu, 2 Feb 2023 22:08:26 +1300 Subject: [PATCH 07/30] Update "requirements.txt" file. --- requirements.txt | 118 ++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 62 deletions(-) diff --git a/requirements.txt b/requirements.txt index 870f442..109a4fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -alabaster==0.7.12 +alabaster==0.7.13 anyio==3.6.2 appnope==0.1.3 argon2-cffi==21.3.0 @@ -6,52 +6,49 @@ argon2-cffi-bindings==21.2.0 arrow==1.2.3 astor==0.8.1 asttokens==2.2.1 -attrs==22.1.0 +attrs==22.2.0 Babel==2.11.0 backcall==0.2.0 -beautifulsoup4==4.11.1 +beautifulsoup4==4.11.2 biblib-simple==0.1.2 -black==22.12.0 +black==23.1.0 blackdoc==0.3.8 -bleach==5.0.1 +bleach==6.0.0 certifi==2022.12.7 cffi==1.15.1 cfgv==3.3.1 -charset-normalizer==2.1.1 +charset-normalizer==3.0.1 click==8.1.3 colour-science==0.4.2 comm==0.1.2 -commonmark==0.9.1 contourpy==1.0.6 coverage==6.5.0 coveralls==3.3.1 cycler==0.11.0 -debugpy==1.6.4 +debugpy==1.6.6 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.6 docopt==0.6.2 docutils==0.17.1 -entrypoints==0.4 execnet==1.9.0 executing==1.2.0 fastjsonschema==2.16.2 -filelock==3.8.2 -flake8==6.0.0 +filelock==3.9.0 flynt==0.77 fonttools==4.38.0 fqdn==1.5.1 -identify==2.5.9 +identify==2.5.17 idna==3.4 -imageio==2.22.4 +imageio==2.25.0 imagesize==1.4.1 -importlib-metadata==5.1.0 -iniconfig==1.1.1 -invoke==1.7.3 -ipykernel==6.19.2 -ipython==8.7.0 +importlib-metadata==6.0.0 +iniconfig==2.0.0 +invoke==2.0.0 +ipykernel==6.20.2 +ipython==8.9.0 ipython-genutils==0.2.0 -ipywidgets==8.0.3 +ipywidgets==8.0.4 isoduration==20.11.0 jaraco.classes==3.2.3 jedi==0.18.2 @@ -59,114 +56,111 @@ Jinja2==3.1.2 jsonpointer==2.3 jsonschema==4.17.3 jupyter==1.0.0 -jupyter_client==7.4.8 +jupyter_client==8.0.2 jupyter-console==6.4.4 -jupyter_core==5.1.0 -jupyter-events==0.5.0 -jupyter_server==2.0.1 -jupyter_server_terminals==0.4.2 +jupyter_core==5.2.0 +jupyter-events==0.6.3 +jupyter_server==2.2.0 +jupyter_server_terminals==0.4.4 jupyterlab-pygments==0.2.2 -jupyterlab-widgets==3.0.4 -keyring==23.11.0 +jupyterlab-widgets==3.0.5 +keyring==23.13.1 kiwisolver==1.4.4 latexcodec==2.0.1 -MarkupSafe==2.1.1 +markdown-it-py==2.1.0 +MarkupSafe==2.1.2 matplotlib==3.6.2 matplotlib-inline==0.1.6 -mccabe==0.7.0 +mdurl==0.1.2 mistune==2.0.4 more-itertools==9.0.0 mypy-extensions==0.4.3 -nbclassic==0.4.8 +nbclassic==0.5.1 nbclient==0.7.2 -nbconvert==7.2.6 -nbformat==5.7.0 +nbconvert==7.2.9 +nbformat==5.7.3 nest-asyncio==1.5.6 nodeenv==1.7.0 notebook==6.5.2 notebook_shim==0.2.2 -numpy==1.23.5 -packaging==22.0 +numpy==1.24.1 +packaging==23.0 pandocfilters==1.5.0 parso==0.8.3 -pathspec==0.10.3 +pathspec==0.11.0 pexpect==4.8.0 pickleshare==0.7.5 -Pillow==9.3.0 +Pillow==9.4.0 pip==22.3.1 -pkginfo==1.9.2 -platformdirs==2.6.0 +pkginfo==1.9.6 +platformdirs==2.6.2 pluggy==1.0.0 -pre-commit==2.20.0 -prometheus-client==0.15.0 +pre-commit==3.0.3 +prometheus-client==0.16.0 prompt-toolkit==3.0.36 psutil==5.9.4 ptyprocess==0.7.0 pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.2 -pycodestyle==2.10.0 pycparser==2.21 pydata-sphinx-theme==0.12.0 -pydocstyle==6.1.1 -pyflakes==3.0.1 -Pygments==2.13.0 +Pygments==2.14.0 pyparsing==3.0.9 -pyright==1.1.283 -pyrsistent==0.19.2 -pytest==7.2.0 +pyright==1.1.292 +pyrsistent==0.19.3 +pytest==7.2.1 pytest-cov==4.0.0 pytest-xdist==3.1.0 python-dateutil==2.8.2 python-json-logger==2.0.4 -pytz==2022.6 -pyupgrade==3.3.1 +pytz==2022.7.1 PyYAML==6.0 -pyzmq==24.0.1 +pyzmq==25.0.0 qtconsole==5.4.0 QtPy==2.3.0 readme-renderer==37.3 -requests==2.28.1 +requests==2.28.2 requests-toolbelt==0.10.1 restructuredtext-lint==1.4.0 rfc3339-validator==0.1.4 rfc3986==2.0.0 rfc3986-validator==0.1.1 -rich==12.6.0 -scipy==1.9.3 +rich==13.3.1 +ruff==0.0.239 +scipy==1.10.0 Send2Trash==1.8.0 -setuptools==65.6.3 +setuptools==67.1.0 setuptools-scm==7.0.5 six==1.16.0 sniffio==1.3.0 snowballstemmer==2.2.0 soupsieve==2.3.2.post1 Sphinx==4.5.0 -sphinxcontrib-applehelp==1.0.2 +sphinxcontrib-applehelp==1.0.4 sphinxcontrib-bibtex==2.5.0 sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.0 +sphinxcontrib-htmlhelp==2.0.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 stack-data==0.6.2 terminado==0.17.1 tinycss2==1.2.1 -tokenize-rt==5.0.0 toml==0.10.2 tomli==2.0.1 tornado==6.2 -traitlets==5.7.0 +traitlets==5.9.0 twine==4.0.2 types-setuptools==65.6.0.1 typing_extensions==4.4.0 uri-template==1.2.0 -urllib3==1.26.13 +urllib3==1.26.14 virtualenv==20.17.1 -wcwidth==0.2.5 +wcwidth==0.2.6 webcolors==1.12 webencodings==0.5.1 -websocket-client==1.4.2 +websocket-client==1.5.0 wheel==0.38.4 -widgetsnbextension==4.0.4 -zipp==3.11.0 +widgetsnbextension==4.0.5 +zipp==3.12.0 From 05fa654494662b0b8a395285b3b5d6ac8958b2e0 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 3 Feb 2023 22:10:23 +1300 Subject: [PATCH 08/30] Update "pyproject.toml" file. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1d48615..4f6f89d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ pydata-sphinx-theme = { version = "*", optional = true } # Development dependen pyright = { version = "*", optional = true } # Development dependency. pytest = { version = "*", optional = true } # Development dependency. pytest-cov = { version = "*", optional = true } # Development dependency. -pytest-xdist = { version = "*", optional = true} #Development dependency +pytest-xdist = { version = "*", optional = true} # Development dependency restructuredtext-lint = { version = "*", optional = true } # Development dependency. ruff = { version = "*", optional = true } # Development dependency. sphinx = { version = ">= 4, < 5", optional = true } # Development dependency. From 2a4f3b4b831ea7991eae4eae0abf54c8ff1b53c1 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 12 Feb 2023 08:07:23 +1300 Subject: [PATCH 09/30] Update various docstrings. --- docs/conf.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2cfa06c..6ad9fbc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -183,21 +183,3 @@ epub_publisher = package.__author__ epub_copyright = package.__copyright__.replace("Copyright (C)", "") epub_exclude_files = ["search.html"] - - -def autodoc_process_docstring( - app, what, name, obj, options, lines # noqa: ARG001 -): - """Process the docstrings to remove the *# noqa* *flake8* pragma.""" - - for i, line in enumerate(lines): - lines[i] = line.replace("# noqa", "") - - -def setup(app): - """ - Prepare the extension and linking resources that Sphinx uses in the - build process. - """ - - app.connect("autodoc-process-docstring", autodoc_process_docstring) From 6a91f732d74b74a9ae930bc71f56e435f8ad24f8 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Thu, 23 Feb 2023 21:10:52 +1300 Subject: [PATCH 10/30] Re-enable warnings in unit-tests. --- .github/workflows/continuous-integration-quality-unit-tests.yml | 2 +- tasks.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration-quality-unit-tests.yml b/.github/workflows/continuous-integration-quality-unit-tests.yml index 7a810fe..f3773af 100644 --- a/.github/workflows/continuous-integration-quality-unit-tests.yml +++ b/.github/workflows/continuous-integration-quality-unit-tests.yml @@ -51,7 +51,7 @@ jobs: shell: bash - name: Test with Pytest run: | - poetry run python -W ignore -m pytest --disable-warnings --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE + poetry 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: | diff --git a/tasks.py b/tasks.py index fe47dac..4af30cd 100644 --- a/tasks.py +++ b/tasks.py @@ -209,7 +209,6 @@ def tests(ctx: Context): message_box('Running "Pytest"...') ctx.run( "pytest " - "--disable-warnings " "--doctest-modules " f"--ignore={PYTHON_PACKAGE_NAME}/examples " f"{PYTHON_PACKAGE_NAME}" @@ -422,7 +421,6 @@ def virtualise(ctx: Context, tests: bool = True): if tests: ctx.run( "poetry run pytest " - "--disable-warnings " "--doctest-modules " f"--ignore={PYTHON_PACKAGE_NAME}/examples " f"{PYTHON_PACKAGE_NAME}", From 820d0b8bf49cd9aa5d4100530ab4de8ab3ad011e Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Thu, 23 Feb 2023 21:12:03 +1300 Subject: [PATCH 11/30] Update minimum version of "Numpy" to 1.21. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4f6f89d..1a44695 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ exclude = [ python = ">= 3.9, < 3.12" colour-science = ">= 0.4.2" imageio = ">= 2, < 3" -numpy = ">= 1.20, < 2" +numpy = ">= 1.21, < 2" scipy = ">= 1.7, < 2" typing-extensions = ">= 4, < 5" From 50b54464dba3279e149137f6865fa512f19dc023 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Thu, 9 Mar 2023 22:26:06 +1300 Subject: [PATCH 12/30] Ensure that coverage data is properly captured with distributed unit tests. --- .coveragerc | 1 + tasks.py | 1 + 2 files changed, 2 insertions(+) diff --git a/.coveragerc b/.coveragerc index df75ca0..06a92eb 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,6 @@ [run] source = colour_demosaicing +sigterm = True [report] exclude_lines = pragma: no cover diff --git a/tasks.py b/tasks.py index 4af30cd..19226a3 100644 --- a/tasks.py +++ b/tasks.py @@ -211,6 +211,7 @@ def tests(ctx: Context): "pytest " "--doctest-modules " f"--ignore={PYTHON_PACKAGE_NAME}/examples " + f"--cov={PYTHON_PACKAGE_NAME} " f"{PYTHON_PACKAGE_NAME}" ) From fc210d278fd7a8dee186582da9a0198cf5ee580d Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 31 Mar 2023 22:13:35 +1300 Subject: [PATCH 13/30] Pin "Poetry" version to 1.4.0. --- .github/workflows/continuous-integration-documentation.yml | 2 ++ .../workflows/continuous-integration-quality-unit-tests.yml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/continuous-integration-documentation.yml b/.github/workflows/continuous-integration-documentation.yml index b8022b8..7d65e79 100644 --- a/.github/workflows/continuous-integration-documentation.yml +++ b/.github/workflows/continuous-integration-documentation.yml @@ -30,6 +30,8 @@ jobs: sudo apt-get update sudo apt-get --yes install latexmk texlive-full - name: Install Poetry + env: + POETRY_VERSION: 1.4.0 run: | curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - echo "$HOME/.poetry/bin" >> $GITHUB_PATH diff --git a/.github/workflows/continuous-integration-quality-unit-tests.yml b/.github/workflows/continuous-integration-quality-unit-tests.yml index f3773af..aa32687 100644 --- a/.github/workflows/continuous-integration-quality-unit-tests.yml +++ b/.github/workflows/continuous-integration-quality-unit-tests.yml @@ -31,6 +31,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install Poetry + env: + POETRY_VERSION: 1.4.0 run: | curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - echo "$HOME/.poetry/bin" >> $GITHUB_PATH @@ -54,6 +56,7 @@ jobs: poetry 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 + if: matrix.os == 'macOS-latest' && matrix.python-version == '3.11' run: | if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi shell: bash From a46b3eafc787b4b580c18b435fb060840bc9b860 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 4 Aug 2023 21:59:48 +1200 Subject: [PATCH 14/30] Update ".gitignore" file. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ece08fe..7fc0f65 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ *.pyc *.pyo .DS_Store -.coverage +.coverage* .fleet .idea .ipynb_checkpoints From 0cf9f5366ae362b31ea04a9c9687921e4b738d0c Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 4 Aug 2023 22:06:39 +1200 Subject: [PATCH 15/30] Remove "# nosec" pragma. --- colour_demosaicing/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/colour_demosaicing/__init__.py b/colour_demosaicing/__init__.py index dd82e6d..6f50b44 100644 --- a/colour_demosaicing/__init__.py +++ b/colour_demosaicing/__init__.py @@ -14,7 +14,7 @@ import contextlib import numpy as np import os -import subprocess # nosec +import subprocess import colour @@ -62,7 +62,7 @@ try: _version: str = ( - subprocess.check_output( # nosec + subprocess.check_output( ["git", "describe"], cwd=os.path.dirname(__file__), stderr=subprocess.STDOUT, From 5a7d0d66e2d094644e9844a1d8b883dae05a6e5e Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 4 Aug 2023 22:04:06 +1200 Subject: [PATCH 16/30] Update "tasks.py" file. --- tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 19226a3..afe98ee 100644 --- a/tasks.py +++ b/tasks.py @@ -20,7 +20,8 @@ if not hasattr(inspect, "getargspec"): inspect.getargspec = inspect.getfullargspec # pyright: ignore -from invoke import Context, task +from invoke.tasks import task +from invoke.context import Context __author__ = "Colour Developers" __copyright__ = "Copyright 2015 Colour Developers" From 97b2782ce487b60866f5e71b4ffb8ddc89d52181 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 4 Aug 2023 22:10:28 +1200 Subject: [PATCH 17/30] Update various utilities. --- utilities/export_todo.py | 2 ++ utilities/unicode_to_ascii.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/utilities/export_todo.py b/utilities/export_todo.py index ecbb8af..bda74de 100755 --- a/utilities/export_todo.py +++ b/utilities/export_todo.py @@ -120,6 +120,8 @@ def export_todo_items(todo_items: dict, file_path: str): if __name__ == "__main__": + os.chdir(os.path.dirname(__file__)) + export_todo_items( extract_todo_items(os.path.join("..", "colour_demosaicing")), os.path.join("..", "TODO.rst"), diff --git a/utilities/unicode_to_ascii.py b/utilities/unicode_to_ascii.py index c9a6fed..419c71c 100755 --- a/utilities/unicode_to_ascii.py +++ b/utilities/unicode_to_ascii.py @@ -69,4 +69,6 @@ def unicode_to_ascii(root_directory: str): if __name__ == "__main__": + os.chdir(os.path.dirname(__file__)) + unicode_to_ascii(os.path.join("..", "colour_demosaicing")) From 5e68aef6005fcb528b62aecfa1af1108e0421659 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Fri, 4 Aug 2023 22:16:49 +1200 Subject: [PATCH 18/30] Improve license reference consistency. --- CONTRIBUTORS.rst | 2 +- LICENSE | 29 +++++-------------- README.rst | 4 +-- TODO.rst | 2 +- colour_demosaicing/__init__.py | 2 +- .../bayer/demosaicing/bilinear.py | 2 +- .../bayer/demosaicing/malvar2004.py | 2 +- .../bayer/demosaicing/menon2007.py | 2 +- .../bayer/demosaicing/tests/test_bilinear.py | 2 +- .../demosaicing/tests/test_malvar2004.py | 2 +- .../bayer/demosaicing/tests/test_menon2007.py | 2 +- colour_demosaicing/bayer/masks.py | 2 +- colour_demosaicing/bayer/mosaicing.py | 2 +- colour_demosaicing/bayer/tests/test_masks.py | 2 +- .../bayer/tests/test_mosaicing.py | 2 +- docs/index.rst | 4 +-- tasks.py | 2 +- utilities/export_todo.py | 4 +-- utilities/unicode_to_ascii.py | 2 +- 19 files changed, 29 insertions(+), 42 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 73fa02b..d316e67 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -31,5 +31,5 @@ About | **Colour - Demosaicing** by Colour Developers | Copyright 2015 Colour Developers – `colour-developers@colour-science.org `__ -| 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-demosaicing `__ diff --git a/LICENSE b/LICENSE index f63ef1d..1f83226 100644 --- a/LICENSE +++ b/LICENSE @@ -1,24 +1,11 @@ Copyright 2015 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. \ No newline at end of file +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +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 diff --git a/README.rst b/README.rst index 6910c2e..a282c94 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ A `Python `__ package implementing various CFA (Colour Filter Array) demosaicing algorithms and related utilities. It is open source and freely available under the -`New BSD License `__ terms. +`BSD-3-Clause `__ terms. .. image:: https://raw.githubusercontent.com/colour-science/colour-demosaicing/master/docs/_static/Demosaicing_001.png @@ -128,5 +128,5 @@ About | **Colour - Demosaicing** by Colour Developers | Copyright 2015 Colour Developers – `colour-developers@colour-science.org `__ -| 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-demosaicing `__ diff --git a/TODO.rst b/TODO.rst index 449cd38..3468929 100644 --- a/TODO.rst +++ b/TODO.rst @@ -13,5 +13,5 @@ About | **Colour - Demosaicing** by Colour Developers | Copyright 2015 Colour Developers – `colour-developers@colour-science.org `__ -| 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-demosaicing `__ diff --git a/colour_demosaicing/__init__.py b/colour_demosaicing/__init__.py index 6f50b44..0555121 100644 --- a/colour_demosaicing/__init__.py +++ b/colour_demosaicing/__init__.py @@ -29,7 +29,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/demosaicing/bilinear.py b/colour_demosaicing/bayer/demosaicing/bilinear.py index fb452ac..0b08a77 100644 --- a/colour_demosaicing/bayer/demosaicing/bilinear.py +++ b/colour_demosaicing/bayer/demosaicing/bilinear.py @@ -22,7 +22,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/demosaicing/malvar2004.py b/colour_demosaicing/bayer/demosaicing/malvar2004.py index ed507ab..7a36cad 100644 --- a/colour_demosaicing/bayer/demosaicing/malvar2004.py +++ b/colour_demosaicing/bayer/demosaicing/malvar2004.py @@ -25,7 +25,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/demosaicing/menon2007.py b/colour_demosaicing/bayer/demosaicing/menon2007.py index ca5357c..2ad8206 100644 --- a/colour_demosaicing/bayer/demosaicing/menon2007.py +++ b/colour_demosaicing/bayer/demosaicing/menon2007.py @@ -24,7 +24,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py b/colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py index b48fd5b..2493828 100644 --- a/colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py +++ b/colour_demosaicing/bayer/demosaicing/tests/test_bilinear.py @@ -17,7 +17,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py b/colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py index 248b61c..2481c42 100644 --- a/colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py +++ b/colour_demosaicing/bayer/demosaicing/tests/test_malvar2004.py @@ -17,7 +17,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/demosaicing/tests/test_menon2007.py b/colour_demosaicing/bayer/demosaicing/tests/test_menon2007.py index 1d743ed..f9d890b 100644 --- a/colour_demosaicing/bayer/demosaicing/tests/test_menon2007.py +++ b/colour_demosaicing/bayer/demosaicing/tests/test_menon2007.py @@ -17,7 +17,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/masks.py b/colour_demosaicing/bayer/masks.py index 10db1e1..d67b562 100644 --- a/colour_demosaicing/bayer/masks.py +++ b/colour_demosaicing/bayer/masks.py @@ -14,7 +14,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/mosaicing.py b/colour_demosaicing/bayer/mosaicing.py index 333537d..bdad54a 100644 --- a/colour_demosaicing/bayer/mosaicing.py +++ b/colour_demosaicing/bayer/mosaicing.py @@ -14,7 +14,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/tests/test_masks.py b/colour_demosaicing/bayer/tests/test_masks.py index 20fcdb3..a64b0dc 100644 --- a/colour_demosaicing/bayer/tests/test_masks.py +++ b/colour_demosaicing/bayer/tests/test_masks.py @@ -15,7 +15,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/colour_demosaicing/bayer/tests/test_mosaicing.py b/colour_demosaicing/bayer/tests/test_mosaicing.py index 925ead9..b191d52 100644 --- a/colour_demosaicing/bayer/tests/test_mosaicing.py +++ b/colour_demosaicing/bayer/tests/test_mosaicing.py @@ -17,7 +17,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/docs/index.rst b/docs/index.rst index 33f9407..6a204a1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,7 +5,7 @@ A `Python `__ package implementing various CFA (Colour Filter Array) demosaicing algorithms and related utilities. It is open source and freely available under the -`New BSD License `__ terms. +`BSD-3-Clause `__ terms. .. image:: https://raw.githubusercontent.com/colour-science/colour-demosaicing/master/docs/_static/Demosaicing_001.png @@ -64,5 +64,5 @@ About | **Colour - Demosaicing** by Colour Developers | Copyright 2015 Colour Developers – `colour-developers@colour-science.org `__ -| 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-demosaicing `__ diff --git a/tasks.py b/tasks.py index afe98ee..cec0631 100644 --- a/tasks.py +++ b/tasks.py @@ -25,7 +25,7 @@ __author__ = "Colour Developers" __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" diff --git a/utilities/export_todo.py b/utilities/export_todo.py index bda74de..8ae5128 100755 --- a/utilities/export_todo.py +++ b/utilities/export_todo.py @@ -10,7 +10,7 @@ import os __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" @@ -36,7 +36,7 @@ | **Colour - Demosaicing** by Colour Developers | Copyright 2015 Colour Developers - \ `colour-developers@colour-science.org `__ -| This software is released under terms of New BSD License: \ +| This software is released under terms of BSD-3-Clause: \ https://opensource.org/licenses/BSD-3-Clause | `https://github.com/colour-science/colour-demosaicing \ `__ diff --git a/utilities/unicode_to_ascii.py b/utilities/unicode_to_ascii.py index 419c71c..14f4d5f 100755 --- a/utilities/unicode_to_ascii.py +++ b/utilities/unicode_to_ascii.py @@ -11,7 +11,7 @@ import unicodedata __copyright__ = "Copyright 2015 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__ = "colour-developers@colour-science.org" __status__ = "Production" From 2d104c77c832e4ff4b184e12fbadb3a7c794c36e Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 11:28:28 +1200 Subject: [PATCH 19/30] Update "tasks.py" file. --- tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index cec0631..092fcd8 100644 --- a/tasks.py +++ b/tasks.py @@ -474,7 +474,7 @@ def tag(ctx: Context): remote_tag.split("refs/tags/")[1].replace("refs/tags/", "^{}") ) version_tags = sorted(tags) - if f"v{version}" not in version_tags: + if f"v{version}" in version_tags: raise RuntimeError( f'A "{PYTHON_PACKAGE_NAME}" "v{version}" tag already exists in ' f"remote repository!" From 6f397ea5ad0ea2860552fe7513e116c337b52d83 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 11:28:41 +1200 Subject: [PATCH 20/30] Update various urls. --- README.rst | 16 ++++++++-------- docs/index.rst | 4 ++-- docs/installation.rst | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.rst b/README.rst index a282c94..f42d251 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,7 @@ Colour - Demosaicing .. end-badges -A `Python `__ package implementing various +A `Python `__ package implementing various CFA (Colour Filter Array) demosaicing algorithms and related utilities. It is open source and freely available under the @@ -67,11 +67,11 @@ Primary Dependencies **Colour - Demosaicing** requires various dependencies in order to run: -- `python >= 3.8, < 4 `__ -- `colour-science >= 4 `__ -- `imageio >= 2, < 3 `__ -- `numpy >= 1.19, < 2 `__ -- `scipy >= 1.5, < 2 `__ +- `python >= 3.8, < 4 `__ +- `colour-science >= 4 `__ +- `imageio >= 2, < 3 `__ +- `numpy >= 1.19, < 2 `__ +- `scipy >= 1.5, < 2 `__ Pypi ~~~~ @@ -90,7 +90,7 @@ Contributing ^^^^^^^^^^^^ If you would like to contribute to `Colour - Demosaicing `__, -please refer to the following `Contributing `__ +please refer to the following `Contributing `__ guide for `Colour `__. Bibliography @@ -110,7 +110,7 @@ Code of Conduct --------------- The *Code of Conduct*, adapted from the `Contributor Covenant 1.4 `__, -is available on the `Code of Conduct `__ page. +is available on the `Code of Conduct `__ page. Contact & Social ---------------- diff --git a/docs/index.rst b/docs/index.rst index 6a204a1..ef75a50 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,7 +1,7 @@ Colour - Demosaicing ==================== -A `Python `__ package implementing various +A `Python `__ package implementing various CFA (Colour Filter Array) demosaicing algorithms and related utilities. It is open source and freely available under the @@ -46,7 +46,7 @@ Code of Conduct --------------- The *Code of Conduct*, adapted from the `Contributor Covenant 1.4 `__, -is available on the `Code of Conduct `__ page. +is available on the `Code of Conduct `__ page. Contact & Social ---------------- diff --git a/docs/installation.rst b/docs/installation.rst index d949647..53b5053 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -13,11 +13,11 @@ Primary Dependencies **Colour - Demosaicing** requires various dependencies in order to run: -- `python >= 3.8, < 4 `__ -- `colour-science >= 4 `__ -- `imageio >= 2, < 3 `__ -- `numpy >= 1.19, < 2 `__ -- `scipy >= 1.5, < 2 `__ +- `python >= 3.8, < 4 `__ +- `colour-science >= 4 `__ +- `imageio >= 2, < 3 `__ +- `numpy >= 1.19, < 2 `__ +- `scipy >= 1.5, < 2 `__ Pypi ---- From 718a94ba425559e953e877851c4a6cbb7101e299 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:07:17 +1200 Subject: [PATCH 21/30] Update "pre-commit" configuration. --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3345920..b527df6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ repos: - repo: https://github.com/ikamensh/flynt/ - rev: '0.77' + rev: '1.0.1' hooks: - id: flynt - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.239' + rev: 'v0.0.285' hooks: - id: ruff - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.7.0 hooks: - id: black language_version: python3.9 From d1a46599024234308e996afae3e7368a1f59b4fd Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:08:29 +1200 Subject: [PATCH 22/30] Overhaul "Poetry" dependencies. --- .../continuous-integration-documentation.yml | 2 +- .readthedocs.yaml | 7 +- docs/requirements.txt | 50 +++ pyproject.toml | 155 +++----- requirements.txt | 346 +++++++++--------- setup.py | 81 ---- tasks.py | 78 +--- 7 files changed, 305 insertions(+), 414 deletions(-) create mode 100644 docs/requirements.txt delete mode 100644 setup.py diff --git a/.github/workflows/continuous-integration-documentation.yml b/.github/workflows/continuous-integration-documentation.yml index 7d65e79..9e03bbe 100644 --- a/.github/workflows/continuous-integration-documentation.yml +++ b/.github/workflows/continuous-integration-documentation.yml @@ -39,7 +39,7 @@ jobs: - name: Install Package Dependencies run: | poetry run python -m pip install --upgrade pip - poetry install --extras "read-the-docs" + poetry install poetry run python -c "import imageio;imageio.plugins.freeimage.download()" shell: bash - name: Build Documentation diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2834365..c93eb8a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -13,8 +13,5 @@ formats: - pdf python: - install: - - method: pip - path: . - extra_requirements: - - read-the-docs \ No newline at end of file + install: + - requirements: docs/requirements.txt \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..9cde8f7 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,50 @@ +accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.12" +alabaster==0.7.13 ; python_version >= "3.9" and python_version < "3.12" +babel==2.12.1 ; python_version >= "3.9" and python_version < "3.12" +beautifulsoup4==4.12.2 ; python_version >= "3.9" and python_version < "3.12" +biblib-simple==0.1.2 ; python_version >= "3.9" and python_version < "3.12" +certifi==2023.7.22 ; python_version >= "3.9" and python_version < "3.12" +charset-normalizer==3.2.0 ; python_version >= "3.9" and python_version < "3.12" +colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32" +colour-science==0.4.3 ; python_version >= "3.9" and python_version < "3.12" +contourpy==1.1.0 ; python_version >= "3.9" and python_version < "3.12" +cycler==0.11.0 ; python_version >= "3.9" and python_version < "3.12" +docutils==0.17.1 ; python_version >= "3.9" and python_version < "3.12" +fonttools==4.42.1 ; python_version >= "3.9" and python_version < "3.12" +idna==3.4 ; python_version >= "3.9" and python_version < "3.12" +imageio==2.31.2 ; python_version >= "3.9" and python_version < "3.12" +imagesize==1.4.1 ; python_version >= "3.9" and python_version < "3.12" +importlib-metadata==6.8.0 ; python_version >= "3.9" and python_version < "3.10" +importlib-resources==6.0.1 ; python_version >= "3.9" and python_version < "3.10" +jinja2==3.1.2 ; python_version >= "3.9" and python_version < "3.12" +kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.12" +latexcodec==2.0.1 ; python_version >= "3.9" and python_version < "3.12" +markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "3.12" +matplotlib==3.7.2 ; python_version >= "3.9" and python_version < "3.12" +numpy==1.25.2 ; python_version >= "3.9" and python_version < "3.12" +packaging==23.1 ; python_version >= "3.9" and python_version < "3.12" +pillow==10.0.0 ; python_version >= "3.9" and python_version < "3.12" +pybtex-docutils==1.0.3 ; python_version >= "3.9" and python_version < "3.12" +pybtex==0.24.0 ; python_version >= "3.9" and python_version < "3.12" +pydata-sphinx-theme==0.13.3 ; python_version >= "3.9" and python_version < "3.12" +pygments==2.16.1 ; python_version >= "3.9" and python_version < "3.12" +pyparsing==3.0.9 ; python_version >= "3.9" and python_version < "3.12" +python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "3.12" +pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.12" +requests==2.31.0 ; python_version >= "3.9" and python_version < "3.12" +restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "3.12" +scipy==1.11.2 ; python_version >= "3.9" and python_version < "3.12" +six==1.16.0 ; python_version >= "3.9" and python_version < "3.12" +snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "3.12" +soupsieve==2.4.1 ; python_version >= "3.9" and python_version < "3.12" +sphinx==4.5.0 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-applehelp==1.0.4 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-bibtex==2.6.0 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-htmlhelp==2.0.1 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.9" and python_version < "3.12" +typing-extensions==4.7.1 ; python_version >= "3.9" and python_version < "3.12" +urllib3==2.0.4 ; python_version >= "3.9" and python_version < "3.12" +zipp==3.16.2 ; python_version >= "3.9" and python_version < "3.10" diff --git a/pyproject.toml b/pyproject.toml index 1a44695..43302eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,37 +49,16 @@ exclude = [ [tool.poetry.dependencies] python = ">= 3.9, < 3.12" -colour-science = ">= 0.4.2" +colour-science = ">= 0.4.3" imageio = ">= 2, < 3" -numpy = ">= 1.21, < 2" -scipy = ">= 1.7, < 2" +numpy = ">= 1.22, < 2" +scipy = ">= 1.8, < 2" typing-extensions = ">= 4, < 5" -matplotlib = { version = ">= 3.5, != 3.5.0, != 3.5.1", optional = true } +[tool.poetry.group.optional.dependencies] +matplotlib = ">= 3.5, != 3.5.0, != 3.5.1" -biblib-simple = { version = "*", optional = true } # Development dependency. -black = { version = "*", optional = true } # Development dependency. -blackdoc = { version = "*", optional = true } # Development dependency. -coverage = { version = "!= 6.3", optional = true } # Development dependency. -coveralls = { version = "*", optional = true } # Development dependency. -flynt = { version = "*", optional = true } # Development dependency. -invoke = { version = "*", optional = true } # Development dependency. -jupyter = { version = "*", optional = true } # Development dependency. -pre-commit = { version = "*", optional = true } # Development dependency. -pydata-sphinx-theme = { version = "*", optional = true } # Development dependency. -pyright = { version = "*", optional = true } # Development dependency. -pytest = { version = "*", optional = true } # Development dependency. -pytest-cov = { version = "*", optional = true } # Development dependency. -pytest-xdist = { version = "*", optional = true} # Development dependency -restructuredtext-lint = { version = "*", optional = true } # Development dependency. -ruff = { version = "*", optional = true } # Development dependency. -sphinx = { version = ">= 4, < 5", optional = true } # Development dependency. -sphinxcontrib-bibtex = { version = "*", optional = true } # Development dependency. -toml = { version = "*", optional = true } # Development dependency. -twine = { version = "*", optional = true } # Development dependency. - -[tool.poetry.dev-dependencies] -biblib-simple = "*" +[tool.poetry.group.dev.dependencies] black = "*" blackdoc = "*" coverage = "!= 6.3" @@ -88,43 +67,20 @@ flynt = "*" invoke = "*" jupyter = "*" pre-commit = "*" -pydata-sphinx-theme = "*" pyright = "*" pytest = "*" pytest-cov = "*" pytest-xdist = "*" -restructuredtext-lint = "*" ruff = "*" -sphinx = ">= 4, < 5" -sphinxcontrib-bibtex = "*" toml = "*" twine = "*" -[tool.poetry.extras] -development = [ - "biblib-simple", - "black", - "blackdoc", - "coverage", - "coveralls", - "flynt", - "invoke", - "jupyter", - "pre-commit", - "pydata-sphinx-theme", - "pyright", - "pytest", - "pytest-cov", - "pytest-xdist", - "restructuredtext-lint", - "ruff", - "sphinx", - "sphinxcontrib-bibtex", - "toml", - "twine", -] -plotting = [ "matplotlib" ] -read-the-docs = [ "matplotlib", "pydata-sphinx-theme", "sphinxcontrib-bibtex" ] +[tool.poetry.group.docs.dependencies] +biblib-simple = "*" +pydata-sphinx-theme = "*" +restructuredtext-lint = "*" +sphinx = ">= 4, < 5" +sphinxcontrib-bibtex = "*" [tool.black] line-length = 79 @@ -155,47 +111,47 @@ addopts = "-n auto --dist=loadscope --durations=5" target-version = "py39" line-length = 88 select = [ - "A", # flake8-builtins - "ARG", # flake8-unused-arguments - # "ANN", # flake8-annotations - "B", # flake8-bugbear - # "BLE", # flake8-blind-except - "C4", # flake8-comprehensions - # "C90", # mccabe - # "COM", # flake8-commas - "DTZ", # flake8-datetimez - "D", # pydocstyle - "E", # pydocstyle - # "ERA", # eradicate - # "EM", # flake8-errmsg - "EXE", # flake8-executable - "F", # flake8 - # "FBT", # flake8-boolean-trap - "G", # flake8-logging-format - "I", # isort - "ICN", # flake8-import-conventions - "INP", # flake8-no-pep420 - "ISC", # flake8-implicit-str-concat - "N", # pep8-naming - # "PD", # pandas-vet - "PIE", # flake8-pie - "PGH", # pygrep-hooks - "PL", # pylint - # "PT", # flake8-pytest-style - # "PTH", # flake8-use-pathlib [Enable] - "Q", # flake8-quotes - "RET", # flake8-return - "RUF", # Ruff - "S", # flake8-bandit - "SIM", # flake8-simplify - "T10", # flake8-debugger - "T20", # flake8-print - # "TCH", # flake8-type-checking - "TID", # flake8-tidy-imports - "TRY", # tryceratops - "UP", # pyupgrade - "W", # pydocstyle - "YTT" # flake8-2020 + "A", # flake8-builtins + "ARG", # flake8-unused-arguments + # "ANN", # flake8-annotations + "B", # flake8-bugbear + # "BLE", # flake8-blind-except + "C4", # flake8-comprehensions + # "C90", # mccabe + # "COM", # flake8-commas + "DTZ", # flake8-datetimez + "D", # pydocstyle + "E", # pydocstyle + # "ERA", # eradicate + # "EM", # flake8-errmsg + "EXE", # flake8-executable + "F", # flake8 + # "FBT", # flake8-boolean-trap + "G", # flake8-logging-format + "I", # isort + "ICN", # flake8-import-conventions + "INP", # flake8-no-pep420 + "ISC", # flake8-implicit-str-concat + "N", # pep8-naming + # "PD", # pandas-vet + "PIE", # flake8-pie + "PGH", # pygrep-hooks + "PL", # pylint + # "PT", # flake8-pytest-style + # "PTH", # flake8-use-pathlib [Enable] + "Q", # flake8-quotes + "RET", # flake8-return + "RUF", # Ruff + "S", # flake8-bandit + "SIM", # flake8-simplify + "T10", # flake8-debugger + "T20", # flake8-print + # "TCH", # flake8-type-checking + "TID", # flake8-tidy-imports + "TRY", # tryceratops + "UP", # pyupgrade + "W", # pydocstyle + "YTT" # flake8-2020 ] ignore = [ "B008", @@ -214,9 +170,13 @@ ignore = [ "N813", "N815", "N816", + "PGH003", "PIE804", "PLE0605", + "PLR0911", + "PLR0912", "PLR0913", + "PLR0915", "PLR2004", "RET504", "RET505", @@ -235,7 +195,6 @@ convention = "numpy" [tool.ruff.per-file-ignores] "colour_demosaicing/examples/*" = ["INP", "T201", "T203"] "docs/*" = ["INP"] -"setup.py" = ["INP"] "tasks.py" = ["INP"] "utilities/*" = ["EXE001", "INP"] "utilities/unicode_to_ascii.py" = ["RUF001"] diff --git a/requirements.txt b/requirements.txt index 109a4fd..edd4afd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,166 +1,180 @@ -alabaster==0.7.13 -anyio==3.6.2 -appnope==0.1.3 -argon2-cffi==21.3.0 -argon2-cffi-bindings==21.2.0 -arrow==1.2.3 -astor==0.8.1 -asttokens==2.2.1 -attrs==22.2.0 -Babel==2.11.0 -backcall==0.2.0 -beautifulsoup4==4.11.2 -biblib-simple==0.1.2 -black==23.1.0 -blackdoc==0.3.8 -bleach==6.0.0 -certifi==2022.12.7 -cffi==1.15.1 -cfgv==3.3.1 -charset-normalizer==3.0.1 -click==8.1.3 -colour-science==0.4.2 -comm==0.1.2 -contourpy==1.0.6 -coverage==6.5.0 -coveralls==3.3.1 -cycler==0.11.0 -debugpy==1.6.6 -decorator==5.1.1 -defusedxml==0.7.1 -distlib==0.3.6 -docopt==0.6.2 -docutils==0.17.1 -execnet==1.9.0 -executing==1.2.0 -fastjsonschema==2.16.2 -filelock==3.9.0 -flynt==0.77 -fonttools==4.38.0 -fqdn==1.5.1 -identify==2.5.17 -idna==3.4 -imageio==2.25.0 -imagesize==1.4.1 -importlib-metadata==6.0.0 -iniconfig==2.0.0 -invoke==2.0.0 -ipykernel==6.20.2 -ipython==8.9.0 -ipython-genutils==0.2.0 -ipywidgets==8.0.4 -isoduration==20.11.0 -jaraco.classes==3.2.3 -jedi==0.18.2 -Jinja2==3.1.2 -jsonpointer==2.3 -jsonschema==4.17.3 -jupyter==1.0.0 -jupyter_client==8.0.2 -jupyter-console==6.4.4 -jupyter_core==5.2.0 -jupyter-events==0.6.3 -jupyter_server==2.2.0 -jupyter_server_terminals==0.4.4 -jupyterlab-pygments==0.2.2 -jupyterlab-widgets==3.0.5 -keyring==23.13.1 -kiwisolver==1.4.4 -latexcodec==2.0.1 -markdown-it-py==2.1.0 -MarkupSafe==2.1.2 -matplotlib==3.6.2 -matplotlib-inline==0.1.6 -mdurl==0.1.2 -mistune==2.0.4 -more-itertools==9.0.0 -mypy-extensions==0.4.3 -nbclassic==0.5.1 -nbclient==0.7.2 -nbconvert==7.2.9 -nbformat==5.7.3 -nest-asyncio==1.5.6 -nodeenv==1.7.0 -notebook==6.5.2 -notebook_shim==0.2.2 -numpy==1.24.1 -packaging==23.0 -pandocfilters==1.5.0 -parso==0.8.3 -pathspec==0.11.0 -pexpect==4.8.0 -pickleshare==0.7.5 -Pillow==9.4.0 -pip==22.3.1 -pkginfo==1.9.6 -platformdirs==2.6.2 -pluggy==1.0.0 -pre-commit==3.0.3 -prometheus-client==0.16.0 -prompt-toolkit==3.0.36 -psutil==5.9.4 -ptyprocess==0.7.0 -pure-eval==0.2.2 -pybtex==0.24.0 -pybtex-docutils==1.0.2 -pycparser==2.21 -pydata-sphinx-theme==0.12.0 -Pygments==2.14.0 -pyparsing==3.0.9 -pyright==1.1.292 -pyrsistent==0.19.3 -pytest==7.2.1 -pytest-cov==4.0.0 -pytest-xdist==3.1.0 -python-dateutil==2.8.2 -python-json-logger==2.0.4 -pytz==2022.7.1 -PyYAML==6.0 -pyzmq==25.0.0 -qtconsole==5.4.0 -QtPy==2.3.0 -readme-renderer==37.3 -requests==2.28.2 -requests-toolbelt==0.10.1 -restructuredtext-lint==1.4.0 -rfc3339-validator==0.1.4 -rfc3986==2.0.0 -rfc3986-validator==0.1.1 -rich==13.3.1 -ruff==0.0.239 -scipy==1.10.0 -Send2Trash==1.8.0 -setuptools==67.1.0 -setuptools-scm==7.0.5 -six==1.16.0 -sniffio==1.3.0 -snowballstemmer==2.2.0 -soupsieve==2.3.2.post1 -Sphinx==4.5.0 -sphinxcontrib-applehelp==1.0.4 -sphinxcontrib-bibtex==2.5.0 -sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.1 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.5 -stack-data==0.6.2 -terminado==0.17.1 -tinycss2==1.2.1 -toml==0.10.2 -tomli==2.0.1 -tornado==6.2 -traitlets==5.9.0 -twine==4.0.2 -types-setuptools==65.6.0.1 -typing_extensions==4.4.0 -uri-template==1.2.0 -urllib3==1.26.14 -virtualenv==20.17.1 -wcwidth==0.2.6 -webcolors==1.12 -webencodings==0.5.1 -websocket-client==1.5.0 -wheel==0.38.4 -widgetsnbextension==4.0.5 -zipp==3.12.0 +accessible-pygments==0.0.4 ; python_version >= "3.9" and python_version < "3.12" +alabaster==0.7.13 ; python_version >= "3.9" and python_version < "3.12" +anyio==3.7.1 ; python_version >= "3.9" and python_version < "3.12" +appnope==0.1.3 ; python_version >= "3.9" and python_version < "3.12" and (platform_system == "Darwin" or sys_platform == "darwin") +argon2-cffi-bindings==21.2.0 ; python_version >= "3.9" and python_version < "3.12" +argon2-cffi==23.1.0 ; python_version >= "3.9" and python_version < "3.12" +arrow==1.2.3 ; python_version >= "3.9" and python_version < "3.12" +astor==0.8.1 ; python_version >= "3.9" and python_version < "3.12" +asttokens==2.2.1 ; python_version >= "3.9" and python_version < "3.12" +async-lru==2.0.4 ; python_version >= "3.9" and python_version < "3.12" +attrs==23.1.0 ; python_version >= "3.9" and python_version < "3.12" +babel==2.12.1 ; python_version >= "3.9" and python_version < "3.12" +backcall==0.2.0 ; python_version >= "3.9" and python_version < "3.12" +beautifulsoup4==4.12.2 ; python_version >= "3.9" and python_version < "3.12" +biblib-simple==0.1.2 ; python_version >= "3.9" and python_version < "3.12" +black==23.7.0 ; python_version >= "3.9" and python_version < "3.12" +blackdoc==0.3.8 ; python_version >= "3.9" and python_version < "3.12" +bleach==6.0.0 ; python_version >= "3.9" and python_version < "3.12" +certifi==2023.7.22 ; python_version >= "3.9" and python_version < "3.12" +cffi==1.15.1 ; python_version >= "3.9" and python_version < "3.12" +cfgv==3.4.0 ; python_version >= "3.9" and python_version < "3.12" +charset-normalizer==3.2.0 ; python_version >= "3.9" and python_version < "3.12" +click==8.1.7 ; python_version >= "3.9" and python_version < "3.12" +colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.12" and (sys_platform == "win32" or platform_system == "Windows") +colour-science==0.4.3 ; python_version >= "3.9" and python_version < "3.12" +comm==0.1.4 ; python_version >= "3.9" and python_version < "3.12" +contourpy==1.1.0 ; python_version >= "3.9" and python_version < "3.12" +coverage==6.5.0 ; python_version >= "3.9" and python_version < "3.12" +coverage[toml]==6.5.0 ; python_version >= "3.9" and python_version < "3.12" +coveralls==3.3.1 ; python_version >= "3.9" and python_version < "3.12" +cryptography==41.0.3 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "linux" +cycler==0.11.0 ; python_version >= "3.9" and python_version < "3.12" +debugpy==1.6.7.post1 ; python_version >= "3.9" and python_version < "3.12" +decorator==5.1.1 ; python_version >= "3.9" and python_version < "3.12" +defusedxml==0.7.1 ; python_version >= "3.9" and python_version < "3.12" +distlib==0.3.7 ; python_version >= "3.9" and python_version < "3.12" +docopt==0.6.2 ; python_version >= "3.9" and python_version < "3.12" +docutils==0.17.1 ; python_version >= "3.9" and python_version < "3.12" +exceptiongroup==1.1.3 ; python_version >= "3.9" and python_version < "3.11" +execnet==2.0.2 ; python_version >= "3.9" and python_version < "3.12" +executing==1.2.0 ; python_version >= "3.9" and python_version < "3.12" +fastjsonschema==2.18.0 ; python_version >= "3.9" and python_version < "3.12" +filelock==3.12.2 ; python_version >= "3.9" and python_version < "3.12" +flynt==1.0.1 ; python_version >= "3.9" and python_version < "3.12" +fonttools==4.42.1 ; python_version >= "3.9" and python_version < "3.12" +fqdn==1.5.1 ; python_version >= "3.9" and python_version < "3.12" +identify==2.5.27 ; python_version >= "3.9" and python_version < "3.12" +idna==3.4 ; python_version >= "3.9" and python_version < "3.12" +imageio==2.31.2 ; python_version >= "3.9" and python_version < "3.12" +imagesize==1.4.1 ; python_version >= "3.9" and python_version < "3.12" +importlib-metadata==6.8.0 ; python_version >= "3.9" and python_version < "3.12" +importlib-resources==6.0.1 ; python_version >= "3.9" and python_version < "3.10" +iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "3.12" +invoke==2.2.0 ; python_version >= "3.9" and python_version < "3.12" +ipykernel==6.25.1 ; python_version >= "3.9" and python_version < "3.12" +ipython-genutils==0.2.0 ; python_version >= "3.9" and python_version < "3.12" +ipython==8.14.0 ; python_version >= "3.9" and python_version < "3.12" +ipywidgets==8.1.0 ; python_version >= "3.9" and python_version < "3.12" +isoduration==20.11.0 ; python_version >= "3.9" and python_version < "3.12" +jaraco-classes==3.3.0 ; python_version >= "3.9" and python_version < "3.12" +jedi==0.19.0 ; python_version >= "3.9" and python_version < "3.12" +jeepney==0.8.0 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "linux" +jinja2==3.1.2 ; python_version >= "3.9" and python_version < "3.12" +json5==0.9.14 ; python_version >= "3.9" and python_version < "3.12" +jsonpointer==2.4 ; python_version >= "3.9" and python_version < "3.12" +jsonschema-specifications==2023.7.1 ; python_version >= "3.9" and python_version < "3.12" +jsonschema==4.19.0 ; python_version >= "3.9" and python_version < "3.12" +jsonschema[format-nongpl]==4.19.0 ; python_version >= "3.9" and python_version < "3.12" +jupyter-client==8.3.0 ; python_version >= "3.9" and python_version < "3.12" +jupyter-console==6.6.3 ; python_version >= "3.9" and python_version < "3.12" +jupyter-core==5.3.1 ; python_version >= "3.9" and python_version < "3.12" +jupyter-events==0.7.0 ; python_version >= "3.9" and python_version < "3.12" +jupyter-lsp==2.2.0 ; python_version >= "3.9" and python_version < "3.12" +jupyter-server-terminals==0.4.4 ; python_version >= "3.9" and python_version < "3.12" +jupyter-server==2.7.2 ; python_version >= "3.9" and python_version < "3.12" +jupyter==1.0.0 ; python_version >= "3.9" and python_version < "3.12" +jupyterlab-pygments==0.2.2 ; python_version >= "3.9" and python_version < "3.12" +jupyterlab-server==2.24.0 ; python_version >= "3.9" and python_version < "3.12" +jupyterlab-widgets==3.0.8 ; python_version >= "3.9" and python_version < "3.12" +jupyterlab==4.0.5 ; python_version >= "3.9" and python_version < "3.12" +keyring==24.2.0 ; python_version >= "3.9" and python_version < "3.12" +kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.12" +latexcodec==2.0.1 ; python_version >= "3.9" and python_version < "3.12" +markdown-it-py==3.0.0 ; python_version >= "3.9" and python_version < "3.12" +markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "3.12" +matplotlib-inline==0.1.6 ; python_version >= "3.9" and python_version < "3.12" +matplotlib==3.7.2 ; python_version >= "3.9" and python_version < "3.12" +mdurl==0.1.2 ; python_version >= "3.9" and python_version < "3.12" +mistune==3.0.1 ; python_version >= "3.9" and python_version < "3.12" +more-itertools==10.1.0 ; python_version >= "3.9" and python_version < "3.12" +mypy-extensions==1.0.0 ; python_version >= "3.9" and python_version < "3.12" +nbclient==0.8.0 ; python_version >= "3.9" and python_version < "3.12" +nbconvert==7.7.4 ; python_version >= "3.9" and python_version < "3.12" +nbformat==5.9.2 ; python_version >= "3.9" and python_version < "3.12" +nest-asyncio==1.5.7 ; python_version >= "3.9" and python_version < "3.12" +nodeenv==1.8.0 ; python_version >= "3.9" and python_version < "3.12" +notebook-shim==0.2.3 ; python_version >= "3.9" and python_version < "3.12" +notebook==7.0.2 ; python_version >= "3.9" and python_version < "3.12" +numpy==1.25.2 ; python_version >= "3.9" and python_version < "3.12" +overrides==7.4.0 ; python_version >= "3.9" and python_version < "3.12" +packaging==23.1 ; python_version >= "3.9" and python_version < "3.12" +pandocfilters==1.5.0 ; python_version >= "3.9" and python_version < "3.12" +parso==0.8.3 ; python_version >= "3.9" and python_version < "3.12" +pathspec==0.11.2 ; python_version >= "3.9" and python_version < "3.12" +pexpect==4.8.0 ; python_version >= "3.9" and python_version < "3.12" and sys_platform != "win32" +pickleshare==0.7.5 ; python_version >= "3.9" and python_version < "3.12" +pillow==10.0.0 ; python_version >= "3.9" and python_version < "3.12" +pkginfo==1.9.6 ; python_version >= "3.9" and python_version < "3.12" +platformdirs==3.10.0 ; python_version >= "3.9" and python_version < "3.12" +pluggy==1.3.0 ; python_version >= "3.9" and python_version < "3.12" +pre-commit==3.3.3 ; python_version >= "3.9" and python_version < "3.12" +prometheus-client==0.17.1 ; python_version >= "3.9" and python_version < "3.12" +prompt-toolkit==3.0.39 ; python_version >= "3.9" and python_version < "3.12" +psutil==5.9.5 ; python_version >= "3.9" and python_version < "3.12" +ptyprocess==0.7.0 ; python_version >= "3.9" and python_version < "3.12" and (sys_platform != "win32" or os_name != "nt") +pure-eval==0.2.2 ; python_version >= "3.9" and python_version < "3.12" +pybtex-docutils==1.0.3 ; python_version >= "3.9" and python_version < "3.12" +pybtex==0.24.0 ; python_version >= "3.9" and python_version < "3.12" +pycparser==2.21 ; python_version >= "3.9" and python_version < "3.12" +pydata-sphinx-theme==0.13.3 ; python_version >= "3.9" and python_version < "3.12" +pygments==2.16.1 ; python_version >= "3.9" and python_version < "3.12" +pyparsing==3.0.9 ; python_version >= "3.9" and python_version < "3.12" +pyright==1.1.324 ; python_version >= "3.9" and python_version < "3.12" +pytest-cov==4.1.0 ; python_version >= "3.9" and python_version < "3.12" +pytest-xdist==3.3.1 ; python_version >= "3.9" and python_version < "3.12" +pytest==7.4.0 ; python_version >= "3.9" and python_version < "3.12" +python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "3.12" +python-json-logger==2.0.7 ; python_version >= "3.9" and python_version < "3.12" +pywin32-ctypes==0.2.2 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32" +pywin32==306 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.9" and python_version < "3.12" +pywinpty==2.0.11 ; python_version >= "3.9" and python_version < "3.12" and os_name == "nt" +pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "3.12" +pyzmq==25.1.1 ; python_version >= "3.9" and python_version < "3.12" +qtconsole==5.4.3 ; python_version >= "3.9" and python_version < "3.12" +qtpy==2.3.1 ; python_version >= "3.9" and python_version < "3.12" +readme-renderer==41.0 ; python_version >= "3.9" and python_version < "3.12" +referencing==0.30.2 ; python_version >= "3.9" and python_version < "3.12" +requests-toolbelt==1.0.0 ; python_version >= "3.9" and python_version < "3.12" +requests==2.31.0 ; python_version >= "3.9" and python_version < "3.12" +restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "3.12" +rfc3339-validator==0.1.4 ; python_version >= "3.9" and python_version < "3.12" +rfc3986-validator==0.1.1 ; python_version >= "3.9" and python_version < "3.12" +rfc3986==2.0.0 ; python_version >= "3.9" and python_version < "3.12" +rich==13.5.2 ; python_version >= "3.9" and python_version < "3.12" +rpds-py==0.9.2 ; python_version >= "3.9" and python_version < "3.12" +ruff==0.0.286 ; python_version >= "3.9" and python_version < "3.12" +scipy==1.11.2 ; python_version >= "3.9" and python_version < "3.12" +secretstorage==3.3.3 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "linux" +send2trash==1.8.2 ; python_version >= "3.9" and python_version < "3.12" +setuptools==68.1.2 ; python_version >= "3.9" and python_version < "3.12" +six==1.16.0 ; python_version >= "3.9" and python_version < "3.12" +sniffio==1.3.0 ; python_version >= "3.9" and python_version < "3.12" +snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "3.12" +soupsieve==2.4.1 ; python_version >= "3.9" and python_version < "3.12" +sphinx==4.5.0 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-applehelp==1.0.4 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-bibtex==2.6.0 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-htmlhelp==2.0.1 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.9" and python_version < "3.12" +sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.9" and python_version < "3.12" +stack-data==0.6.2 ; python_version >= "3.9" and python_version < "3.12" +terminado==0.17.1 ; python_version >= "3.9" and python_version < "3.12" +tinycss2==1.2.1 ; python_version >= "3.9" and python_version < "3.12" +toml==0.10.2 ; python_version >= "3.9" and python_version < "3.12" +tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.12" +tornado==6.3.3 ; python_version >= "3.9" and python_version < "3.12" +traitlets==5.9.0 ; python_version >= "3.9" and python_version < "3.12" +twine==4.0.2 ; python_version >= "3.9" and python_version < "3.12" +typing-extensions==4.7.1 ; python_version >= "3.9" and python_version < "3.12" +uri-template==1.3.0 ; python_version >= "3.9" and python_version < "3.12" +urllib3==2.0.4 ; python_version >= "3.9" and python_version < "3.12" +virtualenv==20.24.3 ; python_version >= "3.9" and python_version < "3.12" +wcwidth==0.2.6 ; python_version >= "3.9" and python_version < "3.12" +webcolors==1.13 ; python_version >= "3.9" and python_version < "3.12" +webencodings==0.5.1 ; python_version >= "3.9" and python_version < "3.12" +websocket-client==1.6.2 ; python_version >= "3.9" and python_version < "3.12" +widgetsnbextension==4.0.8 ; python_version >= "3.9" and python_version < "3.12" +zipp==3.16.2 ; python_version >= "3.9" and python_version < "3.12" diff --git a/setup.py b/setup.py deleted file mode 100644 index 967acf2..0000000 --- a/setup.py +++ /dev/null @@ -1,81 +0,0 @@ -""" -Colour - Demosaicing - Setup -============================ -""" - -import codecs -from setuptools import setup - -packages = [ - "colour_demosaicing", - "colour_demosaicing.bayer", - "colour_demosaicing.bayer.demosaicing", - "colour_demosaicing.bayer.demosaicing.tests", - "colour_demosaicing.bayer.tests", -] - -package_data = { - "": ["*"], - "colour_demosaicing": [ - "examples/*", - "resources/colour-demosaicing-examples-datasets/*", - "resources/colour-demosaicing-tests-datasets/*", - ], -} - -install_requires = [ - "colour-science>=0.4.2", - "imageio>=2,<3", - "numpy>=1.20,<2", - "scipy>=1.7,<2", - "typing-extensions>=4,<5", -] - -extras_require = { - "development": [ - "biblib-simple", - "black", - "blackdoc", - "coverage!=6.3", - "coveralls", - "flake8", - "flynt", - "invoke", - "jupyter", - "mypy", - "pre-commit", - "pydata-sphinx-theme", - "pydocstyle", - "pytest", - "pytest-cov", - "pyupgrade", - "restructuredtext-lint", - "sphinx>=4,<5", - "sphinxcontrib-bibtex", - "toml", - "twine", - ], - "plotting": ["matplotlib>=3.5,!=3.5.0,!=3.5.1"], - "read-the-docs": [ - "matplotlib>=3.5,!=3.5.0,!=3.5.1", - "pydata-sphinx-theme", - "sphinxcontrib-bibtex", - ], -} - -setup( - name="colour-demosaicing", - version="0.2.3", - description="CFA (Colour Filter Array) Demosaicing Algorithms for Python", - long_description=codecs.open("README.rst", encoding="utf8").read(), - author="Colour Developers", - author_email="colour-developers@colour-science.org", - maintainer="Colour Developers", - maintainer_email="colour-developers@colour-science.org", - url="https://www.colour-science.org/", - packages=packages, - package_data=package_data, - install_requires=install_requires, - extras_require=extras_require, - python_requires=">=3.9,<3.12", -) diff --git a/tasks.py b/tasks.py index 092fcd8..0d0da18 100644 --- a/tasks.py +++ b/tasks.py @@ -309,9 +309,18 @@ def requirements(ctx: Context): message_box('Exporting "requirements.txt" file...') ctx.run( - "poetry run pip list --format=freeze | " - 'egrep -v "colour-demosaicing=" ' - "> requirements.txt" + "poetry export -f requirements.txt " + "--without-hashes " + "--with dev,docs,optional " + "--output requirements.txt" + ) + + message_box('Exporting "docs/requirements.txt" file...') + ctx.run( + "poetry export -f requirements.txt " + "--without-hashes " + "--with docs,optional " + "--output docs/requirements.txt" ) @@ -329,63 +338,6 @@ def build(ctx: Context): message_box("Building...") ctx.run("poetry build") - - with ctx.cd("dist"): - ctx.run(f"tar -xvf {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION}.tar.gz") - ctx.run(f"cp {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION}/setup.py ../") - - ctx.run(f"rm -rf {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION}") - - with open("setup.py") as setup_file: - source = setup_file.read() - - setup_kwargs = [] - - def sub_callable(match): - setup_kwargs.append(match) - - return "" - - template = """ -setup({0} -) -""" - - source = re.sub( - "from setuptools import setup", - ( - '"""\n' - "Colour - Demosaicing - Setup\n" - "============================\n" - '"""\n\n' - "import codecs\n" - "from setuptools import setup" - ), - source, - ) - source = re.sub( - "setup_kwargs = {(.*)}.*setup\\(\\*\\*setup_kwargs\\)", - sub_callable, - source, - flags=re.DOTALL, - )[:-2] - setup_kwargs = setup_kwargs[0].group(1).splitlines() - for i, line in enumerate(setup_kwargs): - setup_kwargs[i] = re.sub("^\\s*('(\\w+)':\\s?)", " \\2=", line) - if setup_kwargs[i].strip().startswith("long_description"): - setup_kwargs[i] = ( - " long_description=" - "codecs.open('README.rst', encoding='utf8')" - ".read()," - ) - - source += template.format("\n".join(setup_kwargs)) - - with open("setup.py", "w") as setup_file: - setup_file.write(source) - - ctx.run("poetry run pre-commit run --files setup.py || true") - ctx.run("twine check dist/*") @@ -414,7 +366,7 @@ def virtualise(ctx: Context, tests: bool = True): ) with ctx.cd(unique_name): - ctx.run('poetry install --extras "plotting"') + ctx.run("poetry install") ctx.run("source $(poetry env info -p)/bin/activate") ctx.run( 'python -c "import imageio;' @@ -443,7 +395,7 @@ def tag(ctx: Context): message_box("Tagging...") result = ctx.run("git rev-parse --abbrev-ref HEAD", hide="both") - if result.stdout.strip() == "develop": + if result.stdout.strip() == "develop": # pyright: ignore raise RuntimeError("Are you still on a feature or master branch?") with open(os.path.join(PYTHON_PACKAGE_NAME, "__init__.py")) as file_handle: @@ -467,7 +419,7 @@ def tag(ctx: Context): version = ".".join((major_version, minor_version, change_version)) result = ctx.run("git ls-remote --tags upstream", hide="both") - remote_tags = result.stdout.strip().split("\n") + remote_tags = result.stdout.strip().split("\n") # pyright: ignore tags = set() for remote_tag in remote_tags: tags.add( From 668f6dad65d2589ce500db9dea7cc6e6710fbd93 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:10:58 +1200 Subject: [PATCH 23/30] Update "TODO.rst" file. --- TODO.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO.rst b/TODO.rst index 3468929..7530102 100644 --- a/TODO.rst +++ b/TODO.rst @@ -6,12 +6,12 @@ TODO - colour_demosaicing/__init__.py - - Line 81 : # TODO: Remove legacy printing support when deemed appropriate. + - Line 82 : # TODO: Remove legacy printing support when deemed appropriate. About ----- | **Colour - Demosaicing** by Colour Developers -| Copyright 2015 Colour Developers – `colour-developers@colour-science.org `__ +| Copyright 2015 Colour Developers - `colour-developers@colour-science.org `__ | This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause | `https://github.com/colour-science/colour-demosaicing `__ From 49ce036d56f46f1b0a419c4f8f630f3d3c5c499a Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:11:42 +1200 Subject: [PATCH 24/30] Implement support for `Colour` 0.4.3. --- colour_demosaicing/bayer/masks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colour_demosaicing/bayer/masks.py b/colour_demosaicing/bayer/masks.py index d67b562..1c99bb1 100644 --- a/colour_demosaicing/bayer/masks.py +++ b/colour_demosaicing/bayer/masks.py @@ -71,7 +71,7 @@ def masks_CFA_Bayer( pattern = validate_method( pattern, - ["RGGB", "BGGR", "GRBG", "GBRG"], + ("RGGB", "BGGR", "GRBG", "GBRG"), '"{0}" CFA pattern is invalid, it must be one of {1}!', ).upper() From 08d719c29b2a212cb9d59955976f22fa6a5e65da Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:12:24 +1200 Subject: [PATCH 25/30] Fix various static typing issues. --- colour_demosaicing/bayer/demosaicing/menon2007.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/colour_demosaicing/bayer/demosaicing/menon2007.py b/colour_demosaicing/bayer/demosaicing/menon2007.py index 2ad8206..15a27d5 100644 --- a/colour_demosaicing/bayer/demosaicing/menon2007.py +++ b/colour_demosaicing/bayer/demosaicing/menon2007.py @@ -140,12 +140,7 @@ def demosaicing_CFA_Bayer_Menon2007( C_V = np.where(B_m == 1, B - G_V, C_V) D_H = np.abs(C_H - np.pad(C_H, ((0, 0), (0, 2)), mode="reflect")[:, 2:]) - D_V = np.abs( - C_V - - np.pad(C_V, ((0, 2), (0, 0)), mode="reflect")[ # pyright: ignore - 2:, : - ] - ) + D_V = np.abs(C_V - np.pad(C_V, ((0, 2), (0, 0)), mode="reflect")[2:, :]) del h_0, h_1, CFA, C_V, C_H From da429669e849b5199c9fceb9009762952dc24370 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:12:37 +1200 Subject: [PATCH 26/30] Fix various quality issues. --- colour_demosaicing/__init__.py | 2 +- utilities/export_todo.py | 4 ++-- utilities/unicode_to_ascii.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/colour_demosaicing/__init__.py b/colour_demosaicing/__init__.py index 0555121..d064db3 100644 --- a/colour_demosaicing/__init__.py +++ b/colour_demosaicing/__init__.py @@ -63,7 +63,7 @@ try: _version: str = ( subprocess.check_output( - ["git", "describe"], + ["git", "describe"], # noqa: S603, S607 cwd=os.path.dirname(__file__), stderr=subprocess.STDOUT, ) diff --git a/utilities/export_todo.py b/utilities/export_todo.py index 8ae5128..1efbe15 100755 --- a/utilities/export_todo.py +++ b/utilities/export_todo.py @@ -66,7 +66,7 @@ def extract_todo_items(root_directory: str) -> dict: if not filename.endswith(".py"): continue - filename = os.path.join(root, filename) + filename = os.path.join(root, filename) # noqa: PLW2901 with codecs.open(filename, encoding="utf8") as file_handle: content = file_handle.readlines() @@ -74,7 +74,7 @@ def extract_todo_items(root_directory: str) -> dict: line_number = 1 todo_item = [] for i, line in enumerate(content): - line = line.strip() + line = line.strip() # noqa: PLW2901 if line.startswith("# TODO:"): in_todo = True line_number = i + 1 diff --git a/utilities/unicode_to_ascii.py b/utilities/unicode_to_ascii.py index 14f4d5f..1320cae 100755 --- a/utilities/unicode_to_ascii.py +++ b/utilities/unicode_to_ascii.py @@ -55,7 +55,7 @@ def unicode_to_ascii(root_directory: str): if filename == "unicode_to_ascii.py": continue - filename = os.path.join(root, filename) + filename = os.path.join(root, filename) # noqa: PLW2901 with codecs.open(filename, encoding="utf8") as file_handle: content = file_handle.read() From 1e4b4a4028d7e01faba107855933c31d53dc1845 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:23:17 +1200 Subject: [PATCH 27/30] Update "README.rst" file. --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index f42d251..8e38612 100644 --- a/README.rst +++ b/README.rst @@ -67,11 +67,11 @@ Primary Dependencies **Colour - Demosaicing** requires various dependencies in order to run: -- `python >= 3.8, < 4 `__ -- `colour-science >= 4 `__ +- `python >= 3.9, < 4 `__ +- `colour-science >= 4.3 `__ - `imageio >= 2, < 3 `__ -- `numpy >= 1.19, < 2 `__ -- `scipy >= 1.5, < 2 `__ +- `numpy >= 1.22, < 2 `__ +- `scipy >= 1.8, < 2 `__ Pypi ~~~~ From de5fbd4be3c97457e392f63b229d4629440451f0 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:31:42 +1200 Subject: [PATCH 28/30] Update "conf.py" file. --- docs/conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 6ad9fbc..6944c67 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,8 +4,12 @@ """ import re +import sys +from pathlib import Path -import colour_demosaicing as package +sys.path.append(str(Path(__file__).parent.parent)) + +import colour_demosaicing as package # noqa: E402 basename = re.sub( "_(\\w)", lambda x: x.group(1).upper(), package.__name__.title() From 38e1ab564c9e0097b52206ad9cde23d0fd219fea Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:43:26 +1200 Subject: [PATCH 29/30] Update "tasks.py" file. --- tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 0d0da18..e6dd1ec 100644 --- a/tasks.py +++ b/tasks.py @@ -395,7 +395,7 @@ def tag(ctx: Context): message_box("Tagging...") result = ctx.run("git rev-parse --abbrev-ref HEAD", hide="both") - if result.stdout.strip() == "develop": # pyright: ignore + if result.stdout.strip() != "develop": # pyright: ignore raise RuntimeError("Are you still on a feature or master branch?") with open(os.path.join(PYTHON_PACKAGE_NAME, "__init__.py")) as file_handle: From d7dae18f1c2707e6e7050eb61a042fdf9b8b3543 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 27 Aug 2023 12:38:51 +1200 Subject: [PATCH 30/30] Raise package version to 0.2.4. --- colour_demosaicing/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/colour_demosaicing/__init__.py b/colour_demosaicing/__init__.py index d064db3..1796d42 100644 --- a/colour_demosaicing/__init__.py +++ b/colour_demosaicing/__init__.py @@ -55,7 +55,7 @@ __major_version__ = "0" __minor_version__ = "2" -__change_version__ = "3" +__change_version__ = "4" __version__ = ".".join( (__major_version__, __minor_version__, __change_version__) ) diff --git a/pyproject.toml b/pyproject.toml index 43302eb..1868f37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "colour-demosaicing" -version = "0.2.3" +version = "0.2.4" description = "CFA (Colour Filter Array) Demosaicing Algorithms for Python" license = "BSD-3-Clause" authors = [ "Colour Developers " ]