Skip to content

Incorrect usage of float16 in algos.pyx #10382

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

Closed
FelipeLema opened this issue Jun 17, 2015 · 3 comments
Closed

Incorrect usage of float16 in algos.pyx #10382

FelipeLema opened this issue Jun 17, 2015 · 3 comments
Labels
Dtype Conversions Unexpected or buggy dtype conversions Needs Discussion Requires discussion from core team before further action Numeric Operations Arithmetic, Comparison, and Logical operations

Comments

@FelipeLema
Copy link

Hi, everyone

According to documentation, np.float16 should not be used in C code as it is right now in pandas/algos.pyx:38 (assigning np.NINF to a np.float16 container in "cython-eventually-converted-to-C" code

As a matter of fact, when this value/variable is exposed, it is exposed as 0.0, and not -inf, either in C/C++ while using gdb or even with python.

Since MINfloat6 it is not being used in all pandas code, I recommend eliminating this line and/or commentating the reason. I tried by using np.float16(np.NINF) but the problem is that a correct C -inf value is still being C-assigned to a please-don't-use-C-container.

Why is it that this is important to me/I got to find this error? I'm dealing with 3rd party code so I cannot get a configuration that allows me to do this assignment without raising SIGFPE.

No pull request? The two possible solutions to me is either using cython-kept-as-python code with just this variable (which would impact performance) or simply not using it at all. I think I don't have the authority for either.

@jreback
Copy link
Contributor

jreback commented Jun 17, 2015

xref #9220, #2511, #10046

np.float16 is really not supported, so ok to simply remove it (I think it was just copy-pasted long time ago). But if you'd like to review the xref issues and provide a recommendation. thanks

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Needs Discussion Requires discussion from core team before further action labels Jun 17, 2015
@FelipeLema
Copy link
Author

This is definately a duplicate of #10046. I just added another insight and a link to numpy's documentation.

@jreback
Copy link
Contributor

jreback commented Jun 18, 2015

@FelipeLema ok thanks!

@jreback jreback added the Numeric Operations Arithmetic, Comparison, and Logical operations label Jun 18, 2015
@jreback jreback added this to the Next Major Release milestone Jun 18, 2015
@jreback jreback closed this as completed Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Needs Discussion Requires discussion from core team before further action Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

No branches or pull requests

2 participants