Skip to content
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

Long doubles make histogram2d fail subtly, maybe add type check? #43

Open
matteobachetti opened this issue Aug 17, 2019 · 3 comments
Open
Labels

Comments

@matteobachetti
Copy link

I'm experimenting with various optimizations in the pulsar search code in HENDRICS (StingraySoftware/HENDRICS#65). One of my bottlenecks was a 2d histogram operation, and I gave a shot to yours. Tested with simulated data, everything worked and histogram2d was not a bottleneck anymore. Yay!
However...
When I used it on real data, Jupyter notebook was giving "dead kernel" messages with no information whatsoever. After spending one day banging my head, I tried to cast the longdouble arrays to double, and everything worked again.

It would help to add a type check, raising a ValueError or something similar if the number type is unsupported.

@astrofrog astrofrog added the bug label Aug 19, 2019
@astrofrog
Copy link
Owner

The code should normally cast to double automatically here:

https://github.com/astrofrog/fast-histogram/blob/master/fast_histogram/_histogram_core.c#L111

but it might be this doesn't work for long double somehow. If anyone wants to help investigate, please feel free to! (otherwise will try and look soon)

@tcassanelli
Copy link

has there been any update in this? I am trying with np.float128 and it returns this error:

    res = asanyarray(func1d(inarr_view[ind0], *args, **kwargs))
  File "/Users/tomascassanelli/anaconda3/lib/python3.8/site-packages/fast_histogram/histogram.py", line 58, in histogram1d
    return _histogram1d(x, nx, xmin, xmax)
RuntimeError: Couldn't set up iterator

@astrofrog
Copy link
Owner

I haven't had a chance to investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants