`.rolling_exp` arguments could be clearer
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Is your feature request related to a problem?
Currently we call .rolling_exp like:
da.rolling_exp(date=20).mean()
20 refers to a "standard" window type — broadly "the same average distance as a simple rolling window. That works well, and matches the .rolling(date=20).mean() format.
But we also have different window types, and this makes it a bit incongruent:
da.rolling_exp(date=0.5, window_type="alpha").mean()
...since the window_type is completely changing the meaning of the value we pass to the dimension argument. A bit like someone asking "how many apples would you like to buy", and replying "5", and then separately saying "when I said 5, I meant 5 tonnes".
Describe the solution you'd like
One option would be:
.rolling_exp(dptr={"alpha": 0.5})
We pass a dict if we want a non-standard window type — so the value is attached to its type.
We could still have the original form for da.rolling_exp(date=20).mean().
Describe alternatives you've considered
No response
Additional context
(I realize I wrote this originally, all criticism directed at me! This is based on feedback from a colleague, which on reflection I agree with.)
Unless anyone disagrees, I'll try and do this soon-ish™
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 at the rolling_exp entry point and trace how the date argument and window_type are interpreted. Review the existing rolling_exp tests, then define and verify the proposed dictionary form for non-standard window types while preserving the existing standard form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100