-
I have tried for hours, and just can't crack it! Does anyone know what is wrong with this code? `import colour XYZ = np.array([0.95045, 1, 1.08905]) figure, axes = colour.plotting.plot_chromaticity_diagram_CIE1976UCS( axes.plot(u, v, "o-", markersize=10, color="black") colour.plotting.render( I get /colour/models/cie_luv.py:386: RuntimeWarning: divide by zero encountered in divide Thanks in advance for any help you might offer. : )
|
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 7 replies
-
Hey @blue-j, What issue do you have? Seems to work just fine: Cheers, Thomas |
Beta Was this translation helpful? Give feedback.
-
Hi,
Same issues on my hardware.
divide by zero encountered in divide
xy = tstack([9 * u / d, 4 * v / d])
RuntimeWarning: invalid value encountered in multiply
[x[m_XY
Interesting.
Fred
… On 15 Dec 2022, at 05:59, blue-j ***@***.***> wrote:
`import colour
import numpy as np
XYZ = np.array([0.95045, 1, 1.08905])
LUV = colour.XYZ_to_Luv(XYZ)
uv = colour.Luv_to_uv(LUV)
u = uv[0]
v = uv[1]
figure, axes = colour.plotting.plot_chromaticity_diagram_CIE1976UCS(
show_spectral_locus=True,
show_diagram_colours=True,
diagram_opacity=1,
title=None,
standalone=False,
)
axes.plot(u, v, "o-", markersize=10, color="black")
colour.plotting.render(
x_ticker=True,
y_ticker=True,
x_label=None,
y_label=None,
axes_visible=True,
background_transparency=True,
filename="custom_diagram.svg"
)`
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I did tests with Python3.10.8 @ Python3.11.0 = same issues.
Name: colour-science
Version: 0.4.2
Name: numpy
Version: 1.23.5
Name: scipy
Version: 1.9.3
Name: imageio
Version: 2.22.4
Name: matplotlib
Version: 3.6.2
Name: typing_extensions
Version: 4.4.0
Same for you?
Thanks
Fred
… On 15 Dec 2022, at 07:14, blue-j ***@***.***> wrote:
I'm unfortunately going to bed but this may be a dependency issue? I'm using the latest colour but maybe we ought to compare our versions of numpy? I did not get a chance to look at the code throwing the error either... - J
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
And the latest develop do the same on me.
… On 15 Dec 2022, at 08:08, Frederic Savoir ***@***.***> wrote:
Hi,
I did tests with Python3.10.8 @ Python3.11.0 = same issues.
Name: colour-science
Version: 0.4.2
Name: numpy
Version: 1.23.5
Name: scipy
Version: 1.9.3
Name: imageio
Version: 2.22.4
Name: matplotlib
Version: 3.6.2
Name: typing_extensions
Version: 4.4.0
Same for you?
Thanks
Fred
> On 15 Dec 2022, at 07:14, blue-j ***@***.***> wrote:
>
>
> I'm unfortunately going to bed but this may be a dependency issue? I'm using the latest colour but maybe we ought to compare our versions of numpy? I did not get a chance to look at the code throwing the error either... - J
>
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because you commented.
>
|
Beta Was this translation helpful? Give feedback.
-
The warnings are not an issue, they occur when the chromaticity diagram colours are being computed, I thought I removed those but apparently not so I did another pass. There are a lot of divisions in Colour and we decided to handle the obvious ones that might get to 0 in the denominator. They should have been tamed in develop. |
Beta Was this translation helpful? Give feedback.
-
Me it’s displaying.
Let’s check your version of python & package.
Fred
… On 15 Dec 2022, at 11:09, blue-j ***@***.***> wrote:
It's not only warnings for me. The plot of the point never occurs. - J
—
Reply to this email directly, view it on GitHub <#1086 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHZDWR3Z4QRDVMWPYOPTY3WNLU67ANCNFSM6AAAAAAS7JM7BQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
Check with pipdate to make sure all your package are up-to-date :)
… On 15 Dec 2022, at 11:10, Frederic Savoir ***@***.***> wrote:
Me it’s displaying.
Let’s check your version of python & package.
Fred
> On 15 Dec 2022, at 11:09, blue-j ***@***.*** ***@***.***>> wrote:
>
>
> It's not only warnings for me. The plot of the point never occurs. - J
>
> —
> Reply to this email directly, view it on GitHub <#1086 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHZDWR3Z4QRDVMWPYOPTY3WNLU67ANCNFSM6AAAAAAS7JM7BQ>.
> You are receiving this because you commented.
>
|
Beta Was this translation helpful? Give feedback.
-
pip3 list ==
Package Version
------------------ ---------
appdirs 1.4.4
certifi 2022.12.7
charset-normalizer 3.0.1
colour-science 0.4.2
commonmark 0.9.1
contourpy 1.0.6
cycler 0.11.0
fonttools 4.38.0
idna 3.4
imageio 2.22.4
kiwisolver 1.4.4
matplotlib 3.6.2
numpy 1.23.5
packaging 22.0
Pillow 9.3.0
pip 22.3.1
pipdate 0.5.6
Pygments 2.13.0
pyparsing 3.0.9
python-dateutil 2.8.2
requests 2.28.1
rich 12.6.0
scipy 1.9.3
setuptools 65.6.3
six 1.16.0
typing_extensions 4.4.0
urllib3 1.26.13
wheel 0.38.4
On my machine and you?
Fred
… On 15 Dec 2022, at 11:12, Frederic Savoir ***@***.***> wrote:
Check with pipdate to make sure all your package are up-to-date :)
> On 15 Dec 2022, at 11:10, Frederic Savoir ***@***.*** ***@***.***>> wrote:
>
> Me it’s displaying.
>
> Let’s check your version of python & package.
>
> Fred
>
>> On 15 Dec 2022, at 11:09, blue-j ***@***.*** ***@***.***>> wrote:
>>
>>
>> It's not only warnings for me. The plot of the point never occurs. - J
>>
>> —
>> Reply to this email directly, view it on GitHub <#1086 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHZDWR3Z4QRDVMWPYOPTY3WNLU67ANCNFSM6AAAAAAS7JM7BQ>.
>> You are receiving this because you commented.
>>
>
|
Beta Was this translation helpful? Give feedback.
-
How to you launch the script?
Could you try something = python3 -m myScrip.py
Thanks,
Fred
… On 15 Dec 2022, at 20:54, blue-j ***@***.***> wrote:
Python 3.10.8
—
Reply to this email directly, view it on GitHub <#1086 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHZDWWBPQR4KJ7BWZFUPWTWNNZNZANCNFSM6AAAAAAS7JM7BQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
So :) Just warning so far so good.
… On 15 Dec 2022, at 20:56, blue-j ***@***.***> wrote:
Woot!
Well, i see the plot of the value now!
this is out:
/usr/local/lib/python3.10/site-packages/colour/utilities/verbose.py:266: ColourUsageWarning: The "CIE 2012 2 Degree Standard Observer" has been renamed to "CIE 2015 2 Degree Standard Observer" for consistency with the official CIE name which was adopted in 2015.
warn(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/colour/utilities/verbose.py:266: ColourUsageWarning: The "CIE 2012 10 Degree Standard Observer" has been renamed to "CIE 2015 10 Degree Standard Observer" for consistency with the official CIE name which was adopted in 2015.
warn(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/colour/models/cie_luv.py:386: RuntimeWarning: divide by zero encountered in divide
xy = tstack([9 * u / d, 4 * v / d])
/usr/local/lib/python3.10/site-packages/colour/models/cie_xyy.py:179: RuntimeWarning: invalid value encountered in multiply
[x[m_XYZ] * Y_y, Y[m_XYZ], (1 - x[m_XYZ] - y[m_XYZ]) * Y_y]
resulting from:
`import colour
import numpy as np
XYZ = np.array([0.95045, 1, 1.08905])
LUV = colour.XYZ_to_Luv(XYZ)
uv = colour.Luv_to_uv(LUV)
u = uv[0]
v = uv[1]
figure, axes = colour.plotting.plot_chromaticity_diagram_CIE1976UCS(
show_spectral_locus=True,
show_diagram_colours=True,
diagram_opacity=1,
title=None,
standalone=False,
)
axes.plot(u, v, "o-", markersize=10, color="black")
colour.plotting.render(
x_ticker=True,
y_ticker=True,
x_label=None,
y_label=None,
axes_visible=True,
background_transparency=True,
filename="custom_diagram.svg"
)
`
<https://user-images.githubusercontent.com/3990142/207954841-92a8de40-d9e5-4a17-a34d-8749a433ec96.png>
—
Reply to this email directly, view it on GitHub <#1086 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHZDWSTNLV3T2EEC5N6VGLWNNZYPANCNFSM6AAAAAAS7JM7BQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
Don’t add .py in the argument with -m
… On 15 Dec 2022, at 21:00, blue-j ***@***.***> wrote:
python3.10: Error while finding module specification for '/Users/blue-j/Desktop/chromaticity_1976UCS.py'
if i use the -m switch
—
Reply to this email directly, view it on GitHub <#1086 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHZDWQ7D5KKTHISZ6YVNDTWNN2FLANCNFSM6AAAAAAS7JM7BQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
it suddenly started working fine. i think it was your good mojo, both of you. mojo is the primary IT tool! much gratitude!! - J |
Beta Was this translation helpful? Give feedback.
-
Your welcome have fun let’s close the case.
… On 15 Dec 2022, at 21:03, blue-j ***@***.***> wrote:
it suddenly started working fine. i think it was your good mojo, both of you. mojo is the primary IT tool! much gratitude!! - J
—
Reply to this email directly, view it on GitHub <#1086 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHZDWT7UELMOSDLDIAS3ATWNN2Q3ANCNFSM6AAAAAAS7JM7BQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
The warnings are not an issue, they occur when the chromaticity diagram colours are being computed, I thought I removed those but apparently not so I did another pass. There are a lot of divisions in Colour and we decided to handle the obvious ones that might get to 0 in the denominator. They should have been tamed in develop.