Ask Your Question
1

Code Warnings: Attribute undefined: .float32 of np: numpy module

asked 2020-07-08 10:16:31 -0600

hongyi-zhao gravatar image

updated 2020-07-08 14:20:24 -0600

I use the following code snippet in my script:

   import numpy as np
   ...
   eig=np.zeros((nks,nbnd),dtype=np.float32)

In this case, wing will give the Code Warnings:

Attribute undefined: .float32 of np: numpy module

But in fact, this is the correct usage for numpy. Any hints for this problem?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-07-08 14:20:06 -0600

It looks like float32 is a symbol that is dynamically created at runtime so Wing's source analyzer doesn't know it exists. For things like this, just click the red X to hide the warning.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-07-08 10:16:31 -0600

Seen: 1,181 times

Last updated: Jul 08