Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating example Jupyter Notebook to utilize the updated colour API #71

Merged

Conversation

CorbanSwain
Copy link
Contributor

@CorbanSwain CorbanSwain commented Sep 3, 2023

Summary

This Pull Request fixes:

  1. A bug in the example_detection.ipynb notebook where there's a call to create a colour.characterisation.ColourChecker instance without passing the rows and columns arguments of the named tuple, leading to the following error
    TypeError: <lambda>() missing 2 required positional arguments: 'rows' and 'columns'
    
    as is. I assume the API was updated at some point that led to the current example falling out of date.
  2. Some calls to colour.RGB_to_XYZ and colour.XYZ_to_RGB in example_detection.ipynb that utilize the deprecated (data, source_illuminant, target_illuminant, matrix) argument pattern instead of the (data, colourspace, source_illuminant) argument pattern for these functions. (A change that came with Colour v0.4.3) This deals with warnings
    ...\colour\utilities\verbose.py:262: ColourUsageWarning: The "colour.XYZ_to_RGB" definition signature has changed with "Colour 0.4.3". The used call arguments are deprecated, please refer to the documentation for more information about the new signature.
      warn(*args, **kwargs)  # noqa: B028
    
    that are raised when utilizing the deprecated argument pattern.

Preflight

Code Style and Quality

This PR does not modify any source code, it only updates the example_detection.ipynb notebook. So I'm assuming that the tests, checks, and documentation updates do not necessarily apply. I did re-run the entire notebook to test this PR; however, I did not include the re-run notebook in this PR as to avoid a massive diff, but please let me know if there's a better way to approach this.

  • [N/A] Unit tests have been implemented and passed.
  • [N/A] Pyright static checking has been run and passed.
  • [N/A] Pre-commit hooks have been run and passed.

Documentation

  • [N/A] New features are documented along with examples if relevant.
  • [N/A] The documentation is Sphinx and numpydoc compliant.

for creating ColourChecker object and performing colourspace conversions.
@KelSolaar
Copy link
Member

Hi @CorbanSwain,

Thank you! I haven't re-run most of the examples when I did release some of our packages last week. I was planning to do a pass later!

Cheers,

Thomas

@KelSolaar KelSolaar merged commit 26cc8d6 into colour-science:develop Sep 3, 2023
12 checks passed
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.

2 participants