SortedCollection - Add support for finding the closest event
- Dominant language
- TypeScript
- Stars
- 211
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
The docs for Collection suggest that the SortedCollection should be able to perform both a bisect, and finding the closest data point:
> Note: this doesn't find the closest key, or implement `bisect`. For that you need the
> `SortedCollection`, that is also part of a `TimeSeries`.
Unfortunately it doesn't seem like the SortedCollection implements a `closest` function, but it does implement a `bisect` function.
Are there any plans to add support for finding the _closest_ event? :+1:
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the SortedCollection implementation and its existing bisect function, then compare it with the Collection documentation and the TimeSeries references mentioned in the issue. Clarify the intended meaning of the closest event and update the relevant behavior so SortedCollection supports it consistently with that documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100