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
BUG: fix moments method to support arrays and list #12197
Merged
Merged
Changes from 9 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
2f1beae
BUG: fix moments method to support arrays and list
tirthasheshpatel 2f0a903
FIXUP: fix the moment method to perform operations correctly
tirthasheshpatel 8359f4a
FIUP: fix the int32 error in moment method
tirthasheshpatel 65e359a
FIXUP: fix int64 error in moment
tirthasheshpatel 5391f86
FIXUP: fix failing tests
tirthasheshpatel 5ab67bf
FIXUP: filter warnings in test_moment
tirthasheshpatel e3fd4ef
Merge remote-tracking branch 'upstream/master' into fix-moment
mdhaber 06c5162
BUG: stats: remove some redundant computation
tirthasheshpatel b7206d4
BUG: stats: fix an inplace operation
tirthasheshpatel 60c517a
BUG: stats: remove all redundant computations
tirthasheshpatel 78e3fe9
BUG, TST: stats: add tests and resolve the bug
tirthasheshpatel 8ca99eb
MAINT: stats: refactor moment function for array input
mdhaber 3ef2889
Merge pull request #1 from mdhaber/fix-moment
tirthasheshpatel ec282dd
TST: stats: remove rtol=1e-20 and assert equality
tirthasheshpatel 4989c3c
BUG: stats: fix the TypeError bug in _moment_from_stats
tirthasheshpatel 559bd3d
MAINT: stats: merge remote tracking branch 'master' and resolve confl…
tirthasheshpatel 3dbf027
TST: stats: change assert_equal to assert_allclose
tirthasheshpatel a6f4788
Merge remote-tracking branch 'upstream/master' into fix-moment
mdhaber cd90f3e
TST: stats: improve tests of rv_continuous.moment with array arguments
mdhaber 112b588
MAINT: stats: use [()] instead of .item()
tirthasheshpatel 43858ec
BUG: stats: call argsreduce for all non-none moments
tirthasheshpatel 2cebce8
MAINT: stats: apply suggestions from code review
tirthasheshpatel 7b69ef6
MAINT: stats: add a suggestion from code review
tirthasheshpatel a13a73b
TST, CI: stats: add hypothesis to CI and add tests
tirthasheshpatel acf4c1b
CI: stats: add hypothesis to macOS job
tirthasheshpatel 5b10a45
Revert "CI: stats: add hypothesis to macOS job"
tirthasheshpatel 35387ff
Revert "TST, CI: stats: add hypothesis to CI and add tests"
tirthasheshpatel d6a9b11
STY: stats: fix lint failures
tirthasheshpatel 7ed600d
STY: stats: fix E501 (line too long) PEP-8 failure
tirthasheshpatel File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
This first assignment appears to be unused?
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.
*args
? I think I did it becauseloc
andscale
parameters need to be of the same shape as inputs (that are present inargs
) otherwise the output isn't consistent with input shapes...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.
The first line is not needed.
Doing this causes the return value to always be an array if I'm understanding the code correctly.
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.
atleast_1d receives a list of arrays already, so the tuple(map(...)) dance can be avoided.
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.
Done. Thanks for the review!
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.
Do you still need the
arrs = tuple(map(np.asarray, [*args, loc, scale]))
even?arrs = np.broadcast_arrays(*(*args, loc, scale))
accepts inputs that are not already arrays.