Fix clean method in case var is nan. by 15b3 · Pull Request #164 · python-windrose/windrose · GitHub
Skip to content

Fix clean method in case var is nan.#164

Merged
s-celles merged 1 commit into
python-windrose:masterfrom
15b3:fix_clean_method
Oct 25, 2021
Merged

Fix clean method in case var is nan.#164
s-celles merged 1 commit into
python-windrose:masterfrom
15b3:fix_clean_method

Conversation

@15b3

@15b3 15b3 commented Oct 25, 2021

Copy link
Copy Markdown
Contributor

Fix #163.

varmask = var != 0 & np.isfinite(var)

Since the & operator has a higher precedence than the != operator,
the 0 & np.isfinite(var) will be done first, not the var != 0.

Therefore, we need to make the order of calculations explicit.

varmask = (var != 0) & np.isfinite(var)

In addition,

  • Fixed clean_df function (Similar bug).
  • Added tests of them.

@s-celles

Copy link
Copy Markdown
Member

@s-celles s-celles merged commit e88c176 into python-windrose:master Oct 25, 2021
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.

clean method bug if a var is nan

2 participants