-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surprising error when setting dtype #19625
Comments
Grrr :(. This is indeed supposed to be a warning and not an error. That said, the warning should be valid and you should probably check |
@seberg Thank you! Upon further inspection of the np.bitwise_not(0, dtype=np.array([1], dtype=np.dtype('>i2')).dtype, casting='unsafe') indeed raises the same exception. |
Thanks for the report and checking. Since in the code where it fails, EDIT: The point being the |
I am sorry, I am not sure I follow your suggestion. Could you, please, illustrate the idea? (Or make a PR) The code is designed to create a boolean mask (or integer type with 1s and 0s) based on specific bits being turned on in the input data quality array values. It has been quite some time since I wrote this code and I truly hope there was a good reason for doing things the way I did them, but fundamentally, using default parameters, the code is designed to compute (using pure Python): not bool(dq & ~flag) where |
Sorry, I misread/misunderstood the code... The The only other solution that might be reasonable is casting |
My apologies if this was already reported or if the bug is in our code but I am getting unexpected (no deprecation warning was issued in previous
numpy
releases) error when runningdrizzlepac
. This error or warning was not present innumpy 1.21.0
.Reproducing code example:
First, create a new Python 3.8 environment and install:
Activate environment and run:
Error message:
The interesting part is that, doing the following (similar to what data are being passed to
bitwise_not
above except for the array size) directly in the interpreter does not raise an exception or warning:In addition, the test of the
TypeError
message is inaccurate since it implies this is a warning:NumPy/Python version information:
The text was updated successfully, but these errors were encountered: