Skip to content

Can you please go easy on the deprecation warnings? #866

Description

@sdbbs

Not really a bug, just wanted to point out this:

I am using colour-science colour.__version__ of 0.3.16.

So, at a point in my code, I have:

cctf_encoding=colour.sRGB_COLOURSPACE.cctf_encoding,

When I run my code, I get:

.../Jupyter/notebook/lib/python3.8/site-packages/colour/utilities/verbose.py:237: ColourUsageWarning: "colour.sRGB_COLOURSPACE" object access is deprecated and will change to "colour.models.RGB_COLOURSPACE_sRGB" in a future release.
warn(*args, **kwargs)

Sure, no problem - let me then just change to this:

cctf_encoding=colour.RGB_COLOURSPACE_sRGB.cctf_encoding,

... but now I get:

AttributeError: module 'colour' has no attribute 'RGB_COLOURSPACE_sRGB'

Eh ... I thought I could get rid of the warning by:

colour.RGB_COLOURSPACE_sRGB = colour.sRGB_COLOURSPACE

... but no, warning recognizes it is the "deprecated" access, and is raised again. Filtering it finally works:

import warnings
warnings.filterwarnings("ignore", message='"colour.sRGB_COLOURSPACE" object access is deprecated and will change to')

So, I'd like to suggest, to only enable deprecation warnings, if one can do something about them - since it looks that for now, I will just have to filter this warning.

But it's not that big of an issue for me - so let me just close with: Thanks for a great library!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions