diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index adc2413ad..7af778fd1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -20,8 +20,8 @@ is available to guide the process: https://www.colour-science.org/contributing/. - [ ] New transformations have been added to the _Automatic Colour Conversion Graph_. - [ ] New transformations have been exported to the relevant namespaces, e.g. `colour`, `colour.models`. - - + + **Documentation** diff --git a/.github/workflows/continuous-integration-documentation.yml b/.github/workflows/continuous-integration-documentation.yml index 06cff95ff..1d2c2e244 100644 --- a/.github/workflows/continuous-integration-documentation.yml +++ b/.github/workflows/continuous-integration-documentation.yml @@ -29,20 +29,18 @@ jobs: run: | sudo apt-get update sudo apt-get --yes install graphviz graphviz-dev latexmk texlive-full - - name: Install Poetry + - name: Install uv run: | - curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - - echo "$HOME/.poetry/bin" >> $GITHUB_PATH + pip install uv shell: bash - name: Install Package Dependencies run: | - poetry run python -m pip install --upgrade pip - poetry install - poetry run python -c "import imageio;imageio.plugins.freeimage.download()" + uv sync --all-extras --no-dev + uv run python -c "import imageio;imageio.plugins.freeimage.download()" shell: bash - name: Build Documentation run: | - poetry run invoke docs + uv run invoke docs shell: bash - uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/continuous-integration-quality-unit-tests.yml b/.github/workflows/continuous-integration-quality-unit-tests.yml index 19183d668..4cd45e2b0 100644 --- a/.github/workflows/continuous-integration-quality-unit-tests.yml +++ b/.github/workflows/continuous-integration-quality-unit-tests.yml @@ -42,51 +42,36 @@ jobs: run: | sudo apt-get update sudo apt-get --yes install graphviz graphviz-dev - - name: Install Poetry + - name: Install uv run: | - curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 - - echo "$HOME/.poetry/bin" >> $GITHUB_PATH + pip install uv shell: bash - - name: Install Package Dependencies (macOs) - if: matrix.os == 'macOS-latest' - run: | - poetry run python -m pip install --upgrade pip - poetry install - - name: Install Package Dependencies (Ubuntu) - if: matrix.os == 'ubuntu-latest' - run: | - poetry run python -m pip install --upgrade pip - poetry install - poetry run python -c "import imageio;imageio.plugins.freeimage.download()" - shell: bash - - name: Install Package Dependencies (Windows) - if: matrix.os == 'windows-latest' + - name: Install Package Dependencies run: | - poetry run python -m pip install --upgrade pip - poetry install - poetry run python -c "import imageio;imageio.plugins.freeimage.download()" + uv sync --all-extras --no-dev + uv run python -c "import imageio;imageio.plugins.freeimage.download()" shell: bash - name: Install OpenImageIO (macOs) if: matrix.os == 'macOS-latest' && matrix.python-version == '3.12' run: | brew install openimageio - find /Users/runner/Library/Caches/pypoetry/virtualenvs/ -path "/Users/runner/Library/Caches/pypoetry/virtualenvs/*/lib/python3.12/site-packages" -type d -exec ln -s /opt/homebrew/Cellar/openimageio/*/lib/python*/site-packages/OpenImageIO/OpenImageIO*.so {}/OpenImageIO.so \; - poetry run python -c "import OpenImageIO;print(OpenImageIO.__version__)" + ln -s /opt/homebrew/Cellar/openimageio/*/lib/python*/site-packages/OpenImageIO/OpenImageIO*.so ./.venv/lib/python3.12/site-packages/OpenImageIO.so + uv run python -c "import OpenImageIO;print(OpenImageIO.__version__)" shell: bash - name: Pre-Commit (All Files) run: | - poetry run pre-commit run --all-files + uv run pre-commit run --all-files shell: bash - name: Test Optimised Python Execution run: | - poetry run python -OO -c "import $CI_PACKAGE" + uv run python -OO -c "import $CI_PACKAGE" shell: bash - name: Test with Pytest run: | - poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE + uv run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE shell: bash - name: Upload Coverage to coveralls.io if: matrix.os == 'macOS-latest' && matrix.python-version == '3.12' run: | - if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi + if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else uv run coveralls; fi shell: bash diff --git a/.github/workflows/continuous-integration-static-type-checking.yml b/.github/workflows/continuous-integration-static-type-checking.yml index 24c61ba63..20d0877a1 100644 --- a/.github/workflows/continuous-integration-static-type-checking.yml +++ b/.github/workflows/continuous-integration-static-type-checking.yml @@ -33,4 +33,4 @@ jobs: pip install -r requirements.txt - name: Static Type Checking run: | - pyright --skipunannotated + pyright --threads --skipunannotated diff --git a/.gitignore b/.gitignore index 360e0ee3c..6ea4c9488 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .fleet .idea .ipynb_checkpoints +.python-version .vs .vscode .sandbox @@ -20,5 +21,5 @@ docs/_static/Examples_*.png docs/_static/Plotting_*.png docs/_static/Tutorial_*.png docs/generated -poetry.lock references +uv.lock diff --git a/README.rst b/README.rst index 29a8006fe..7c932229d 100644 --- a/README.rst +++ b/README.rst @@ -326,6 +326,7 @@ Chromatic Adaptation - ``colour.adaptation`` .. code-block:: python sorted(colour.CHROMATIC_ADAPTATION_METHODS) + .. code-block:: text ['CIE 1994', 'CMCCAT2000', 'Fairchild 1990', 'Von Kries', 'Zhai 2018', 'vK20'] diff --git a/TODO.rst b/TODO.rst index cd5cac176..23e27055e 100644 --- a/TODO.rst +++ b/TODO.rst @@ -6,64 +6,70 @@ TODO - colour/__init__.py - - Line 878 : # TODO: Remove legacy printing support when deemed appropriate. + - Line 914 : # TODO: Remove legacy printing support when deemed appropriate. - colour/colorimetry/spectrum.py - - Line 1190 : # TODO: Provide support for fractional interval like 0.1, etc... + - Line 1176 : # TODO: Provide support for fractional interval like 0.1, etc... - colour/colorimetry/tristimulus_values.py - - Line 1071 : # TODO: Investigate code vectorisation. + - Line 1050 : # TODO: Investigate code vectorisation. - colour/appearance/ciecam02.py - - Line 377 : # TODO: Compute hue composition. + - Line 369 : # TODO: Compute hue composition. - colour/appearance/ciecam16.py - - Line 325 : # TODO: Compute hue composition. + - Line 322 : # TODO: Compute hue composition. - colour/appearance/cam16.py - - Line 313 : # TODO: Compute hue composition. + - Line 308 : # TODO: Compute hue composition. - colour/appearance/hellwig2022.py - - Line 355 : # TODO: Compute hue composition. + - Line 354 : # TODO: Compute hue composition. - colour/appearance/hunt.py - - Line 487 : # TODO: Implement hue quadrature & composition computation. - - Line 518 : # TODO: Implement whiteness-blackness :math:`Q_{wb}` computation. + - Line 478 : # TODO: Implement hue quadrature & composition computation. + - Line 509 : # TODO: Implement whiteness-blackness :math:`Q_{wb}` computation. - colour/appearance/rlab.py - - Line 287 : # TODO: Implement hue composition computation. + - Line 283 : # TODO: Implement hue composition computation. - colour/appearance/nayatani95.py - - Line 311 : # TODO: Implement hue quadrature & composition computation. - - Line 324 : # TODO: Investigate components usage. M_RG, M_YB = tsplit(colourfulness_components(C_RG, C_YB, brightness_ideal_white)) + - Line 307 : # TODO: Implement hue quadrature & composition computation. + - Line 318 : # TODO: Investigate components usage. M_RG, M_YB = tsplit(colourfulness_components(C_RG, C_YB, brightness_ideal_white)) - colour/appearance/llab.py - - Line 396 : # TODO: Implement hue composition computation. + - Line 362 : # TODO: Implement hue composition computation. - colour/recovery/tests/test_jiang2013.py - - Line 63 : # TODO: Last eigen value seems to be very sensitive and produce differences on ARM. + - Line 66 : # TODO: Last eigen value seems to be very sensitive and produce differences on ARM. + + +- colour/io/fichet2021.py + + - Line 644 : # TODO: Implement support for integration of bi-spectral component. + - Line 651 : # TODO: Implement support for re-binning component with non-uniform interval. - colour/io/ocio.py @@ -73,97 +79,105 @@ TODO - colour/io/ctl.py - - Line 64 : # TODO: Reinstate coverage when "ctlrender" is trivially available cross-platform. + - Line 65 : # TODO: Reinstate coverage when "ctlrender" is trivially available cross-platform. - colour/io/tests/test_ocio.py - - Line 39 : # TODO: Remove when "Pypi" wheel compatible with "ARM" on "macOS" is released. + - Line 37 : # TODO: Remove when "Pypi" wheel compatible with "ARM" on "macOS" is released. - colour/io/tests/test_ctl.py - - Line 41 : # TODO: Reinstate coverage when "ctlrender" is tivially available cross-platform. + - Line 39 : # TODO: Reinstate coverage when "ctlrender" is tivially available cross-platform. - colour/io/tests/test_image.py - - Line 314 : # TODO: Investigate "OIIO" behaviour here: 1.0 != 15360.0 image = read_image_OpenImageIO( os.path.join(ROOT_RESOURCES, 'Colour_Logo.png'), 'float16') self.assertIs(image.dtype, np.dtype('float16')) self.assertEqual(np.min(image), 0.0) self.assertEqual(np.max(image), 1.0) + - Line 321 : # TODO: Investigate "OIIO" behaviour here: 1.0 != 15360.0 image = read_image_OpenImageIO( os.path.join(ROOT_RESOURCES, 'Colour_Logo.png'), 'float16') self.assertIs(image.dtype, np.dtype('float16')) self.assertEqual(np.min(image), 0.0) self.assertEqual(np.max(image), 1.0) - colour/models/rgb/derivation.py - - Line 231 : # TODO: Investigate if we return an ndarray here with primaries and whitepoint stacked together. + - Line 230 : # TODO: Investigate if we return an ndarray here with primaries and whitepoint stacked together. - colour/models/rgb/tests/test_rgb_colourspace.py - - Line 348 : # TODO: Remove tests when dropping deprecated signature support. - - Line 551 : # TODO: Remove tests when dropping deprecated signature support. + - Line 340 : # TODO: Remove tests when dropping deprecated signature support. + - Line 541 : # TODO: Remove tests when dropping deprecated signature support. - colour/models/rgb/tests/test_derivation.py - - Line 339 : # TODO: Simplify that monster. + - Line 327 : # TODO: Simplify that monster. - colour/utilities/verbose.py - - Line 669 : # TODO: Implement support for "pyproject.toml" file whenever "TOML" is supported in the standard library. NOTE: A few clauses are not reached and a few packages are not available during continuous integration and are thus ignored for coverage. + - Line 795 : # TODO: Implement support for "pyproject.toml" file whenever "TOML" is supported in the standard library. NOTE: A few clauses are not reached and a few packages are not available during continuous integration and are thus ignored for coverage. + + +- colour/utilities/network.py + + - Line 587 : # TODO: Consider using an ordered set instead of a dict. + - Line 1064 : # TODO: Consider using ordered set. + - Line 1070 : # TODO: Consider using ordered set. + - Line 1907 : # TODO: Implement solid control flow based processing using a stack. - colour/utilities/array.py - - Line 577 : # TODO: Remove when https://github.com/numpy/numpy/issues/5718 is addressed. - - Line 865 : # TODO: Investigate behaviour on Windows. - - Line 922 : # TODO: Annotate with "Union[Literal['ignore', 'reference', '1', '100'], str]" when Python 3.7 is dropped. + - Line 573 : # TODO: Remove when https://github.com/numpy/numpy/issues/5718 is addressed. + - Line 853 : # TODO: Investigate behaviour on Windows. + - Line 914 : # TODO: Annotate with "Union[Literal['ignore', 'reference', '1', '100'], str]" when Python 3.7 is dropped. - colour/plotting/models.py - - Line 1939 : # TODO: Filter appropriate colour models. NOTE: "dtype=object" is required for ragged array support in "Numpy" 1.24.0. + - Line 1925 : # TODO: Filter appropriate colour models. NOTE: "dtype=object" is required for ragged array support in "Numpy" 1.24.0. - colour/plotting/graph.py - - Line 88 : # TODO: Investigate API to trigger the conversion graph build. + - Line 86 : # TODO: Investigate API to trigger the conversion graph build. - colour/plotting/common.py - - Line 870 : # TODO: Reassess according to https://github.com/matplotlib/matplotlib/issues/1077 - - Line 989 : # TODO: Consider using "MutableMapping" here. + - Line 864 : # TODO: Reassess according to https://github.com/matplotlib/matplotlib/issues/1077 + - Line 980 : # TODO: Consider using "MutableMapping" here. - colour/characterisation/aces_it.py - - Line 397 : # TODO: Remove when removing the "colour.sd_blackbody" definition warning. + - Line 395 : # TODO: Remove when removing the "colour.sd_blackbody" definition warning. - colour/characterisation/correction.py - - Line 461 : # TODO: Generalise polynomial expansion. + - Line 459 : # TODO: Generalise polynomial expansion. - colour/notation/munsell.py - - Line 1251 : # TODO: Consider refactoring implementation. + - Line 1236 : # TODO: Consider refactoring implementation. - colour/continuous/signal.py - - Line 424 : # TODO: Check for interpolator compatibility. - - Line 484 : # TODO: Check for extrapolator compatibility. + - Line 422 : # TODO: Check for interpolator compatibility. + - Line 482 : # TODO: Check for extrapolator compatibility. - colour/hints/__init__.py - - Line 135 : # TODO: Revisit to use Protocol. + - Line 137 : # TODO: Revisit to use Protocol. - colour/algebra/tests/test_interpolation.py - - Line 1176 : # TODO: Revisit if the interpolator can be applied on non-uniform "x" independent variable. + - Line 1168 : # TODO: Revisit if the interpolator can be applied on non-uniform "x" independent variable. About ----- diff --git a/colour/blindness/machado2009.py b/colour/blindness/machado2009.py index bb815413f..8eaeb1826 100644 --- a/colour/blindness/machado2009.py +++ b/colour/blindness/machado2009.py @@ -120,17 +120,17 @@ def matrix_RGB_to_WSYBRG( R, G, B = tsplit(primaries.values) - WS_R = np.trapz(R * WS, wavelengths) # pyright: ignore - WS_G = np.trapz(G * WS, wavelengths) # pyright: ignore - WS_B = np.trapz(B * WS, wavelengths) # pyright: ignore + WS_R = np.trapezoid(R * WS, wavelengths) # pyright: ignore + WS_G = np.trapezoid(G * WS, wavelengths) # pyright: ignore + WS_B = np.trapezoid(B * WS, wavelengths) # pyright: ignore - YB_R = np.trapz(R * YB, wavelengths) # pyright: ignore - YB_G = np.trapz(G * YB, wavelengths) # pyright: ignore - YB_B = np.trapz(B * YB, wavelengths) # pyright: ignore + YB_R = np.trapezoid(R * YB, wavelengths) # pyright: ignore + YB_G = np.trapezoid(G * YB, wavelengths) # pyright: ignore + YB_B = np.trapezoid(B * YB, wavelengths) # pyright: ignore - RG_R = np.trapz(R * RG, wavelengths) # pyright: ignore - RG_G = np.trapz(G * RG, wavelengths) # pyright: ignore - RG_B = np.trapz(B * RG, wavelengths) # pyright: ignore + RG_R = np.trapezoid(R * RG, wavelengths) # pyright: ignore + RG_G = np.trapezoid(G * RG, wavelengths) # pyright: ignore + RG_B = np.trapezoid(B * RG, wavelengths) # pyright: ignore M_G = as_float_array( [ @@ -219,8 +219,8 @@ def msds_cmfs_anomalous_trichromacy_Machado2009( "deuteranomaly simulation." ) - area_L = np.trapz(L, cmfs.wavelengths) # pyright: ignore - area_M = np.trapz(M, cmfs.wavelengths) # pyright: ignore + area_L = np.trapezoid(L, cmfs.wavelengths) # pyright: ignore + area_M = np.trapezoid(M, cmfs.wavelengths) # pyright: ignore def alpha(x: NDArrayFloat) -> NDArrayFloat: """Compute :math:`alpha` factor.""" diff --git a/colour/colorimetry/photometry.py b/colour/colorimetry/photometry.py index 3f12adf67..e90c369c6 100644 --- a/colour/colorimetry/photometry.py +++ b/colour/colorimetry/photometry.py @@ -84,7 +84,7 @@ def luminous_flux( extrapolator_kwargs={"method": "Constant", "left": 0, "right": 0}, ) - flux = K_m * np.trapz(lef.values * sd.values, sd.wavelengths) # pyright: ignore + flux = K_m * np.trapezoid(lef.values * sd.values, sd.wavelengths) # pyright: ignore return as_float_scalar(flux) @@ -130,9 +130,9 @@ def luminous_efficiency( extrapolator_kwargs={"method": "Constant", "left": 0, "right": 0}, ) - efficiency = np.trapz( # pyright: ignore + efficiency = np.trapezoid( # pyright: ignore lef.values * sd.values, sd.wavelengths - ) / np.trapz( # pyright: ignore + ) / np.trapezoid( # pyright: ignore sd.values, sd.wavelengths ) diff --git a/colour/colorimetry/spectrum.py b/colour/colorimetry/spectrum.py index bf9b8c207..6ec7eb96e 100644 --- a/colour/colorimetry/spectrum.py +++ b/colour/colorimetry/spectrum.py @@ -398,7 +398,7 @@ def __contains__(self, wavelength: ArrayLike) -> bool: return bool( np.all( - np.in1d( # pyright: ignore + np.isin( # pyright: ignore np.around( wavelength, # pyright: ignore decimals, diff --git a/colour/continuous/signal.py b/colour/continuous/signal.py index dfd7594a5..d49b5008d 100644 --- a/colour/continuous/signal.py +++ b/colour/continuous/signal.py @@ -794,7 +794,7 @@ def __setitem__(self, x: ArrayLike | slice, y: ArrayLike): y = np.resize(y, x.shape) # Matching domain, updating existing `self._range` values. - mask = np.in1d(x, self._domain) # pyright: ignore + mask = np.isin(x, self._domain) # pyright: ignore x_m = x[mask] indexes = np.searchsorted(self._domain, x_m) self._range[indexes] = y[mask] @@ -1181,7 +1181,7 @@ def signal_unpack_data( if isinstance(data, Signal): domain_unpacked = data.domain range_unpacked = data.range - elif issubclass(type(data), Sequence) or isinstance( + elif issubclass(type(data), Sequence) or isinstance( # pyright: ignore data, (tuple, list, np.ndarray, Iterator, ValuesView) ): data_array = ( @@ -1196,7 +1196,7 @@ def signal_unpack_data( np.arange(0, data_array.size, dtype=dtype), data_array, ) - elif issubclass(type(data), Mapping) or isinstance(data, dict): + elif issubclass(type(data), Mapping) or isinstance(data, dict): # pyright: ignore domain_unpacked, range_unpacked = tsplit( sorted(cast(Mapping, data).items()) ) diff --git a/colour/hints/__init__.py b/colour/hints/__init__.py index 7918cf308..5ad30d7b4 100644 --- a/colour/hints/__init__.py +++ b/colour/hints/__init__.py @@ -218,6 +218,9 @@ def apply(self, RGB: ArrayLike, **kwargs: Any) -> NDArray: # noqa: D102 "CAM16LCD", "CAM16SCD", "CAM16UCS", + "CIE 1931", + "CIE 1960 UCS", + "CIE 1976 UCS", "CIE Lab", "CIE Luv", "CIE UCS", diff --git a/colour/io/fichet2021.py b/colour/io/fichet2021.py index 5b1cf0a10..640099088 100644 --- a/colour/io/fichet2021.py +++ b/colour/io/fichet2021.py @@ -349,7 +349,7 @@ def from_spectral_image(path: str | Path) -> Specification_Fichet2021: True """ - from OpenImageIO import ImageInput + from OpenImageIO import ImageInput # pyright: ignore path = str(path) @@ -478,7 +478,7 @@ def read_spectral_image_Fichet2021( True """ - from OpenImageIO import ImageInput + from OpenImageIO import ImageInput # pyright: ignore path = str(path) @@ -634,7 +634,7 @@ def components_to_sRGB_Fichet2021( EV """ - from OpenImageIO import TypeDesc + from OpenImageIO import TypeDesc # pyright: ignore component = components.get("S0", components.get("T")) @@ -777,7 +777,7 @@ def write_spectral_image_Fichet2021( True """ - from OpenImageIO import ImageBuf, ImageBufAlgo + from OpenImageIO import ImageBuf, ImageBufAlgo # pyright: ignore path = str(path) diff --git a/colour/io/image.py b/colour/io/image.py index 30c60eb9f..dda500a61 100644 --- a/colour/io/image.py +++ b/colour/io/image.py @@ -112,7 +112,8 @@ class Image_Specification_Attribute: if is_openimageio_installed(): # pragma: no cover - from OpenImageIO import DOUBLE, FLOAT, HALF, UINT8, UINT16, ImageSpec + from OpenImageIO import ImageSpec # pyright: ignore + from OpenImageIO import DOUBLE, FLOAT, HALF, UINT8, UINT16 # pyright: ignore MAPPING_BIT_DEPTH: CanonicalMapping = CanonicalMapping( { @@ -237,7 +238,7 @@ def image_specification_OpenImageIO( """ # noqa: D405, D407, D410, D411 - from OpenImageIO import ImageSpec + from OpenImageIO import ImageSpec # pyright: ignore attributes = cast(list, optional(attributes, [])) @@ -377,7 +378,7 @@ def read_image_OpenImageIO( >>> image = read_image_OpenImageIO(path) # doctest: +SKIP """ - from OpenImageIO import ImageInput + from OpenImageIO import ImageInput # pyright: ignore path = str(path) @@ -656,7 +657,7 @@ def write_image_OpenImageIO( ... write_image_OpenImageIO(image, path, attributes=attributes) """ # noqa: D405, D407, D410, D411 - from OpenImageIO import ImageOutput + from OpenImageIO import ImageOutput # pyright: ignore image = as_float_array(image) path = str(path) diff --git a/colour/notation/hexadecimal.py b/colour/notation/hexadecimal.py index 998dd9b8a..0a17d4cdb 100644 --- a/colour/notation/hexadecimal.py +++ b/colour/notation/hexadecimal.py @@ -120,7 +120,7 @@ def HEX_to_RGB(HEX: ArrayLike) -> NDArrayFloat: array([ 0.6666666..., 0.8666666..., 1. ]) """ - HEX = np.core.defchararray.lstrip(HEX, "#") # pyright: ignore + HEX = np.char.lstrip(HEX, "#") # pyright: ignore def to_RGB(x: list) -> list: """Convert given hexadecimal representation to *RGB*.""" diff --git a/colour/utilities/array.py b/colour/utilities/array.py index 19ce1492f..eec230bcd 100644 --- a/colour/utilities/array.py +++ b/colour/utilities/array.py @@ -239,7 +239,7 @@ class MixinDataclassArray(MixinDataclassIterable): - :class:`colour.utilities.MixinDataclassFields` """ - def __array__(self, dtype: Type[DTypeReal] | None = None) -> NDArray: + def __array__(self, dtype: Type[DTypeReal] | None = None, copy=None) -> NDArray: """ Implement support for :class:`dataclass`-like class conversion to :class:`numpy.ndarray` class. @@ -253,6 +253,9 @@ def __array__(self, dtype: Type[DTypeReal] | None = None) -> NDArray: :class:`numpy.dtype` to use for conversion to `np.ndarray`, default to the :class:`numpy.dtype` defined by :attr:`colour.constant.DTYPE_FLOAT_DEFAULT` attribute. + copy + Whether to return a copy of the underlying data, will always be + `True`, irrespective of the parameter value. Returns ------- @@ -2090,7 +2093,7 @@ def in_array(a: ArrayLike, b: ArrayLike, tolerance: Real = EPSILON) -> NDArray: -------- >>> a = np.array([0.50, 0.60]) >>> b = np.linspace(0, 10, 101) - >>> np.in1d(a, b) + >>> np.isin(a, b) array([ True, False], dtype=bool) >>> in_array(a, b) array([ True, True], dtype=bool) diff --git a/colour/utilities/tests/test_array.py b/colour/utilities/tests/test_array.py index 42476cb90..80d6f42ed 100644 --- a/colour/utilities/tests/test_array.py +++ b/colour/utilities/tests/test_array.py @@ -277,7 +277,7 @@ def test__array__(self): method. """ - np.testing.assert_array_equal(np.array(self._data), self._array) + np.testing.assert_array_equal(self._data, self._array) assert np.array(self._data, dtype=DTYPE_INT_DEFAULT).dtype == DTYPE_INT_DEFAULT @@ -344,61 +344,61 @@ def test_arithmetical_operation(self): """ np.testing.assert_allclose( - np.array(self._data.arithmetical_operation(10, "+", False)), + self._data.arithmetical_operation(10, "+", False), self._array + 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data.arithmetical_operation(10, "-", False)), + self._data.arithmetical_operation(10, "-", False), self._array - 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data.arithmetical_operation(10, "*", False)), + self._data.arithmetical_operation(10, "*", False), self._array * 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data.arithmetical_operation(10, "/", False)), + self._data.arithmetical_operation(10, "/", False), self._array / 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data.arithmetical_operation(10, "**", False)), + self._data.arithmetical_operation(10, "**", False), self._array**10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data + 10), + self._data + 10, self._array + 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data - 10), + self._data - 10, self._array - 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data * 10), + self._data * 10, self._array * 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data / 10), + self._data / 10, self._array / 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(self._data**10), + self._data**10, self._array**10, atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -406,31 +406,31 @@ def test_arithmetical_operation(self): data = deepcopy(self._data) np.testing.assert_allclose( - np.array(data.arithmetical_operation(10, "+", True)), + data.arithmetical_operation(10, "+", True), self._array + 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(data.arithmetical_operation(10, "-", True)), + data.arithmetical_operation(10, "-", True), self._array, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(data.arithmetical_operation(10, "*", True)), + data.arithmetical_operation(10, "*", True), self._array * 10, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(data.arithmetical_operation(10, "/", True)), + data.arithmetical_operation(10, "/", True), self._array, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(data.arithmetical_operation(10, "**", True)), + data.arithmetical_operation(10, "**", True), self._array**10, atol=TOLERANCE_ABSOLUTE_TESTS, ) @@ -438,13 +438,13 @@ def test_arithmetical_operation(self): data = deepcopy(self._data) np.testing.assert_allclose( - np.array(data.arithmetical_operation(self._array, "+", False)), + data.arithmetical_operation(self._array, "+", False), data + self._array, atol=TOLERANCE_ABSOLUTE_TESTS, ) np.testing.assert_allclose( - np.array(data.arithmetical_operation(data, "+", False)), + data.arithmetical_operation(data, "+", False), data + data, atol=TOLERANCE_ABSOLUTE_TESTS, ) diff --git a/docs/index.rst b/docs/index.rst index 9a81fed69..84bb031d3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -99,9 +99,11 @@ Chromatic Adaptation - ``colour.adaptation`` .. code-block:: python + sorted(colour.CHROMATIC_ADAPTATION_METHODS) .. code-block:: text + ['CIE 1994', 'CMCCAT2000', 'Fairchild 1990', 'Von Kries', 'Zhai 2018', 'vK20'] diff --git a/docs/requirements.txt b/docs/requirements.txt index bfb090a97..34a95c512 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,56 +1,59 @@ -accessible-pygments==0.0.5 ; python_version >= "3.10" and python_version < "3.13" -alabaster==0.7.16 ; python_version >= "3.10" and python_version < "3.13" -babel==2.15.0 ; python_version >= "3.10" and python_version < "3.13" -beautifulsoup4==4.12.3 ; python_version >= "3.10" and python_version < "3.13" -biblib-simple==0.1.2 ; python_version >= "3.10" and python_version < "3.13" -certifi==2024.7.4 ; python_version >= "3.10" and python_version < "3.13" -charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "3.13" -colorama==0.4.6 ; python_version >= "3.10" and python_version < "3.13" and (platform_system == "Windows" or sys_platform == "win32") -contourpy==1.2.1 ; python_version >= "3.10" and python_version < "3.13" -cycler==0.12.1 ; python_version >= "3.10" and python_version < "3.13" -docutils==0.21.2 ; python_version >= "3.10" and python_version < "3.13" -fonttools==4.53.1 ; python_version >= "3.10" and python_version < "3.13" -idna==3.7 ; python_version >= "3.10" and python_version < "3.13" -imageio==2.34.2 ; python_version >= "3.10" and python_version < "3.13" -imagesize==1.4.1 ; python_version >= "3.10" and python_version < "3.13" -jinja2==3.1.4 ; python_version >= "3.10" and python_version < "3.13" -kiwisolver==1.4.5 ; python_version >= "3.10" and python_version < "3.13" -latexcodec==3.0.0 ; python_version >= "3.10" and python_version < "3.13" -markupsafe==2.1.5 ; python_version >= "3.10" and python_version < "3.13" -matplotlib==3.9.1 ; python_version >= "3.10" and python_version < "3.13" -networkx==3.3 ; python_version >= "3.10" and python_version < "3.13" -numpy==2.0.0 ; python_version >= "3.10" and python_version < "3.13" -opencolorio==2.3.2 ; python_version >= "3.10" and python_version < "3.13" -packaging==24.1 ; python_version >= "3.10" and python_version < "3.13" -pandas==2.2.2 ; python_version >= "3.10" and python_version < "3.13" -pillow==10.4.0 ; python_version >= "3.10" and python_version < "3.13" -pybtex==0.24.0 ; python_version >= "3.10" and python_version < "3.13" -pybtex-docutils==1.0.3 ; python_version >= "3.10" and python_version < "3.13" -pydata-sphinx-theme==0.15.4 ; python_version >= "3.10" and python_version < "3.13" -pygments==2.18.0 ; python_version >= "3.10" and python_version < "3.13" -pygraphviz==1.13 ; python_version >= "3.10" and python_version < "3.13" -pyparsing==3.1.2 ; python_version >= "3.10" and python_version < "3.13" -python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "3.13" -pytz==2024.1 ; python_version >= "3.10" and python_version < "3.13" -pyyaml==6.0.1 ; python_version >= "3.10" and python_version < "3.13" -requests==2.32.3 ; python_version >= "3.10" and python_version < "3.13" -restructuredtext-lint==1.4.0 ; python_version >= "3.10" and python_version < "3.13" -scipy==1.14.0 ; python_version >= "3.10" and python_version < "3.13" -six==1.16.0 ; python_version >= "3.10" and python_version < "3.13" -snowballstemmer==2.2.0 ; python_version >= "3.10" and python_version < "3.13" -soupsieve==2.5 ; python_version >= "3.10" and python_version < "3.13" -sphinx==7.3.7 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-applehelp==1.0.8 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-bibtex==2.6.2 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-devhelp==1.0.6 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-htmlhelp==2.0.5 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-qthelp==1.0.7 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-serializinghtml==1.1.10 ; python_version >= "3.10" and python_version < "3.13" -tomli==2.0.1 ; python_version >= "3.10" and python_version < "3.11" -tqdm==4.66.4 ; python_version >= "3.10" and python_version < "3.13" -trimesh==4.4.2 ; python_version >= "3.10" and python_version < "3.13" -typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "3.13" -tzdata==2024.1 ; python_version >= "3.10" and python_version < "3.13" -urllib3==2.2.2 ; python_version >= "3.10" and python_version < "3.13" -xxhash==3.4.1 ; python_version >= "3.10" and python_version < "3.13" +# This file was autogenerated by uv via the following command: +# uv export --no-hashes --all-extras --no-dev +accessible-pygments==0.0.5 +alabaster==1.0.0 +babel==2.16.0 +beautifulsoup4==4.12.3 +biblib-simple==0.1.2 +certifi==2024.8.30 +charset-normalizer==3.3.2 +colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows' +contourpy==1.3.0 +cycler==0.12.1 +docutils==0.21.2 +fonttools==4.54.1 +idna==3.10 +imageio==2.35.1 +imagesize==1.4.1 +jinja2==3.1.4 +kiwisolver==1.4.7 +latexcodec==3.0.0 +markupsafe==3.0.1 +matplotlib==3.9.2 +networkx==3.3 +numpy==2.1.2 +opencolorio==2.4.0 +packaging==24.1 +pandas==2.2.3 +pillow==10.4.0 +pybtex==0.24.0 +pybtex-docutils==1.0.3 +pydata-sphinx-theme==0.15.4 +pydot==3.0.2 +pygments==2.18.0 +pyparsing==3.1.4 +python-dateutil==2.9.0.post0 +pytz==2024.2 +pyyaml==6.0.2 +requests==2.32.3 +restructuredtext-lint==1.4.0 +scipy==1.14.1 +setuptools==75.1.0 ; python_full_version >= '3.12' +six==1.16.0 +snowballstemmer==2.2.0 +soupsieve==2.6 +sphinx==8.0.2 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-bibtex==2.6.3 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 +tomli==2.0.2 ; python_full_version < '3.11' +tqdm==4.66.5 +trimesh==4.4.9 +typing-extensions==4.12.2 +tzdata==2024.2 +urllib3==2.2.3 +xxhash==3.5.0 diff --git a/pyproject.toml b/pyproject.toml index 54d86e8b5..ad7897217 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,16 @@ -[tool.poetry] +[project] name = "colour-science" -packages = [{ include = "colour" }] version = "0.4.4" description = "Colour Science for Python" -license = "BSD-3-Clause" -authors = ["Colour Developers "] -maintainers = ["Colour Developers "] -readme = 'README.rst' -repository = "https://github.com/colour-science/colour" -homepage = "https://www.colour-science.org/" +readme = "README.rst" +requires-python = ">=3.10,<3.13" +authors = [ + { name = "Colour Developers", email = "colour-developers@colour-science.org" }, +] +maintainers = [ + { name = "Colour Developers", email = "colour-developers@colour-science.org" } +] +license = { text = "BSD-3-Clause" } keywords = [ "color", "color-science", @@ -42,49 +44,69 @@ classifiers = [ "Topic :: Scientific/Engineering", "Topic :: Software Development", ] +dependencies = [ + "imageio>=2,<3", + "numpy>=1.24,<3", + "scipy>=1.10,<2", + "trimesh>=1.16.1", + "typing-extensions>=4,<5", +] -[tool.poetry.dependencies] -python = ">= 3.10, < 3.13" -imageio = ">= 2, < 3" -numpy = ">= 1.24, < 3" -scipy = ">= 1.10, < 2" -typing-extensions = ">= 4, < 5" +[project.optional-dependencies] +optional = [ + "matplotlib>=3.6", + "networkx>=3,<4", + "opencolorio>=2,<3", + "pandas>=1.5,<3", + "pydot>=3,<4", + "tqdm>=4,<5", + "xxhash>=3,<4", +] +docs = [ + "biblib-simple", + "pydata-sphinx-theme", + "restructuredtext-lint", + "sphinx", + "sphinxcontrib-bibtex", +] +meshing = [ + "trimesh>=4,<5", +] -[tool.poetry.group.optional.dependencies] -matplotlib = ">= 3.6" -networkx = ">= 3, < 4" -opencolorio = ">= 2, < 3" -pandas = ">= 1.5, < 3" -pydot = ">= 3, < 4" -tqdm = ">= 4, < 5" -xxhash = ">= 3.2, < 4" +[project.urls] +Homepage = "https://www.colour-science.org" +Documentation = "https://readthedocs.org" +Repository = "https://github.com/colour-science/colour" +Issues = "https://github.com/colour-science/colour/issues" +Changelog = "https://github.com/colour-science/colour/releases" -[tool.poetry.group.meshing.dependencies] -trimesh = ">= 3, < 5" +[tool.uv] +package = true +dev-dependencies = [ + "coverage>=6,<7", + "coveralls", + "hatch", + "invoke", + "jupyter", + "pre-commit>=3.5", + "pyright!=1.1.383", + "pytest", + "pytest-cov", + "pytest-xdist", + "toml", + "twine", +] -[tool.poetry.group.dev.dependencies] -coverage = ">= 6, < 7" -coveralls = "*" -invoke = "*" -jupyter = "*" -pre-commit = ">= 3.5" -pyright = "*" -pytest = "*" -pytest-cov = "*" -pytest-xdist = "*" -toml = "*" -twine = "*" +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" -[tool.poetry.group.docs.dependencies] -biblib-simple = "*" -pydata-sphinx-theme = "*" -restructuredtext-lint = "*" -sphinx = "*" -sphinxcontrib-bibtex = "*" +[tool.hatch.build.targets.wheel] +packages = [ "colour" ] [tool.codespell] -ignore-words-list = 'co-ordinates,exitance,hart,ist' -skip = 'BIBLIOGRAPHY.bib,CONTRIBUTORS.rst' +ignore-words-list = "co-ordinates,exitance,hart,ist" +skip = "BIBLIOGRAPHY.bib,CONTRIBUTORS.rst" [tool.flynt] line_length = 999 @@ -160,7 +182,7 @@ select = [ "PL", # pylint # "PT", # flake8-pytest-style # "PTH", # flake8-use-pathlib [Enable] - "Q", # flake8-quotes + "Q", # flake8-quotes "RET", # flake8-return "RUF", # Ruff "S", # flake8-bandit @@ -223,7 +245,3 @@ convention = "numpy" [tool.ruff.format] docstring-code-format = true - -[build-system] -requires = ["poetry_core>=1.0.0"] -build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt index 97bf4dd75..35b12a3ca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,184 +1,194 @@ -accessible-pygments==0.0.5 ; python_version >= "3.10" and python_version < "3.13" -alabaster==0.7.16 ; python_version >= "3.10" and python_version < "3.13" -anyio==4.4.0 ; python_version >= "3.10" and python_version < "3.13" -appnope==0.1.4 ; python_version >= "3.10" and python_version < "3.13" and platform_system == "Darwin" -argon2-cffi==23.1.0 ; python_version >= "3.10" and python_version < "3.13" -argon2-cffi-bindings==21.2.0 ; python_version >= "3.10" and python_version < "3.13" -arrow==1.3.0 ; python_version >= "3.10" and python_version < "3.13" -asttokens==2.4.1 ; python_version >= "3.10" and python_version < "3.13" -async-lru==2.0.4 ; python_version >= "3.10" and python_version < "3.13" -attrs==23.2.0 ; python_version >= "3.10" and python_version < "3.13" -babel==2.15.0 ; python_version >= "3.10" and python_version < "3.13" -backports-tarfile==1.2.0 ; python_version >= "3.10" and python_version < "3.12" -beautifulsoup4==4.12.3 ; python_version >= "3.10" and python_version < "3.13" -biblib-simple==0.1.2 ; python_version >= "3.10" and python_version < "3.13" -bleach==6.1.0 ; python_version >= "3.10" and python_version < "3.13" -certifi==2024.7.4 ; python_version >= "3.10" and python_version < "3.13" -cffi==1.16.0 ; python_version >= "3.10" and python_version < "3.13" -cfgv==3.4.0 ; python_version >= "3.10" and python_version < "3.13" -charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "3.13" -colorama==0.4.6 ; python_version >= "3.10" and python_version < "3.13" and (platform_system == "Windows" or sys_platform == "win32") -comm==0.2.2 ; python_version >= "3.10" and python_version < "3.13" -contourpy==1.2.1 ; python_version >= "3.10" and python_version < "3.13" -coverage==6.5.0 ; python_version >= "3.10" and python_version < "3.13" -coverage[toml]==6.5.0 ; python_version >= "3.10" and python_version < "3.13" -coveralls==4.0.1 ; python_version >= "3.10" and python_version < "3.13" -cryptography==42.0.8 ; python_version >= "3.10" and python_version < "3.13" and sys_platform == "linux" -cycler==0.12.1 ; python_version >= "3.10" and python_version < "3.13" -debugpy==1.8.2 ; python_version >= "3.10" and python_version < "3.13" -decorator==5.1.1 ; python_version >= "3.10" and python_version < "3.13" -defusedxml==0.7.1 ; python_version >= "3.10" and python_version < "3.13" -distlib==0.3.8 ; python_version >= "3.10" and python_version < "3.13" -docopt==0.6.2 ; python_version >= "3.10" and python_version < "3.13" -docutils==0.21.2 ; python_version >= "3.10" and python_version < "3.13" -exceptiongroup==1.2.1 ; python_version >= "3.10" and python_version < "3.11" -execnet==2.1.1 ; python_version >= "3.10" and python_version < "3.13" -executing==2.0.1 ; python_version >= "3.10" and python_version < "3.13" -fastjsonschema==2.20.0 ; python_version >= "3.10" and python_version < "3.13" -filelock==3.15.4 ; python_version >= "3.10" and python_version < "3.13" -fonttools==4.53.1 ; python_version >= "3.10" and python_version < "3.13" -fqdn==1.5.1 ; python_version >= "3.10" and python_version < "3.13" -h11==0.14.0 ; python_version >= "3.10" and python_version < "3.13" -httpcore==1.0.5 ; python_version >= "3.10" and python_version < "3.13" -httpx==0.27.0 ; python_version >= "3.10" and python_version < "3.13" -identify==2.6.0 ; python_version >= "3.10" and python_version < "3.13" -idna==3.7 ; python_version >= "3.10" and python_version < "3.13" -imageio==2.34.2 ; python_version >= "3.10" and python_version < "3.13" -imagesize==1.4.1 ; python_version >= "3.10" and python_version < "3.13" -importlib-metadata==8.0.0 ; python_version >= "3.10" and python_version < "3.13" -iniconfig==2.0.0 ; python_version >= "3.10" and python_version < "3.13" -invoke==2.2.0 ; python_version >= "3.10" and python_version < "3.13" -ipykernel==6.29.5 ; python_version >= "3.10" and python_version < "3.13" -ipython==8.26.0 ; python_version >= "3.10" and python_version < "3.13" -ipywidgets==8.1.3 ; python_version >= "3.10" and python_version < "3.13" -isoduration==20.11.0 ; python_version >= "3.10" and python_version < "3.13" -jaraco-classes==3.4.0 ; python_version >= "3.10" and python_version < "3.13" -jaraco-context==5.3.0 ; python_version >= "3.10" and python_version < "3.13" -jaraco-functools==4.0.1 ; python_version >= "3.10" and python_version < "3.13" -jedi==0.19.1 ; python_version >= "3.10" and python_version < "3.13" -jeepney==0.8.0 ; python_version >= "3.10" and python_version < "3.13" and sys_platform == "linux" -jinja2==3.1.4 ; python_version >= "3.10" and python_version < "3.13" -json5==0.9.25 ; python_version >= "3.10" and python_version < "3.13" -jsonpointer==3.0.0 ; python_version >= "3.10" and python_version < "3.13" -jsonschema==4.23.0 ; python_version >= "3.10" and python_version < "3.13" -jsonschema-specifications==2023.12.1 ; python_version >= "3.10" and python_version < "3.13" -jsonschema[format-nongpl]==4.23.0 ; python_version >= "3.10" and python_version < "3.13" -jupyter==1.0.0 ; python_version >= "3.10" and python_version < "3.13" -jupyter-client==8.6.2 ; python_version >= "3.10" and python_version < "3.13" -jupyter-console==6.6.3 ; python_version >= "3.10" and python_version < "3.13" -jupyter-core==5.7.2 ; python_version >= "3.10" and python_version < "3.13" -jupyter-events==0.10.0 ; python_version >= "3.10" and python_version < "3.13" -jupyter-lsp==2.2.5 ; python_version >= "3.10" and python_version < "3.13" -jupyter-server==2.14.1 ; python_version >= "3.10" and python_version < "3.13" -jupyter-server-terminals==0.5.3 ; python_version >= "3.10" and python_version < "3.13" -jupyterlab==4.2.3 ; python_version >= "3.10" and python_version < "3.13" -jupyterlab-pygments==0.3.0 ; python_version >= "3.10" and python_version < "3.13" -jupyterlab-server==2.27.2 ; python_version >= "3.10" and python_version < "3.13" -jupyterlab-widgets==3.0.11 ; python_version >= "3.10" and python_version < "3.13" -keyring==25.2.1 ; python_version >= "3.10" and python_version < "3.13" -kiwisolver==1.4.5 ; python_version >= "3.10" and python_version < "3.13" -latexcodec==3.0.0 ; python_version >= "3.10" and python_version < "3.13" -markdown-it-py==3.0.0 ; python_version >= "3.10" and python_version < "3.13" -markupsafe==2.1.5 ; python_version >= "3.10" and python_version < "3.13" -matplotlib==3.9.1 ; python_version >= "3.10" and python_version < "3.13" -matplotlib-inline==0.1.7 ; python_version >= "3.10" and python_version < "3.13" -mdurl==0.1.2 ; python_version >= "3.10" and python_version < "3.13" -mistune==3.0.2 ; python_version >= "3.10" and python_version < "3.13" -more-itertools==10.3.0 ; python_version >= "3.10" and python_version < "3.13" -nbclient==0.10.0 ; python_version >= "3.10" and python_version < "3.13" -nbconvert==7.16.4 ; python_version >= "3.10" and python_version < "3.13" -nbformat==5.10.4 ; python_version >= "3.10" and python_version < "3.13" -nest-asyncio==1.6.0 ; python_version >= "3.10" and python_version < "3.13" -networkx==3.3 ; python_version >= "3.10" and python_version < "3.13" -nh3==0.2.18 ; python_version >= "3.10" and python_version < "3.13" -nodeenv==1.9.1 ; python_version >= "3.10" and python_version < "3.13" -notebook==7.2.1 ; python_version >= "3.10" and python_version < "3.13" -notebook-shim==0.2.4 ; python_version >= "3.10" and python_version < "3.13" -numpy==2.0.0 ; python_version >= "3.10" and python_version < "3.13" -opencolorio==2.3.2 ; python_version >= "3.10" and python_version < "3.13" -overrides==7.7.0 ; python_version >= "3.10" and python_version < "3.13" -packaging==24.1 ; python_version >= "3.10" and python_version < "3.13" -pandas==2.2.2 ; python_version >= "3.10" and python_version < "3.13" -pandocfilters==1.5.1 ; python_version >= "3.10" and python_version < "3.13" -parso==0.8.4 ; python_version >= "3.10" and python_version < "3.13" -pexpect==4.9.0 ; python_version >= "3.10" and python_version < "3.13" and (sys_platform != "win32" and sys_platform != "emscripten") -pillow==10.4.0 ; python_version >= "3.10" and python_version < "3.13" -pkginfo==1.10.0 ; python_version >= "3.10" and python_version < "3.13" -platformdirs==4.2.2 ; python_version >= "3.10" and python_version < "3.13" -pluggy==1.5.0 ; python_version >= "3.10" and python_version < "3.13" -pre-commit==3.7.1 ; python_version >= "3.10" and python_version < "3.13" -prometheus-client==0.20.0 ; python_version >= "3.10" and python_version < "3.13" -prompt-toolkit==3.0.47 ; python_version >= "3.10" and python_version < "3.13" -psutil==6.0.0 ; python_version >= "3.10" and python_version < "3.13" -ptyprocess==0.7.0 ; python_version >= "3.10" and python_version < "3.13" and (sys_platform != "win32" and sys_platform != "emscripten" or os_name != "nt") -pure-eval==0.2.2 ; python_version >= "3.10" and python_version < "3.13" -pybtex==0.24.0 ; python_version >= "3.10" and python_version < "3.13" -pybtex-docutils==1.0.3 ; python_version >= "3.10" and python_version < "3.13" -pycparser==2.22 ; python_version >= "3.10" and python_version < "3.13" -pydata-sphinx-theme==0.15.4 ; python_version >= "3.10" and python_version < "3.13" -pydot -pygments==2.18.0 ; python_version >= "3.10" and python_version < "3.13" -pyparsing==3.1.2 ; python_version >= "3.10" and python_version < "3.13" -pyright==1.1.370 ; python_version >= "3.10" and python_version < "3.13" -pytest==8.2.2 ; python_version >= "3.10" and python_version < "3.13" -pytest-cov==5.0.0 ; python_version >= "3.10" and python_version < "3.13" -pytest-xdist==3.6.1 ; python_version >= "3.10" and python_version < "3.13" -python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "3.13" -python-json-logger==2.0.7 ; python_version >= "3.10" and python_version < "3.13" -pytz==2024.1 ; python_version >= "3.10" and python_version < "3.13" -pywin32==306 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.10" and python_version < "3.13" -pywin32-ctypes==0.2.2 ; python_version >= "3.10" and python_version < "3.13" and sys_platform == "win32" -pywinpty==2.0.13 ; python_version >= "3.10" and python_version < "3.13" and os_name == "nt" -pyyaml==6.0.1 ; python_version >= "3.10" and python_version < "3.13" -pyzmq==26.0.3 ; python_version >= "3.10" and python_version < "3.13" -qtconsole==5.5.2 ; python_version >= "3.10" and python_version < "3.13" -qtpy==2.4.1 ; python_version >= "3.10" and python_version < "3.13" -readme-renderer==44.0 ; python_version >= "3.10" and python_version < "3.13" -referencing==0.35.1 ; python_version >= "3.10" and python_version < "3.13" -requests==2.32.3 ; python_version >= "3.10" and python_version < "3.13" -requests-toolbelt==1.0.0 ; python_version >= "3.10" and python_version < "3.13" -restructuredtext-lint==1.4.0 ; python_version >= "3.10" and python_version < "3.13" -rfc3339-validator==0.1.4 ; python_version >= "3.10" and python_version < "3.13" -rfc3986==2.0.0 ; python_version >= "3.10" and python_version < "3.13" -rfc3986-validator==0.1.1 ; python_version >= "3.10" and python_version < "3.13" -rich==13.7.1 ; python_version >= "3.10" and python_version < "3.13" -rpds-py==0.19.0 ; python_version >= "3.10" and python_version < "3.13" -scipy==1.14.0 ; python_version >= "3.10" and python_version < "3.13" -secretstorage==3.3.3 ; python_version >= "3.10" and python_version < "3.13" and sys_platform == "linux" -send2trash==1.8.3 ; python_version >= "3.10" and python_version < "3.13" -setuptools==70.3.0 ; python_version >= "3.10" and python_version < "3.13" -six==1.16.0 ; python_version >= "3.10" and python_version < "3.13" -sniffio==1.3.1 ; python_version >= "3.10" and python_version < "3.13" -snowballstemmer==2.2.0 ; python_version >= "3.10" and python_version < "3.13" -soupsieve==2.5 ; python_version >= "3.10" and python_version < "3.13" -sphinx==7.3.7 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-applehelp==1.0.8 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-bibtex==2.6.2 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-devhelp==1.0.6 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-htmlhelp==2.0.5 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-qthelp==1.0.7 ; python_version >= "3.10" and python_version < "3.13" -sphinxcontrib-serializinghtml==1.1.10 ; python_version >= "3.10" and python_version < "3.13" -stack-data==0.6.3 ; python_version >= "3.10" and python_version < "3.13" -terminado==0.18.1 ; python_version >= "3.10" and python_version < "3.13" -tinycss2==1.3.0 ; python_version >= "3.10" and python_version < "3.13" -toml==0.10.2 ; python_version >= "3.10" and python_version < "3.13" -tomli==2.0.1 ; python_version >= "3.10" and python_full_version <= "3.11.0a6" -tornado==6.4.1 ; python_version >= "3.10" and python_version < "3.13" -tqdm==4.66.4 ; python_version >= "3.10" and python_version < "3.13" -traitlets==5.14.3 ; python_version >= "3.10" and python_version < "3.13" -trimesh==4.4.2 ; python_version >= "3.10" and python_version < "3.13" -twine==5.1.1 ; python_version >= "3.10" and python_version < "3.13" -types-python-dateutil==2.9.0.20240316 ; python_version >= "3.10" and python_version < "3.13" -typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "3.13" -tzdata==2024.1 ; python_version >= "3.10" and python_version < "3.13" -uri-template==1.3.0 ; python_version >= "3.10" and python_version < "3.13" -urllib3==2.2.2 ; python_version >= "3.10" and python_version < "3.13" -virtualenv==20.26.3 ; python_version >= "3.10" and python_version < "3.13" -wcwidth==0.2.13 ; python_version >= "3.10" and python_version < "3.13" -webcolors==24.6.0 ; python_version >= "3.10" and python_version < "3.13" -webencodings==0.5.1 ; python_version >= "3.10" and python_version < "3.13" -websocket-client==1.8.0 ; python_version >= "3.10" and python_version < "3.13" -widgetsnbextension==4.0.11 ; python_version >= "3.10" and python_version < "3.13" -xxhash==3.4.1 ; python_version >= "3.10" and python_version < "3.13" -zipp==3.19.2 ; python_version >= "3.10" and python_version < "3.13" +# This file was autogenerated by uv via the following command: +# uv export --no-hashes --all-extras +accessible-pygments==0.0.5 +alabaster==1.0.0 +anyio==4.6.0 +appnope==0.1.4 ; platform_system == 'Darwin' +argon2-cffi==23.1.0 +argon2-cffi-bindings==21.2.0 +arrow==1.3.0 +asttokens==2.4.1 +async-lru==2.0.4 +attrs==24.2.0 +babel==2.16.0 +backports-tarfile==1.2.0 ; python_full_version < '3.12' +beautifulsoup4==4.12.3 +biblib-simple==0.1.2 +bleach==6.1.0 +certifi==2024.8.30 +cffi==1.17.1 +cfgv==3.4.0 +charset-normalizer==3.3.2 +click==8.1.7 +colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows' +comm==0.2.2 +contourpy==1.3.0 +coverage==6.5.0 +coveralls==4.0.1 +cryptography==43.0.1 ; sys_platform == 'linux' +cycler==0.12.1 +debugpy==1.8.6 +decorator==5.1.1 +defusedxml==0.7.1 +distlib==0.3.8 +docopt==0.6.2 +docutils==0.21.2 +exceptiongroup==1.2.2 ; python_full_version < '3.11' +execnet==2.1.1 +executing==2.1.0 +fastjsonschema==2.20.0 +filelock==3.16.1 +fonttools==4.54.1 +fqdn==1.5.1 +h11==0.14.0 +hatch==1.12.0 +hatchling==1.25.0 +httpcore==1.0.6 +httpx==0.27.2 +hyperlink==21.0.0 +identify==2.6.1 +idna==3.10 +imageio==2.35.1 +imagesize==1.4.1 +importlib-metadata==8.5.0 +iniconfig==2.0.0 +invoke==2.2.0 +ipykernel==6.29.5 +ipython==8.28.0 +ipywidgets==8.1.5 +isoduration==20.11.0 +jaraco-classes==3.4.0 +jaraco-context==6.0.1 +jaraco-functools==4.1.0 +jedi==0.19.1 +jeepney==0.8.0 ; sys_platform == 'linux' +jinja2==3.1.4 +json5==0.9.25 +jsonpointer==3.0.0 +jsonschema==4.23.0 +jsonschema-specifications==2024.10.1 +jupyter==1.1.1 +jupyter-client==8.6.3 +jupyter-console==6.6.3 +jupyter-core==5.7.2 +jupyter-events==0.10.0 +jupyter-lsp==2.2.5 +jupyter-server==2.14.2 +jupyter-server-terminals==0.5.3 +jupyterlab==4.2.5 +jupyterlab-pygments==0.3.0 +jupyterlab-server==2.27.3 +jupyterlab-widgets==3.0.13 +keyring==25.4.1 +kiwisolver==1.4.7 +latexcodec==3.0.0 +markdown-it-py==3.0.0 +markupsafe==3.0.1 +matplotlib==3.9.2 +matplotlib-inline==0.1.7 +mdurl==0.1.2 +mistune==3.0.2 +more-itertools==10.5.0 +nbclient==0.10.0 +nbconvert==7.16.4 +nbformat==5.10.4 +nest-asyncio==1.6.0 +networkx==3.3 +nh3==0.2.18 +nodeenv==1.9.1 +notebook==7.2.2 +notebook-shim==0.2.4 +numpy==2.1.2 +opencolorio==2.4.0 +overrides==7.7.0 +packaging==24.1 +pandas==2.2.3 +pandocfilters==1.5.1 +parso==0.8.4 +pathspec==0.12.1 +pexpect==4.9.0 +pillow==10.4.0 +pkginfo==1.10.0 +platformdirs==4.3.6 +pluggy==1.5.0 +pre-commit==4.0.1 +prometheus-client==0.21.0 +prompt-toolkit==3.0.48 +psutil==6.0.0 +ptyprocess==0.7.0 +pure-eval==0.2.3 +pybtex==0.24.0 +pybtex-docutils==1.0.3 +pycparser==2.22 +pydata-sphinx-theme==0.15.4 +pydot==3.0.2 +pygments==2.18.0 +pyparsing==3.1.4 +pyright==1.1.382.post1 +pytest==8.3.3 +pytest-cov==5.0.0 +pytest-xdist==3.6.1 +python-dateutil==2.9.0.post0 +python-json-logger==2.0.7 +pytz==2024.2 +pywin32==307 ; platform_python_implementation != 'PyPy' and sys_platform == 'win32' +pywin32-ctypes==0.2.3 ; sys_platform == 'win32' +pywinpty==2.0.13 ; os_name == 'nt' +pyyaml==6.0.2 +pyzmq==26.2.0 +readme-renderer==44.0 +referencing==0.35.1 +requests==2.32.3 +requests-toolbelt==1.0.0 +restructuredtext-lint==1.4.0 +rfc3339-validator==0.1.4 +rfc3986==2.0.0 +rfc3986-validator==0.1.1 +rich==13.9.2 +rpds-py==0.20.0 +scipy==1.14.1 +secretstorage==3.3.3 ; sys_platform == 'linux' +send2trash==1.8.3 +setuptools==75.1.0 +shellingham==1.5.4 +six==1.16.0 +sniffio==1.3.1 +snowballstemmer==2.2.0 +soupsieve==2.6 +sphinx==8.0.2 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-bibtex==2.6.3 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 +stack-data==0.6.3 +terminado==0.18.1 +tinycss2==1.3.0 +toml==0.10.2 +tomli==2.0.2 ; python_full_version <= '3.11' +tomli-w==1.1.0 +tomlkit==0.13.2 +tornado==6.4.1 +tqdm==4.66.5 +traitlets==5.14.3 +trimesh==4.4.9 +trove-classifiers==2024.9.12 +twine==5.1.1 +types-python-dateutil==2.9.0.20241003 +typing-extensions==4.12.2 +tzdata==2024.2 +uri-template==1.3.0 +urllib3==2.2.3 +userpath==1.9.2 +uv==0.4.20 +virtualenv==20.26.6 +wcwidth==0.2.13 +webcolors==24.8.0 +webencodings==0.5.1 +websocket-client==1.8.0 +widgetsnbextension==4.0.13 +xxhash==3.5.0 +zipp==3.20.2 +zstandard==0.23.0 diff --git a/tasks.py b/tasks.py index 080bdf8a6..a4cbe6581 100644 --- a/tasks.py +++ b/tasks.py @@ -191,7 +191,7 @@ def quality( if pyright: message_box('Checking codebase with "Pyright"...') - ctx.run("pyright --skipunannotated --level warning") + ctx.run("pyright --threads --skipunannotated --level warning") if rstlint: message_box('Linting "README.rst" file...') @@ -346,19 +346,12 @@ def requirements(ctx: Context): """ message_box('Exporting "requirements.txt" file...') - ctx.run( - "poetry export -f requirements.txt " - "--without-hashes " - "--with dev,docs,graphviz,meshing,optional " - "--output requirements.txt" - ) + ctx.run('uv export --no-hashes --all-extras | grep -v "-e \\." > requirements.txt') message_box('Exporting "docs/requirements.txt" file...') ctx.run( - "poetry export -f requirements.txt " - "--without-hashes " - "--with docs,graphviz,meshing,optional " - "--output docs/requirements.txt" + 'uv export --no-hashes --all-extras --no-dev | grep -v "-e \\." > ' + "docs/requirements.txt" ) @@ -375,9 +368,7 @@ def build(ctx: Context): """ message_box("Building...") - if ( - "modified: README.rst" in ctx.run("git status").stdout # pyright: ignore - ): + if "modified: README.rst" in ctx.run("git status").stdout: # pyright: ignore raise RuntimeError('Please commit your changes to the "README.rst" file!') with open("README.rst") as readme_file: @@ -402,7 +393,7 @@ def build(ctx: Context): ) ) - ctx.run("poetry build") + ctx.run("uv build") ctx.run("git checkout -- README.rst") ctx.run("twine check dist/*") @@ -425,12 +416,14 @@ def virtualise(ctx: Context, tests: bool = True): ctx.run(f"tar -xvf {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION}.tar.gz") ctx.run(f"mv {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION} {unique_name}") with ctx.cd(unique_name): - ctx.run("poetry install") - ctx.run("source $(poetry env info -p)/bin/activate") - ctx.run('python -c "import imageio;imageio.plugins.freeimage.download()"') + ctx.run("uv sync --all-extras --no-dev") + ctx.run( + 'uv run python -c "import imageio;imageio.plugins.freeimage.download()"' + ) if tests: ctx.run( - "poetry run pytest " + "source .venv/bin/activate && " + "uv run pytest " "--doctest-modules " f"--ignore={PYTHON_PACKAGE_NAME}/examples " f"{PYTHON_PACKAGE_NAME}",