Skip to content

Conversation

@zinaStef
Copy link

#2


assert (np.all(find_maxima(values) == expected_v1)
or np.all(find_maxima(values) == expected_v2)
or np.all(find_maxima(values) == expected_v3))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, two comments:

  1. find_maxima returns a list, so there's no need to use np.all: two list are equal if all their elements are equal
  2. in a real-life situation, you would make a choice between one of these possible options and test that one specifically

def test_find_maxima_not_a_plateau():
raise Exception('not yet implemented')
values = np.array([1, 2, 2, 3, 1])
expected = np.array([3])
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants