-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Remove assert_almost_equals from tests #92
Remove assert_almost_equals from tests #92
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one issue that's coming up in the CI:
tests/test_financial.py:1:1: I001 [*] Import block is un-sorted or un-formatted
But I don't see any changes you have made other than to delete a line. Either way, would you be able to fix it?
tests/test_financial.py
Outdated
@@ -740,4 +748,4 @@ def test_irr_maximum_iterations_exception(self): | |||
cashflows = numpy.array([-40000, 5000, 8000, 12000, 30000]) | |||
|
|||
with pytest.raises(npf.IterationsExceededError): | |||
npf.irr(cashflows, maxiter=1, raise_exceptions=True) | |||
npf.irr(cashflows, maxiter=1, raise_exceptions=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've deleted the ending newline here, please add it back in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll work on it right now!
Sorted the import block and added the new line
Hey! I have sorted the import block and added the new line back. |
Thanks, @ArCh12312, I've re-run the tests to make sure everything is ok. If it is, I'm glad to merge this. |
used the command ruff format ./test_financial.py to reformat the file.
Hey @Kai-Striega, I have reformatted the file using the command `ruff format ./test_financial.py'. Please review it. |
#66 Fixed the issue
Changed assert_almost_equals to assert_allclose and a custom function(assert_decimal_close).
Had to create assert_decimal_close, which finds the absolute difference in values and compares it to a tolerance level.
Cannot use the
assert_allclose
because it uses isfinite under the covers which does not support the Decimal type.See issue: numpy/numpy#9954