Skip to content

Explicit LooseVersion comps #18637

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 1 commit into from
Dec 6, 2017
Merged

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Dec 4, 2017

@jreback jreback added the Compat pandas objects compatability with Numpy or Python functions label Dec 5, 2017
@jreback jreback added this to the 0.22.0 milestone Dec 5, 2017
@jreback
Copy link
Contributor

jreback commented Dec 5, 2017

lgtm. ping on green.

@codecov
Copy link

codecov bot commented Dec 5, 2017

Codecov Report

Merging #18637 into master will decrease coverage by 0.01%.
The diff coverage is 89.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18637      +/-   ##
==========================================
- Coverage   91.59%   91.57%   -0.02%     
==========================================
  Files         155      155              
  Lines       51255    51255              
==========================================
- Hits        46948    46939       -9     
- Misses       4307     4316       +9
Flag Coverage Δ
#multiple 89.44% <89.28%> (ø) ⬆️
#single 40.67% <46.42%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/computation/check.py 90.9% <100%> (ø) ⬆️
pandas/io/html.py 85.98% <100%> (ø) ⬆️
pandas/io/pytables.py 92.84% <100%> (ø) ⬆️
pandas/io/sql.py 94.79% <100%> (ø) ⬆️
pandas/compat/__init__.py 58.77% <100%> (ø) ⬆️
pandas/compat/numpy/__init__.py 93.93% <100%> (ø) ⬆️
pandas/core/missing.py 84.3% <100%> (ø) ⬆️
pandas/io/feather_format.py 85.71% <100%> (ø) ⬆️
pandas/util/testing.py 81.82% <50%> (ø) ⬆️
pandas/io/parquet.py 65.38% <75%> (ø) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a764663...f0b73f8. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 5, 2017

Codecov Report

Merging #18637 into master will decrease coverage by 0.01%.
The diff coverage is 89.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18637      +/-   ##
==========================================
- Coverage   91.59%   91.57%   -0.02%     
==========================================
  Files         153      153              
  Lines       51221    51221              
==========================================
- Hits        46917    46908       -9     
- Misses       4304     4313       +9
Flag Coverage Δ
#multiple 89.44% <89.28%> (ø) ⬆️
#single 40.67% <46.42%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/computation/check.py 90.9% <100%> (ø) ⬆️
pandas/io/feather_format.py 85.71% <100%> (ø) ⬆️
pandas/io/pytables.py 92.84% <100%> (ø) ⬆️
pandas/io/sql.py 94.79% <100%> (ø) ⬆️
pandas/compat/numpy/__init__.py 93.93% <100%> (ø) ⬆️
pandas/core/missing.py 84.3% <100%> (ø) ⬆️
pandas/io/html.py 85.98% <100%> (ø) ⬆️
pandas/compat/__init__.py 58.77% <100%> (ø) ⬆️
pandas/util/testing.py 82.01% <50%> (ø) ⬆️
pandas/io/parquet.py 65.38% <75%> (ø) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13f6267...87b4c42. Read the comment docs.

@WillAyd
Copy link
Member Author

WillAyd commented Dec 5, 2017

@jreback all green

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Added a comment about line continuation, mainly to be consistent within the code base (please check the full diff, I didn't comment on all of them)

@@ -7,7 +7,8 @@
try:
import numexpr as ne
ver = ne.__version__
_NUMEXPR_INSTALLED = ver >= LooseVersion(_MIN_NUMEXPR_VERSION)
_NUMEXPR_INSTALLED = LooseVersion(ver) >= \
LooseVersion(_MIN_NUMEXPR_VERSION)
Copy link
Member

Choose a reason for hiding this comment

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

Please use (..) for line continuation instead of \ (but here maybe you can also add the 'LooseVersion' on the line above (ver = LooseVersion(ne.__version__) to avoid the need of a line continuation)

Copy link
Member Author

Choose a reason for hiding this comment

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

Was trying to keep all LooseVersion comps on the same line, but changed this back to put the one LooseVersion back on the line above for readability.

self._pyarrow_lt_050 = LooseVersion(pyarrow.__version__) < '0.5.0'
self._pyarrow_lt_060 = LooseVersion(pyarrow.__version__) < '0.6.0'
self._pyarrow_lt_050 = LooseVersion(pyarrow.__version__) < \
LooseVersion('0.5.0')
Copy link
Member

Choose a reason for hiding this comment

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

same here

@@ -37,7 +37,8 @@ def testit():
except ImportError:
pytest.skip("no numexpr")
else:
if ne.__version__ < LooseVersion(_MIN_NUMEXPR_VERSION):
if LooseVersion(ne.__version__) < \
Copy link
Member

Choose a reason for hiding this comment

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

same here

@pep8speaks
Copy link

pep8speaks commented Dec 5, 2017

Hello @WillAyd! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on December 06, 2017 at 01:11 Hours UTC

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

couple of style issues. otherwise lgtm. ping on green.

@@ -37,7 +37,9 @@ def testit():
except ImportError:
pytest.skip("no numexpr")
else:
if ne.__version__ < LooseVersion(_MIN_NUMEXPR_VERSION):
if (
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm this looks funny.

@@ -212,7 +212,9 @@ def test_rank_methods_frame(self):
sprank = sprank.astype(np.float64)
expected = DataFrame(sprank, columns=cols)

if LooseVersion(scipy.__version__) >= '0.17.0':
if (
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@jreback jreback merged commit 1d88cdb into pandas-dev:master Dec 6, 2017
@jreback
Copy link
Contributor

jreback commented Dec 6, 2017

thanks!

@WillAyd WillAyd deleted the loose-version-cmp branch December 6, 2017 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plotting/_compat Version Comparisons Not Working in Py27
4 participants