Numpy complex numbers division bug on Win 10 #47363

Closed
opened 2016-02-08 17:08:00 +01:00 by Ricky J · 20 comments

Win 8.1 / 64 bits
AMD A10-6700 APU
video : HD8670 D

Hash = b'f337fea' 8 Fev 2016
and also

Hash = b'f77110e'

I asked someone else to test this on Linux
and it seems to work fine

so this seems to be a bug on Win 10

in given file there is a problem with this division of complexx numbers in Numpy

z1 = 7.49+0.71j
z2 = 127.01705922171767+0j
z3 = z2/z1
print ('z1 =',z1)
print ('z1 abs =',np.absolute(z1),' z1 ang =',np.angle(z1, deg=True),' Deg')
print ('z2 =',z2)
print ('z2 abs =',np.absolute(z2),' z2 ang =',np.angle(z2, deg=True),' Deg')
print ('z2/z1 = z3 =',z3)

the angle for Z3 gives -174 degrees

but it should be around -5 degrees !

tested other values and seems to work but not for this division operation.

see thread discussing this

http://blenderartists.org/forum/showthread.php?392066-numpy-complex-division-error

divide-test1.blend

thanks
happy bl

Win 8.1 / 64 bits AMD A10-6700 APU video : HD8670 D Hash = b'f337fea' 8 Fev 2016 and also Hash = b'f77110e' I asked someone else to test this on Linux and it seems to work fine so this seems to be a bug on Win 10 in given file there is a problem with this division of complexx numbers in Numpy z1 = 7.49+0.71j z2 = 127.01705922171767+0j z3 = z2/z1 print ('z1 =',z1) print ('z1 abs =',np.absolute(z1),' z1 ang =',np.angle(z1, deg=True),' Deg') print ('z2 =',z2) print ('z2 abs =',np.absolute(z2),' z2 ang =',np.angle(z2, deg=True),' Deg') print ('z2/z1 = z3 =',z3) the angle for Z3 gives -174 degrees but it should be around -5 degrees ! tested other values and seems to work but not for this division operation. see thread discussing this http://blenderartists.org/forum/showthread.php?392066-numpy-complex-division-error [divide-test1.blend](https://archive.blender.org/developer/F280936/divide-test1.blend) thanks happy bl
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @rickyblender

Added subscriber: @rickyblender

Added subscriber: @mont29

Added subscriber: @mont29

This seems to be an issue with numpy itself… Did you try that directly from python console itself (without using Blender at all)?

This seems to be an issue with numpy itself… Did you try that directly from python console itself (without using Blender at all)?
Author

trying to do it in winpython

but I asked some one else to test it in Linux blender
and it works fine

but not on win 10

thanks
happy bl

trying to do it in winpython but I asked some one else to test it in Linux blender and it works fine but not on win 10 thanks happy bl
Author

just did a test in winpython
and it works fine

I get the right angle at around 5 degrees

so guess it has something to do with bl some how

thanks
happy bl

just did a test in winpython and it works fine I get the right angle at around 5 degrees so guess it has something to do with bl some how thanks happy bl

Added subscriber: @MartijnBerger

Added subscriber: @MartijnBerger

@MartijnBerger maybe we should use latest version of numpy for windows? We are using 1.9 afaik, according to numpy release notes they are using more and more C99 builtin complex support, this could explain the issue?

@rickyblender which is the exact version of numpy you used to test outside of Blender?

@MartijnBerger maybe we should use latest version of numpy for windows? We are using 1.9 afaik, according to [numpy release notes](http://docs.scipy.org/doc/numpy-1.10.1/release.html) they are using more and more C99 builtin complex support, this could explain the issue? @rickyblender which is the exact version of numpy you used to test outside of Blender?
Author

I have an old Python installed on my machine but not Numpy

so got Winpython
http://winpython.sourceforge.net/
winpython 64 bits 3.4.3.7 python 3.4.3 AMD

which has most of the package including Matplot

wish I could have same things in BL
so only way for me to test it was to use Iptyhon
and it works fine

Also Eppo did a test on Linux and it also work fine

Looks like it is only on Win 64 that it does not work well
for some specific cases of values for the complex angle.

Did anyone else find the same error on Win 64 ?

thanks
happy bl

I have an old Python installed on my machine but not Numpy so got Winpython http://winpython.sourceforge.net/ winpython 64 bits 3.4.3.7 python 3.4.3 AMD which has most of the package including Matplot wish I could have same things in BL so only way for me to test it was to use Iptyhon and it works fine Also Eppo did a test on Linux and it also work fine Looks like it is only on Win 64 that it does not work well for some specific cases of values for the complex angle. Did anyone else find the same error on Win 64 ? thanks happy bl
Martijn Berger was assigned by Bastien Montagne 2016-02-09 16:28:04 +01:00

well… winpython 3.4.3.7 reports numpy 1.9.3… (https://github.com/winpython/winpython/blob/master/changelogs/WinPython-3.4.3.7.md).

Will let @MartijnBerger handle it from there, could be some bug in our version of numpy but cannot check that here.

well… winpython 3.4.3.7 reports numpy 1.9.3… (https://github.com/winpython/winpython/blob/master/changelogs/WinPython-3.4.3.7.md). Will let @MartijnBerger handle it from there, could be some bug in our version of numpy but cannot check that here.

Added subscriber: @brecht

Added subscriber: @brecht

I don't think Numpy has anything to do with this, the code in the description only uses Python's builtin complex numbers.

I don't think Numpy has anything to do with this, the code in the description only uses Python's builtin complex numbers.
Author

I was talking about these

print ('numpy z3 abs =',np.absolute(z3),'z3 ang =',np.angle(z3, deg=True),' Deg')
print ('numpy angle =', rad2deg(angle(z3)) )

this is using np or numpy values if i'm not mistaking !

ang =',np.angle(z3, deg=True )

that is the one that does not work giving -171 Deg instead of
ang = -0.09451065035724213 Rad -5.41506138450656 deg

some other equations seems to work so not certain what error it can be

you can remove the cmath module at top not beeing use anyway
it will still give same error !

how is it not using np ?

thanks
happy bl

I was talking about these print ('numpy z3 abs =',np.absolute(z3),'z3 ang =',np.angle(z3, deg=True),' Deg') print ('numpy angle =', rad2deg(angle(z3)) ) this is using np or numpy values if i'm not mistaking ! **ang =',np.angle(z3, deg=True )** that is the one that does not work giving -171 Deg instead of ang = -0.09451065035724213 Rad -5.41506138450656 deg some other equations seems to work so not certain what error it can be you can remove the cmath module at top not beeing use anyway it will still give same error ! how is it not using np ? thanks happy bl

Added subscriber: @Symmetric-3

Added subscriber: @Symmetric-3

I can confirm the issue. While it works fine on my Linux Mint 17.2 64 bit, I have the exact same problem on Windows 7 64 bit (same computer)

I'm using blender 2.76b on both (numpy 1.9.1)

I can confirm the issue. While it works fine on my Linux Mint 17.2 64 bit, I have the exact same problem on Windows 7 64 bit (same computer) I'm using blender 2.76b on both (numpy 1.9.1)
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Please try with the latest version of Blender we have updated these libs since then.

Please try with the latest version of Blender we have updated these libs since then.
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

can confirm it's fixed with the latest libs.


z1= (7.49+0.71j)
z1 abs = 7.52357627728  z1 ang = 5.41506138451  Deg
z2= (127.01705922171767+0j)
z2 abs = 127.017059222  z2 ang = 0.0  Deg
z2/z1 = z3= (16.807194052219895-1.5932053106910715j)
z3 real = 16.807194052219895 z3 imag = -1.5932053106910715

z3 abs = 16.882537578 z3 ang = -5.41506138451  Deg
angle = -5.41506138451
can confirm it's fixed with the latest libs. ``` z1= (7.49+0.71j) z1 abs = 7.52357627728 z1 ang = 5.41506138451 Deg z2= (127.01705922171767+0j) z2 abs = 127.017059222 z2 ang = 0.0 Deg z2/z1 = z3= (16.807194052219895-1.5932053106910715j) z3 real = 16.807194052219895 z3 imag = -1.5932053106910715 z3 abs = 16.882537578 z3 ang = -5.41506138451 Deg angle = -5.41506138451 ```
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#47363
No description provided.