Skip to content

TST/CLN: parametrize and clean test_expressions, test_nanops #28553

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

Merged
merged 19 commits into from
Sep 23, 2019

Conversation

jbrockmendel
Copy link
Member

These are each going to need at least one more pass after this.

@jreback jreback added the Testing pandas testing functions or related to the test suite label Sep 20, 2019
@jreback jreback added this to the 1.0 milestone Sep 20, 2019
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Thanks for paying this one right back ha...

Looks pretty good - definitely in need of this here. I don't think any actions required just some questions that may help to review

@@ -152,14 +149,13 @@ def check_fun_data(
targfunc,
testarval,
targarval,
targarnanval,
Copy link
Member

Choose a reason for hiding this comment

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

Can you just comment on what this removal is?

Copy link
Member Author

Choose a reason for hiding this comment

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

On 212-213 we check if targarnan is None and if so set targarnan = testar. That condition always holds in the test, so ripped it out, and targarnanval as a consequence

@pytest.mark.parametrize(
"dtype",
[
np.int16,
Copy link
Member

Choose a reason for hiding this comment

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

Not here and no action required but maybe want to expand to cover unsigned and 8 bit versions. I've seen that in a few other PRs so should become a fixture if not already

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea

Copy link
Contributor

Choose a reason for hiding this comment

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

we also have our fixtures for dtypes (not blocking this PR)

np.int64,
np.float32,
np.float64,
getattr(np, "float128", None),
Copy link
Member

Choose a reason for hiding this comment

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

Is there a good way to convert this to a skip if not available?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess we could make this:

pytest.param(getattr(np, "float128", None), marks=pytest.skipif(not hasattr(np, "float128"))

Tough call whether the explicit skip is worth the added verbosity

)

def test_nansum(self):
self.check_funs(
nanops.nansum,
np.sum,
allow_str=False,
Copy link
Member

Choose a reason for hiding this comment

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

Is this just universally removed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

yah, so just removed allow_str altogether.

@pytest.mark.parametrize(
"dtype",
[
np.int16,
Copy link
Contributor

Choose a reason for hiding this comment

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

we also have our fixtures for dtypes (not blocking this PR)

else:
assert result.dtype == dtype
s = Series(range(10), dtype=dtype)
group_a = ["mean", "std", "var", "skew", "kurt"]
Copy link
Contributor

Choose a reason for hiding this comment

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

likely can be parmaterize using our aggregation fixtures

@jreback jreback merged commit 8f9a75c into pandas-dev:master Sep 23, 2019
@jreback
Copy link
Contributor

jreback commented Sep 23, 2019

thanks, a couple of follow-on comments

@jbrockmendel jbrockmendel deleted the faster22 branch September 23, 2019 12:47
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants