Fix issue 2#7
Open
zinaStef wants to merge 1 commit into
Open
Conversation
pberkes
reviewed
Aug 29, 2023
|
|
||
| assert (np.all(find_maxima(values) == expected_v1) | ||
| or np.all(find_maxima(values) == expected_v2) | ||
| or np.all(find_maxima(values) == expected_v3)) |
There was a problem hiding this comment.
Nice, two comments:
- find_maxima returns a list, so there's no need to use
np.all: two list are equal if all their elements are equal - in a real-life situation, you would make a choice between one of these possible options and test that one specifically
pberkes
reviewed
Aug 29, 2023
| def test_find_maxima_not_a_plateau(): | ||
| raise Exception('not yet implemented') | ||
| values = np.array([1, 2, 2, 3, 1]) | ||
| expected = np.array([3]) |
There was a problem hiding this comment.
Strictly speaking, the function takes and returns a list. This works because the array object implements the same functionality of a list that you need for this functions, but in other situation it could fail
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#2