Reducing number of pytest warnings#1067
Merged
Merged
Conversation
CKehl
approved these changes
Jul 26, 2021
Contributor
CKehl
left a comment
There was a problem hiding this comment.
the changes in base particle set and test_kernel_language look fine to me, so they are good. The change in example_peninsula I don't really understand why it was necessary.
Code-wise, it looks fine.
Comment on lines
+50
to
+51
| La = np.linspace(1e3, domainsizeX, xdim, dtype=np.float32) | ||
| Wa = np.linspace(1e3, domainsizeY, ydim, dtype=np.float32) |
Contributor
There was a problem hiding this comment.
this change I don't really understand - how does the shrinking for the field size gets rid of a pytest warning ? Which pytest warning was that ?
Member
Author
There was a problem hiding this comment.
Yes, good that you ask. It was a division-by-zero warning.
example_peninsula.py:59: RuntimeWarning: invalid value encountered in true_divide
P = (u0*R**2*y/((x-x0)**2+y**2)-u0*y) / 1e3
This is now avoided by making sure no zeroes in x and y
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.
This PR fixes some of the warnings that pop up when running pytest. Most of these are beyond our control (warning in other packages), but there were also a few in Parcels itself that this PR fixes