BUG, ENH: Refine Nat checks and division by 0 setting in timedelta division code
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 32.8k
- Forks
- 12.8k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 197
Description
I would like to take this as a follow-up PR as we need to make two major changes:
For both timedeltas, we need to do this: https://github.com/numpy/numpy/blob/000dfda49a012bd38efc6fbb89ece58279895bad/numpy/core/src/umath/loops.c.src#L1446-L1448
But as I mentioned in https://github.com/numpy/numpy/pull/17727#issuecomment-726084647, we are truncating instead of flooring. Second being the setting of invalid division.
Originally posted by @ganesh-k13 in https://github.com/numpy/numpy/pull/17727#discussion_r528838830
Refers: #17727, #16458
CC: @seberg , @mattip, @eric-wieser
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in numpy/core/src/umath/loops.c.src around lines 1446-1448 and read the discussion in #17727 and #16458. Check the timedelta division paths for both timedelta operands, then verify that Nat checks use flooring rather than truncation and that invalid division is set as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100