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

[MRG] Show versions and system info for debugging #557

Merged
merged 9 commits into from Mar 30, 2019

Conversation

Projects
None yet
3 participants
@hayesall
Copy link
Contributor

commented Mar 15, 2019

Fixes #542: "show versions"

This pull request:

  1. makes version/system information available from the command line
  2. uses two of the methods used in sklearn
  3. changes contributing guidelines and issue template to reference this functionality

Automatically formatting for issues

Per a comment by @glemaitre, this can surround system information with <detail> tags. For example, my system information output as follows:

System, BLAS, and Dependencies

System Information

  • python : 3.7.2 (default, Dec 29 2018, 00:00:04) [Clang 4.0.1 (tags/RELEASE_401/final)]
  • executable: /Users/hayesall/anaconda3/envs/imblearn/bin/python
  • machine : Darwin-17.7.0-x86_64-i386-64bit

BLAS

  • macros : NO_ATLAS_INFO=3, HAVE_CBLAS=None
  • lib_dirs : ``
  • cblas_libs: cblas

Python Dependencies

  • pip : 19.0.3
  • setuptools: 40.8.0
  • imblearn : 0.5.0.dev0
  • sklearn : 0.20.3
  • numpy : 1.16.2
  • scipy : 1.2.1
  • Cython : None
  • pandas : None

Multiple ways to use this functionality

I made changes in the .github/ISSUE_TEMPLATE.md and CONTRIBUTING.md in order to reflect these changes.

I found the following to be easiest (for copying-and-pasting):

python -c "from imblearn import show_versions; show_versions(github=True)"

But listing actual Python code would also be an option:

from imblearn import show_versions
show_versions(github=True)

Screenshot depicting two use cases

Screen Shot 2019-03-15 at 4 21 36 PM

Final Comments

Four commits each correspond to a specific change. If additional changes are needed prior to merging, I can squash/drop/revoke to get everything in working order.

Thank you developers!

hayesall added some commits Mar 15, 2019

`show_versions` utility to help with debugging
Add `imblearn/utils/_show_versions.py` with `show_versions`

This uses the private methods from `sklearn.utils._show_versions`,
but adapts the outputs in order to also print GitHub markdown
for use when filing issues or pull requests.

```
from imblearn.utils._show_versions import show_versions
show_versions()
show_versions(github=True)
```
Import `show_versions` from `imblearn.__init__`
Add `from imblearn.utils._show_versions import show_versions` to
    be imported

```
from imblearn import show_versions
show_versions(github=True)
```
@codecov

This comment has been minimized.

Copy link

commented Mar 15, 2019

Codecov Report

Merging #557 into master will decrease coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #557      +/-   ##
==========================================
- Coverage   98.87%   98.79%   -0.08%     
==========================================
  Files          82       84       +2     
  Lines        5056     5154      +98     
==========================================
+ Hits         4999     5092      +93     
- Misses         57       62       +5
Impacted Files Coverage Δ
imblearn/utils/_show_versions.py 100% <100%> (ø)
imblearn/utils/tests/test_show_versions.py 100% <100%> (ø)
imblearn/over_sampling/_smote.py 95.54% <0%> (-1.72%) ⬇️

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 985238e...947602f. Read the comment docs.

💚 Unit tests for show_versions
Add `imblearn/utils/tests/test_show_versions.py` which tests
    for keywords in the output of `show_versions`
@glemaitre

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

This looks neat. Thanks @batflyer.
Could you add an entry in what's new for noting your contribution?

@glemaitre

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

Four commits each correspond to a specific change. If additional changes are needed prior to merging, I can squash/drop/revoke to get everything in working order.

We will manage the squashing through the GitHub API

@chkoar

This comment has been minimized.

Copy link
Member

commented Mar 17, 2019

Thanks @batflyer! Maybe we should retain for some time the old reporting of versions because it is quite common that many users haven't installed the dev version. So, we might prompt them to use the new functionality and if it is not available to report using the old way.

hayesall added some commits Mar 18, 2019

@hayesall

This comment has been minimized.

Copy link
Contributor Author

commented Mar 18, 2019

@chkoar I reverted the two commits modifying CONTRIBUTING.md and ISSUE_TEMPLATE.md; hopefully this avoids confusion until the next release. These can be added in at the 0.5 release.

I also missed including keras and tensorflow as optional dependencies. 9548b73 adds them to the output of show_versions(), and tests for their existence in the output.

New auto-generated system summary:

System, BLAS, and Dependencies

System Information

  • python : 3.7.2 (default, Dec 29 2018, 00:00:04) [Clang 4.0.1 (tags/RELEASE_401/final)]
  • executable: /Users/hayesall/anaconda3/envs/imblearn/bin/python
  • machine : Darwin-17.7.0-x86_64-i386-64bit

BLAS

  • macros : NO_ATLAS_INFO=3, HAVE_CBLAS=None
  • lib_dirs : ``
  • cblas_libs: cblas

Python Dependencies

  • pip : 19.0.3
  • setuptools: 40.8.0
  • imblearn : 0.5.0.dev0
  • sklearn : 0.20.3
  • numpy : 1.16.2
  • scipy : 1.2.1
  • Cython : None
  • pandas : None
  • keras : None
  • tensorflow: None
@chkoar

This comment has been minimized.

Copy link
Member

commented Mar 30, 2019

@batflyer that's great, thanks! Do you thing that we could keep both reporting strategies without confusion? I mean: if you have this version and up do this otherwise do this?

@hayesall

This comment has been minimized.

Copy link
Contributor Author

commented Mar 30, 2019

Do you thing that we could keep both reporting strategies without confusion? I mean: if you have this version and up do this otherwise do this?

Having both might leave us with a chicken-and-the-egg problem (a user has to know the version of imblearn in order to report the versions of imblearn).

The majority of Issues will probably involve ~0.4 until the next minor release. It might make sense to include show_versions() in a pull_request_template, but I don't think there will be many times that system info would be as useful in a pull request since the tests should help diagnose most issues.

@chkoar

This comment has been minimized.

Copy link
Member

commented Mar 30, 2019

Ok. Merging as is and we will follow up. Thanks.

@chkoar chkoar merged commit 77cad85 into scikit-learn-contrib:master Mar 30, 2019

4 checks passed

LGTM analysis: Python No new or fixed alerts
Details
codecov/patch 100% of diff hit (target 98.87%)
Details
codecov/project Absolute coverage decreased by -0.07% but relative coverage increased by +1.12% compared to 985238e
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@hayesall hayesall deleted the hayesall:show_versions branch Mar 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.