Skip to content
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

WIP: Cleanup pandas tests #741

Closed
wants to merge 15 commits into from

Conversation

znicholls
Copy link
Contributor

An attempt to clean the pandas tests up a bit. @hgrecco I'm still a bit unsure whether to use HAS_PANDAS or set pd = None if there's no Pandas available. It's not that clear which convention to use where and it seems like pd = None implies there is no pandas available (like np = None implies no numpy available).

@znicholls znicholls changed the title Cleanup pandas tests WIP: Cleanup pandas tests Dec 1, 2018
@hgrecco
Copy link
Owner

hgrecco commented Dec 1, 2018

Do you need help?

@znicholls
Copy link
Contributor Author

Yep. The easy question: how are e.g. HAS_NUMPY and pd.compat.np related?

The harder question, is it possible to clean up the pandas related tests. I wanted to get rid of this massive if clause that we currently have but can't work out how. I've arrived at trying to use SkipTest, but that's failing for Python2.7 and Python3.3 and I have no idea why/how to fix it. Any ideas are appreciated but it may just be overkill.

@hgrecco
Copy link
Owner

hgrecco commented Dec 3, 2018

The idea is that for a feature X there is an HAS_X boolean that tell us that the feature is available. Additionally (and certainly redundant) we provide all the classes / modules equal to None just to allow any rogue import to work. But the ideas is that everybody test agains HAS_X

A way out of this problen (annoying but that would work) is to migrate to UnitTest. The conditional testing there works flawlesly and you can use the current NumPy test in pint as example.

@znicholls
Copy link
Contributor Author

znicholls commented Dec 13, 2018

A way out of this problen (annoying but that would work) is to migrate to UnitTest

Sadly I can't do that as all the underlying pandas tests are written with pytest.

What do you think about moving all the pandas stuff out into a separate, wrapper repo in the style of cyberpandas https://github.com/ContinuumIO/cyberpandas? It would mean that Pint stays clean and dependency free and all the nasty dependency handling can go elsewhere? I would set things up so that the tests are run daily to tell us fairly quickly if any Pint changes break the pandas interface.

@hgrecco
Copy link
Owner

hgrecco commented Dec 13, 2018 via email

@andrewgsavage
Copy link
Collaborator

Give us a shout when you do that as I've made a branch that's passing pandas tests again.

@hgrecco
Copy link
Owner

hgrecco commented Dec 24, 2018

I created a stub repo in https://github.com/hgrecco/pint-pandas

@hgrecco
Copy link
Owner

hgrecco commented Dec 30, 2018

I think we can close this, right?

@znicholls
Copy link
Contributor Author

znicholls commented Dec 30, 2018 via email

@hgrecco hgrecco closed this Dec 28, 2019
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.

3 participants