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

Refactor selection logic for IRR #121

Merged
merged 4 commits into from
May 7, 2024
Merged

Conversation

Eugenia-Mazur
Copy link
Contributor

Logic for selection of IRR when more than 1 real value is found was refactored into a separate function, allowing for user customisation of selection logic if required.

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.
@Kai-Striega Kai-Striega added the enhancement New feature or request label Apr 15, 2024
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.
Copy link
Member

@Kai-Striega Kai-Striega left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Comment on lines +712 to +714
# default selection logic for IRR function when there are > 2 real solutions
def _irr_default_selection(eirr):
# check sign of all IRR solutions
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# default selection logic for IRR function when there are > 2 real solutions
def _irr_default_selection(eirr):
# check sign of all IRR solutions
def _irr_default_selection(eirr):
"""Default selection logic for IRR function when there is > 1 real solution"""
# check sign of all IRR solutions

Python treats triple quoted strings directly following a function/method/class definition as docstrings. These are special comments that are used to document the function/method/class.

It dosen't matter for this function (as it's private), but, for public functions/methods/classes, please follow the numpydoc style guide.

Copy link
Member

Choose a reason for hiding this comment

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

Also you currently have > 2 real solutions, this should be > 1 real solutions

@Kai-Striega Kai-Striega merged commit 63aa1b1 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
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants