10000 Use pandas wrapper functions for the test suite by kandersolar · Pull Request #1021 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Use pandas wrapper functions for the test suite #1021

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 7 commits into from
Aug 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add wrapper functions for pandas testing asserts
  • Loading branch information
kandersolar committed Aug 6, 2020
commit a3da3b6da00560498187b07bedfac217d9ad3823
23 changes: 23 additions & 0 deletions pvlib/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,29 @@ def inner(*args, **kwargs):
return inner
return wrapper


# custom test function that handles the change in default
# tolerances in pandas 1.1.0. See pvlib GH #1018
def assert_series_equal(left, right, **kwargs):
if parse_version(pd.__version__) >= parse_version('1.1.0'):
kwargs.pop('check_less_precise')
else:
kwargs.pop('rtol')
kwargs.pop('atol')
pd.testing.assert_series_equal(left, right, **kwargs)


# custom test function that handles the change in default
# tolerances in pandas 1.1.0. See pvlib GH #1018
def assert_frame_equal(left, right, **kwargs):
if parse_version(pd.__version__) >= parse_version('1.1.0'):
kwargs.pop('check_less_precise')
else:
kwargs.pop('rtol')
kwargs.pop('atol')
pd.testing.assert_frame_equal(left, right, **kwargs)


# commonly used directories in the tests
TEST_DIR = Path(__file__).parent
DATA_DIR = TEST_DIR.parent / 'data'
Expand Down
0