Skip to content

Fix pandas Deprecaction and Future Warnings - #898

Merged
dwhswenson merged 3 commits into
openpathsampling:masterfrom
sroet:fix_pd_depr
Feb 7, 2020
Merged

dwhswenson merged 3 commits into
openpathsampling:masterfrom
sroet:fix_pd_depr

Conversation

@sroet

@sroet sroet commented Feb 1, 2020 •

Copy link
Copy Markdown
Member

This started with the warnings:

DeprecationWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
    Z_new = pd.Series(index=hists)

and

FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.

Which led to the same warnings as #881 after touching the files.

This also fixes some pep8 complaints and a small logic error in TestTotalCrossingProbability.test_calculate() where the result was checked for AB twice instead of both AB and BA

@dwhswenson dwhswenson 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.

Thanks for the fix. Looks good, except a few code style changes I disagree with.

In general, I think that:

    some_deeply_nested_long_function_name_with_complex_kwargs(
        kwarg1=value,
        kwarg2={dict_key: [list1, list2]}
    )

looks better than

    some_deeply_nested_long_function_name_with_complex_kwargs(kwarg1=value,
                                                              kwarg2={dict_key: [list1,
                                                                                 list2]})

If the args are likely to hit the 80 char limit (or are sufficiently complex), I put them in the first style above.

Undo a couple minor style changes, and this is good to go!

Comment thread openpathsampling/numerics/wham.py Outdated
Comment thread openpathsampling/tests/test_tis_analysis.py Outdated
Comment thread openpathsampling/tests/test_tis_analysis.py Outdated
Comment thread openpathsampling/tests/test_tis_analysis.py Outdated
@sroet

sroet commented Feb 7, 2020

Copy link
Copy Markdown
Member Author

@dwhswenson all (un)done

@dwhswenson

Copy link
Copy Markdown
Member

Waiting for tests to finish; then will merge!

@dwhswenson
dwhswenson merged commit 393beaf into openpathsampling:master Feb 7, 2020
@dwhswenson dwhswenson changed the title Fix pandas Deprepaction and Future Warnings Fix pandas Deprecaction and Future Warnings Aug 12, 2020
@sroet
sroet deleted the fix_pd_depr branch August 13, 2020 06:08
@dwhswenson dwhswenson mentioned this pull request Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants