Skip to content

Use pandas wrapper functions for the test suite#1021

Merged
wholmgren merged 7 commits into
pvlib:masterfrom
kandersolar:pandas_test_tolerance
Aug 7, 2020
Merged

Use pandas wrapper functions for the test suite#1021
wholmgren merged 7 commits into
pvlib:masterfrom
kandersolar:pandas_test_tolerance

Conversation

@kandersolar

@kandersolar kandersolar commented Aug 7, 2020

Copy link
Copy Markdown
Member

Seeing what Azure thinks of the changes.

Possible to-do items:

  • Add tests for the new assert functions somehow?
  • Whatsnew?

@kandersolar

Copy link
Copy Markdown
Member Author

Tests pass. Codecov is low because it's only getting results from one branch of the if parse_version(pd.__version__) >= parse_version('1.1.0') switch, so it sees the other as uncovered.

@cwhanse cwhanse added the testing label Aug 7, 2020
@cwhanse cwhanse added this to the 0.8.0 milestone Aug 7, 2020

@wholmgren wholmgren left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 for a what's new entry. It might be worth testing the _check_pandas_assert_kwargs function with a mocked pd.__version__.

@kandersolar

Copy link
Copy Markdown
Member Author

A mocked version test is interesting but I'm not sure how it would work. Mock the other version and test that it raises a TypeError for the unexpected keyword argument?

@wholmgren

Copy link
Copy Markdown
Member

I'd patch and set the appropriate return_value for both conditions regardless of the true pandas version. The test would assert that the correct kwargs are included/excluded from the function.

@kandersolar

Copy link
Copy Markdown
Member Author

Thanks, that got me on the right track. I've added a test, but wouldn't be surprised if it could be made simpler.

@wholmgren wholmgren merged commit 9f56660 into pvlib:master Aug 7, 2020
@wholmgren

Copy link
Copy Markdown
Member

thanks @kanderso-nrel!

@kandersolar kandersolar deleted the pandas_test_tolerance branch August 8, 2020 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pandas.testing.assert_series_equal precision defaults changed in pandas 1.1.0

3 participants