-
-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
[MRG] added parse_version to sklearn.utils #8301
Conversation
ping @lesteve |
You will need to add tests and to use this everywhere that we do version comparison in the code. |
sklearn/_build_utils/__init__.py:from distutils.version import LooseVersion
sklearn/_build_utils/__init__.py:if LooseVersion(Cython.__version__) < CYTHON_MIN_VERSION: |
Just curious why did you not replace all of them? Maybe you can not import sklearn during the cython build or something like this ? Quickly grepping for
|
Yes, the relative import |
Working on the AppVeyor failures. Travis errors seem erroneous. Can you review the Travis failures please? |
Codecov Report
@@ Coverage Diff @@
## master #8301 +/- ##
==========================================
- Coverage 96.19% 94.66% -1.53%
==========================================
Files 348 344 -4
Lines 64645 60968 -3677
==========================================
- Hits 62187 57718 -4469
- Misses 2458 3250 +792
Continue to review full report at Codecov.
|
Good practice: be explicit. What is the error? What makes you think it is erroneous? Quickly looking at the Travis error they seems genuine. |
Actually the time when I commented, the errors were appearing in files that I had not changed and were defying class definitions. That's why they seemed erroneous. Look alright now, working on fixing it. |
Any reason the codecov errors should be appearing? |
I think we can ignore that for now. I'll try to review your changes in more details in the upcoming days. For the record, codecov errors means that too much code you have changed or added in your PR is not covered by tests. You can try to install the codecov extension for your favourite browser and look for code that is not covered by tests. You can also try to browse the codecov link but sometimes it is harder to make sense of it. Quickly looking at it it seems that some code in sklearn/utils/version.py (for example the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more generic question is did you just take the setuptools code as it was or did you change a few things?
To be honest I was hoping the code could be simplified but thinking about it it's probably better to keep it as close as possible to the setuptools code.
@@ -0,0 +1,361 @@ | |||
from __future__ import absolute_import, division, print_function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a module docstring here. Among other things, it should mention where (which package, file, version) the code has been taken from.
return epoch, release, pre, post, dev, local | ||
|
||
|
||
class Infinity(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you understand when Infinity and NegativeInfinity are used? It would be great to add tests for this so that the coverage increases.
Reopening as per comment. |
Reference Issue
Fixes #7980
What does this implement/fix? Explain your changes.
This adds
parse_version
tosklearn.utils
which is to replacesklearn.utils.fixes._parse_version
andLooseVersion
in scikit-learnAny other comments?
I have just followed what @lesteve guided me in the issue thread. Please let me know if my approach is correct and if we can start implementing it throughout scikit-learn.