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

Make pandas dependency optional? #1

Open
maread99 opened this issue Nov 17, 2022 · 0 comments
Open

Make pandas dependency optional? #1

maread99 opened this issue Nov 17, 2022 · 0 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@maread99
Copy link
Owner

Would it be worth making the pandas dependency optional, allowing users who define all their regular transaction frequencies in simple terms (e.g. "y", "m", "3m", "12w") to lose the dependency?

To give some context, beanahead also provides for defining regular transaction frequencies in terms of pandas frequencies.

Please +1 this comment, or add your own comment, if you only require simple frequencies and would like to be able to lose the pandas dependency.

What it would require

pandas is used by the rx_txns module to evaluate future transaction dates. This is implemented by way of creating a pd.offsets.BaseOffset which in turn is passed to pd.date_range.

For simple frequencies, e.g. "m", "13w", it would be pretty trivial to evaluate the future transaction dates without recurring to pandas:

  • if freq describes weeks the simply add a timedelta
  • if freq describes 'months' or 'years' then add months / years to datetime.date object, accounting for change in year if 'months'.

Why not drop the dependency?

I feel the functionality provided by being able to define frequencies as pandas frequencies is a worthy inclusion and I can't see it being practical to try and localize it - better to rely on pandas.

@maread99 maread99 added the dependencies Pull requests that update a dependency file label Nov 17, 2022
@maread99 maread99 pinned this issue Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

1 participant