Fix the DeprecationWarning with Python 3.9.
See original GitHub issuepython -Wd -c "import colour"
gives a number of warnings:
.../opt/pyenv/versions/3.9.10/lib/python3.9/site-packages/colour/utilities/data_structures.py:34: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import Mapping, MutableMapping
.../opt/pyenv/versions/3.9.10/lib/python3.9/site-packages/colour/continuous/signal.py:26: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import Iterator, Mapping, Sequence
.../opt/pyenv/versions/3.9.10/lib/python3.9/site-packages/colour/utilities/common.py:613: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
[float, complex, np.integer, np.floating, np.complex]))
.../opt/pyenv/versions/3.9.10/lib/python3.9/site-packages/colour/io/luts/lut.py:21: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import MutableSequence
.../opt/pyenv/versions/3.9.10/lib/python3.9/site-packages/colour/volume/rgb.py:186: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
limits=np.array([[0, 100], [-150, 150], [-150, 150]], dtype=np.float),
.../opt/pyenv/versions/3.9.10/lib/python3.9/site-packages/colour/utilities/common.py:613: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
[float, complex, np.integer, np.floating, np.complex]))
.../opt/pyenv/versions/3.9.10/lib/python3.9/site-packages/colour/utilities/common.py:613: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
[float, complex, np.integer, np.floating, np.complex]))
Related: https://github.com/colour-science/colour/issues/543
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
warnings — Warning control — Python 3.11.1 documentation
DeprecationWarning. Base category for warnings about deprecated features when those warnings are intended for other Python developers (ignored by default, ...
Read more >1772060 – Fix deprecation warning that the functionality will be ...
Bug 1772060 - Fix deprecation warning that the functionality will be removed on python 3.9. Summary: Fix deprecation warning that the functionality will...
Read more >Fix a deprecation warning of 'collections' · 0617cebcc9 - nova
DeprecationWarning : Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will...
Read more >Get random number from set deprecation - Stack Overflow
sample() in Python 3.9.2 says this when passed a dict : TypeError: Population must be a sequence. For dicts or sets, use sorted ......
Read more >News — Cheetah3 - The Python-Powered Template Engine
Fix DeprecationWarning : unittest. ... Fixed a bug in tests with pure-python NameMapper . ... Run tests with Python 3.9 at Travis and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah! 😃 Sorry about that! I actually forgot that I fixed some more in the
feature/typing
branch which should be merged imminently, this one has none:@KelSolaar you are (mostly) right! I had tried
pip install git+https://github.com/colour-science/colour
(installing frommaster
), butdevelop
actually has fewer warnings. But in fact, it still has some:Output: