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

Altered IRR function to accept 2D-array #122

Merged
merged 9 commits into from
May 7, 2024

Conversation

Eugenia-Mazur
Copy link
Contributor

IRR function was changed to accept 2D-arrays as input. A for-loop was included to iterate over
each row of the array, generate an IRR, and append its value to a results array.

Created function to store default selection logic to allow user
to insert their own selection logic for more than 1 real solution
Documented addition of IRR selection logic function. The new function contains default logic
for selection of IRR Values. User may enter their own function with custom logic if required.
When attempting to push changes to GitHub, tests
 returned a "757:89: E501 Line too long (90 > 88)"
 error. Line 757 was shortened in this update.
WHen attemping to commit a change, a "Line too long"
error occured. Line 757 has been shortened.
IRR function was changed to accept 2D-arrays as
input. A for-loop was included to iterate over
each row of the array, generate an IRR, and append
its value to a results array.
Bug was found upon commit in IRR function. Logic
was incorrect and returning an out of index
error. Conditional statement was fixed to
overcome this.
Altered structure of IRR function to utilise
a np.array to store IRR calculated, rather than
a list.
Also made small fixes in indentation.
Comment in Irr selection logic was altered to
be formated as a docstring.
An example was included in the documentation
containing a 2D-array input.
numpy_financial/_financial.py Outdated Show resolved Hide resolved
numpy_financial/_financial.py Outdated Show resolved Hide resolved
We only need to check the 2d case. As this will never be a 1d array as ``np.atleast_2d`` was used.
@Kai-Striega Kai-Striega merged commit 3f67c27 into numpy:main May 7, 2024
9 checks passed
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.

None yet

2 participants