-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix "The truth value of an array with more than one element is ambiguous" #1685
Conversation
…ous" Fixes "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
Hi @MrQubo, thanks a lot for the contribution! Is this for this situation where |
Thanks for the warming welcome @jonmmease. I've added test for numpy array as well as tests for ordinary python array and an empty array. |
I've got bunch of deprecation warning messages when running the tests. Seems like tests need to be updated for version 4. |
I don't know why CircleCi fails. |
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.
Thanks @MrQubo! Once the new numpy test is moved and numpy test dependency changes are reverted (See inline comments) this will be good to go.
@@ -1542,6 +1544,35 @@ def test_subplot_titles_insets(self): | |||
) | |||
self.assertEqual(fig, expected) | |||
|
|||
def test_subplot_titles_array(self): |
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.
Looks like this test is testing subplot titles as a tuple
. If that's what you're intending, lets name this test_subplot_titles_tuple
.
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.
All current tests are using tuples as subplot_titles argument. I thought it would be a good idea to add a test which checks if it works the same with python array.
packages/python/plotly/plotly/tests/test_core/test_subplots/test_make_subplots.py
Show resolved
Hide resolved
packages/python/plotly/plotly/tests/test_core/test_subplots/test_make_subplots.py
Outdated
Show resolved
Hide resolved
Looks good. Thanks again @MrQubo! |
Fixes "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"