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

Refactored arithmetic_analysis/secant_method.py #2263

Open
wants to merge 1 commit into
base: master
from

Conversation

@spamegg1
Copy link
Contributor

spamegg1 commented Aug 2, 2020

  • added missing Wikipedia link
  • added type hints and few more doctests
  • moved the function f to inside secant_method as a parameter func, instead of calling a globally defined function inside the algorithm body
  • renamed some variables and introduced some intermediate variables, to make it more readable and avoid recalculating f(x1)
  • replaced unused for-loop variable i with _

Describe your change:

  • Fix a bug or typo in an existing algorithm?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
- added missing Wikipedia link
- added type hints and few more doctests
- moved the function `f` to inside `secant_method` as a parameter `func`, instead of calling a globally defined function inside the algorithm body
- renamed some variables and introduced some intermediate variables, to make it more readable and avoid recalculating `f(x1)`
- replaced unused for-loop variable `i` with `_`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.