Skip to content

Don't warn when using vecsum#98

Merged
ayan-usgs merged 4 commits into
sgrid:masterfrom
ocefpaf:no_warn_vecsum
Aug 25, 2016
Merged

Don't warn when using vecsum#98
ayan-usgs merged 4 commits into
sgrid:masterfrom
ocefpaf:no_warn_vecsum

Conversation

@ocefpaf

@ocefpaf ocefpaf commented Aug 25, 2016

Copy link
Copy Markdown
Member

@ayan-usgs can you review and merge this one?

Comment thread pysgrid/processing_2d.py
"""
vector_sum = np.sqrt(x_arr**2 + y_arr**2)
return vector_sum
return ma.sqrt(x_arr**2 + y_arr**2)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

User are scared when the see the invalid values warning. We could be smarter and return a numpy array when the input is a numpy array and return a masked array when the input is a masked a array (I have a decorator for that). However, one could argue that the result of a velocity vector should always be a masked array as invalid values will be virtually always present. (And the decorator would make this simple function too complex and slow.)

@ocefpaf ocefpaf changed the title No warn vecsum Don't warn when using vecsum Aug 25, 2016
@ayan-usgs

Copy link
Copy Markdown
Contributor

👍

@ayan-usgs ayan-usgs merged commit 5376496 into sgrid:master Aug 25, 2016
@ocefpaf ocefpaf deleted the no_warn_vecsum branch August 25, 2016 13:04
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