Skip to content

Add edge case test for rate with zero payment - #138

Open
Anurag42-git wants to merge 1 commit into
numpy:mainfrom
Anurag42-git:main
Open

Add edge case test for rate with zero payment#138
Anurag42-git wants to merge 1 commit into
numpy:mainfrom
Anurag42-git:main

Conversation

@Anurag42-git

Copy link
Copy Markdown

What this PR does:
-Adds an edge case test for the rate function when payment is zero

Why this change is needed:
-Improves test coverage and numerical stability checks in numpy-financial

Issue reference:
-Fixes #58

@Letme Letme left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have an added test, but lets add some indentation so that it aligns with rest of the file.

Comment on lines +177 to +178
result = npf.rate(nper=10, pmt=0, pv=-1000, fv=1000)
assert np.isfinite(result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result = npf.rate(nper=10, pmt=0, pv=-1000, fv=1000)
assert np.isfinite(result)
result = npf.rate(nper=10, pmt=0, pv=-1000, fv=1000)
assert np.isfinite(result)

Probably some more indent is needed (sorry for later review).

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.

We need more thorough test coverage

2 participants