astrofrog / astrofrog/fast-histogram
Long doubles make histogram2d fail subtly, maybe add type check?
- Dominant language
- C
- Stars
- 281
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
I'm experimenting with various optimizations in the pulsar search code in HENDRICS (https://github.com/StingraySoftware/HENDRICS/pull/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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the histogram2d entry point and reproduce the failure with longdouble arrays, comparing it with the working double-array case described in the issue. Done means unsupported numeric types are rejected with a clear ValueError instead of causing a dead kernel, while supported inputs continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100