-
-
Notifications
You must be signed in to change notification settings - Fork 83
Refactor power derivative functions #294
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8f269a2
refactor power cases
jagerber48 4853ccf
use variables
jagerber48 daa7d35
parametrize power tests
jagerber48 0a9b3ad
move all power tests into one module
jagerber48 0b180c9
some code re-use
jagerber48 48d3a86
pow_deriv_0/1 more explicit and pulled into their own functions.
jagerber48 5ab0c13
refactor
jagerber48 9304db9
Merge branch 'master' into pow_derivs_funcs
jagerber48 e2ff8db
test cases for pow_deriv_0/1
jagerber48 581c798
changelog
jagerber48 bd6dfe3
Merge branch 'master' into pow_derivs_funcs
jagerber48 1041082
documentation
jagerber48 2bd054a
documentation cleanup
jagerber48 08ca0f5
Merge branch 'master' into pow_derivs_funcs
jagerber48 ebdf060
docs cleanup
jagerber48 ef2992d
Merge branch 'master' into pow_derivs_funcs
jagerber48 ddc4470
Merge branch 'master' into pow_derivs_funcs
jagerber48 f10d77a
Merge branch 'master' into pow_derivs_funcs
newville File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
it's a shame to lose this comment. is there somewhere it could be moved to? I would say a docstring but that's not useful for
__pow__
.maybe it could be added to
umath.pow
's docstring?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.
Let me take a look. I actually spent a VERY long time puzzling over various special cases and I had some rewrites of this same comment.
Part of the problem is that the old function handled different special cases using different approaches. For example, the old function allowed complex results to be returned but, instead, relied on some other part of the codebase to prevent complex results.
Under this PR the comment is not actually correct anymore but I can come up with replacement text. But I'm curious, do you want a comment for the developer's sake (like the old comment used to be) or for the user's sake? For the latter we can add some description under the
umath.pow
docstring. We can also add documentation to the docs webpage. If we want a comment for the developers sake then I can update the old comments with some notes about the various special cases and how they're handled.Also happy to do all of the above, though it ends up being a lot of text because there's a few different cases.
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.
I think it's most useful for users so a docstring or section of the documentation, either works.