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

Add ixmp show-versions #320

Merged
merged 7 commits into from
Apr 27, 2020
Merged

Add ixmp show-versions #320

merged 7 commits into from
Apr 27, 2020

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Apr 27, 2020

Add a CLI command ixmp show-versions / top-level function ixmp.show_versions()—modeled after similar in xarray—that prints out versions of ixmp and its dependencies.

Since we often run these codes from development branches, this version is enhanced to show the current git commit and branch for any repo installed with pip install --editable:

$ ixmp show-versions

ixmp:        2.0.0.post.dev258
     279d289 (HEAD -> feature/show-versions, khaeru/feature/show-versions) Update install.rst, release notes
message_ix:  2.0.0
     3bbe74f (HEAD -> master, iiasa/master) Exclude JPype1 0.7.3 (iiasa/ixmp#279, iiasa/ixmp#318)
message_data: installed
     9597de3 (HEAD -> CH4_reporting, min/CH4_reporting) Expand docs of reporting.util.collapse

click:       7.0
dask:        2.14.0
graphviz:    0.8.4
jpype:       0.7.3
pandas:      1.0.1
pint:        0.11
xarray:      0.15.1
xlrd:        installed
xlsxwriter:  1.1.7
yaml:        5.1.2

iam_units:   installed
jupyter:     installed
matplotlib:  3.2.1
plotnine:    0.6.0
pyam:        0.5.0+14.g9d0a4ac
     9d0a4ac (HEAD -> issue/368, khaeru/issue/368) Revise release notes per review comment

python:      3.7.5 (default, Apr 19 2020, 20:18:17) 
[GCC 9.2.1 20191008]
python-bits: 64
OS:          Linux
OS-release:  5.3.0-48-generic
machine:     x86_64
processor:   x86_64
byteorder:   little
LC_ALL:      None
LANG:        en_CA.UTF-8
LOCALE:      en_CA.UTF-8

Also add GitHub issue templates that prompt users to run this command when reporting a bug.

How to review

Try it and paste your results!

PR checklist

  • Tests added.
  • Documentation added.
  • Release notes updated.

@khaeru khaeru added the enh New features & functionality label Apr 27, 2020
@khaeru khaeru self-assigned this Apr 27, 2020
@codecov
Copy link

codecov bot commented Apr 27, 2020

Codecov Report

Merging #320 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #320      +/-   ##
==========================================
+ Coverage   97.41%   97.43%   +0.02%     
==========================================
  Files          41       41              
  Lines        4253     4292      +39     
==========================================
+ Hits         4143     4182      +39     
  Misses        110      110              
Impacted Files Coverage Δ
ixmp/__init__.py 100.00% <100.00%> (ø)
ixmp/cli.py 98.70% <100.00%> (+0.02%) ⬆️
ixmp/tests/test_cli.py 100.00% <100.00%> (ø)
ixmp/utils.py 96.71% <100.00%> (+0.91%) ⬆️
ixmp/backend/io.py 98.55% <0.00%> (-0.02%) ⬇️
ixmp/core.py 95.80% <0.00%> (-0.01%) ⬇️

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 7212fe7...751b973. Read the comment docs.

@francescolovat
Copy link
Contributor

Hi @khaeru,

thank you for this update. In my machine this seems to be working smoothly:

(base) C:\Users\lovat\Documents\GitHub\francescolovat\ixmp>ixmp show-versions
C:\Users\lovat\AppData\Local\Continuum\anaconda3\lib\site-packages\xarray\core\merge.py:10: FutureWarning: The Panel class is removed from pandas. Accessing it from the top-level namespace will also be removed in the next version
  PANDAS_TYPES = (pd.Series, pd.DataFrame, pd.Panel)
C:\Users\lovat\AppData\Local\Continuum\anaconda3\lib\site-packages\statsmodels\tools\_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
  import pandas.util.testing as tm

ixmp:        2.0.0.post.dev259
     751b973 (HEAD -> feature/show-versions, khaeru/feature/show-versions) Revise order of outputs from utils.show_versions; fix 'iam_units' dep
message_ix:  2.0.0
     3bbe74f (HEAD -> master, upstream/master, origin/master, origin/HEAD) Exclude JPype1 0.7.3 (iiasa/ixmp#279, iiasa/ixmp#318)
message_data: installed
     730d52c (HEAD -> reporting-SE, origin/reporting-SE) added missing entries for SE Gases to reporting

click:       7.0
dask:        2.14.0
graphviz:    0.13
jpype:       0.7.0
pandas:      1.0.1
pint:        0.11
xarray:      0.11.3
xlrd:        1.2.0
xlsxwriter:  1.1.8
yaml:        5.1.2

iam_units:   installed
     2dfb706 (HEAD) Merge pull request #18 from danielhuppmann/def/orders_of_magnitude
jupyter:     1.0.0
matplotlib:  3.0.2
plotnine:    0.6.0+48.g8125f00
     8125f00 (HEAD -> master, origin/master, origin/dev, origin/HEAD) Fix skewed arrow head for facetted plots
pyam:        0.5.0+7.g063875b
     063875b (HEAD -> master, origin/master, origin/HEAD) Handle context=None in convert_unit when input/output GHG species match (#369)

python:      3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
python-bits: 64
OS:          Windows
OS-release:  10
machine:     AMD64
processor:   Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
byteorder:   little
LC_ALL:      None
LANG:        None
LOCALE:      None.None

Just two comments:

  • I don't understand why here master is shown for both origin and upstream:
    (HEAD -> master, upstream/master, origin/master, origin/HEAD).
  • Second: the jpype1 version that I have is 0.7.0, also shown with pip list. However, if I run conda list I see that jpype1 version is 0.7.2. Do you know why that might happen?
# Name                    Version                   Build  Channel
jpype1                    0.7.2                    pypi_0    pypi

@francescolovat francescolovat self-requested a review April 27, 2020 13:39
@francescolovat
Copy link
Contributor

francescolovat commented Apr 27, 2020

Another unrelated comment, in reporting/computations.py, the docstring of select() is not correctly reporting the argument indexer (in the doctring is written select). Can I just quickly push that small edit here, or should it be treated separately?

@khaeru
Copy link
Member Author

khaeru commented Apr 27, 2020

Can I just quickly push that small edit here, or should it be treated separately?

Good eye. Since it's unrelated, probably a separate PR?

@khaeru
Copy link
Member Author

khaeru commented Apr 27, 2020

I don't understand why here master is shown for both origin and upstream:
(HEAD -> master, upstream/master, origin/master, origin/HEAD).

These are separate remotes on your local git repo. git remote -v should illuminate.

Second: the jpype1 version that I have is 0.7.0, also shown with pip list. However, if I run conda list I see that jpype1 version is 0.7.2. Do you know why that might happen?

My guess is conda list shows the package version in the current conda environment or, if there is none, the conda 'base' environment. If you create a conda environment and install pip into that environment, then pip install ... will update the packages of that environment. But if not, I'm not sure which pip is used or where the packages are installed; try pip show jpype1 to see where it's loaded from.

In any case, show-versions tells us which version is actually imported by ixmp, rather than which other versions might be installed elsewhere on your system, but are not used by ixmp. The former is the one we want to know about when diagnosing errors.

And both points are good signs, in the sense that using show-versions can help us identify odd things in a user's environment that might be related to a bug or error. Thanks for taking the time to review!

@khaeru khaeru added this to the 3.0 milestone Apr 27, 2020
@khaeru khaeru merged commit fd7f77b into iiasa:master Apr 27, 2020
@khaeru khaeru deleted the feature/show-versions branch April 27, 2020 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants