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

Use non-deprecated option with days #235

Merged
merged 1 commit into from
Sep 7, 2023
Merged

Use non-deprecated option with days #235

merged 1 commit into from
Sep 7, 2023

Conversation

chanhosuh
Copy link
Member

@chanhosuh chanhosuh commented Sep 7, 2023

Description

Numpy no longer allows the "Y" unit in its timedelta constructor, e.g. timedelta64(1, 'Y'), due to a "year" being an ambiguous number of nanoseconds.

We fix this by using timedelta64(365, 'D'), which does not materially impact our annualization calculation.

Fixes #233.

Hygiene checklist

  • Changelog entry
  • Everything public has a Numpy-style docstring
    (modules, public functions, classes, and public methods)
  • Commit history is cleaned-up with minor changes squashed together
    and descriptive commit messages following Tim Pope's style

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

Presumably this calc is not sensitive to varying number of days
in a year or leap seconds.
@chanhosuh chanhosuh self-assigned this Sep 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

Coverage report

The coverage rate went from 74.93% to 74.93% ⬇️
The branch rate is 61%.

100% of new lines are covered.

Diff Coverage details (click to unfold)

curvesim/metrics/metrics.py

100% of new lines are covered (83.76% of the complete file).

@chanhosuh chanhosuh merged commit bf26139 into main Sep 7, 2023
14 checks passed
@chanhosuh chanhosuh deleted the pandas-fix branch September 7, 2023 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pandas deprecated functionality
1 participant