Skip to content

Conversation

@lassefschmidt
Copy link
Contributor

@lassefschmidt lassefschmidt commented Dec 6, 2025

Summary

This PR extends previous metamerism implementation (#1374) with spectral correction. One day late for 0.47 release 😵

To achieve this, we need to compute a matrix that contains all integration weights when integrating sd to XYZ. As we are already doing this in function sd_to_XYZ_integration, I was able to extract the relevant part into a new helper function which sd_to_XYZ_integration is now using (same math but slightly different formulation, see image).

(for notation, e.g. R x S means element-wise multiplication, NOT dot product / matrix multiplication)

IMG_3994

Preflight

Code Style and Quality

  • Unit tests have been implemented and passed.
  • Pyright static checking has been run and passed.
  • Pre-commit hooks have been run and passed.
  • 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.

Following tests failed

TOTAL 44443 9955 78%
============================= slowest 5 durations =============================
22.91s call colour/recovery/tests/test_jakob2019.py::TestLUT3D_Jakob2019::test_size
16.24s call colour/notation/tests/test_munsell.py::TestxyY_to_munsell_specification::test_xyY_to_munsell_specification
6.78s call colour/utilities/tests/test_network.py::TestParallelForMultiProcess::test_ParallelForMultiProcess
6.66s call colour/io/luts/lut.py::colour.io.luts.lut.LUT3D.invert
6.33s call colour/volume/tests/test_rgb.py::TestRGB_colourspaceVisibleSpectrumCoverageMonteCarlo::test_RGB_colourspace_visible_spectrum_coverage_MonteCarlo
=========================== short test summary info ===========================
FAILED colour/io/image.py::colour.io.image.read_image_Imageio
FAILED colour/io/tests/test_image.py::TestWriteImageImageio::test_write_image_Imageio_exr
FAILED colour/io/tests/test_image.py::TestReadImageImageio::test_read_image_Imageio
========== 3 failed, 3683 passed, 17 skipped, 225 warnings in 44.77s ==========

Documentation

  • New features are documented along with examples if relevant.
  • The documentation is Sphinx and numpydoc compliant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant