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 show_versions() function for printing debugging information used in issue reports #466

Merged
merged 17 commits into from
May 31, 2020

Conversation

seisman
Copy link
Member

@seisman seisman commented May 31, 2020

Description of proposed changes

The show_versions function reports system information, package versions and GMT library information. The output looks like:

PyGMT information:
  version: v0.1.1+20.g4d11e8c.dirty
System information:
  python: 3.7.6 (default, Jan  8 2020, 13:42:34)  [Clang 4.0.1 (tags/RELEASE_401/final)]
  executable: /Users/seisman/.anaconda/bin/python
  machine: Darwin-19.4.0-x86_64-i386-64bit
Dependency information:
  numpy: 1.18.1
  pandas: 1.0.1
  xarray: 0.15.1
  netCDF4: 1.5.3
  packaging: 20.1
  ghostscript: 9.50
  gmt: 6.1.0_ddd829b_2020.05.29
GMT library information:
  binary dir: /Users/seisman/.anaconda/bin
  cores: 8
  grid layout: rows
  library path: /Users/seisman/local/GMT/lib/libgmt.dylib
  padding: 2
  plugin dir: /Users/seisman/local/GMT/lib/gmt/plugins
  share dir: /Users/seisman/local/GMT/share
  version: 6.1.0

TODO:

  • Update the github issue template
  • Update the pygmt test instructions in the documentation
  • Replace print_clib_info() with show_versions in Makefile

Fixes #460

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

@seisman seisman requested review from leouieda and weiji14 May 31, 2020 18:26
@weiji14
Copy link
Member

weiji14 commented May 31, 2020

Trying to think of other good ones to print, maybe conda and ghostscript?

@seisman
Copy link
Member Author

seisman commented May 31, 2020

I agree with ghostscript, but do we really care about conda version?

@weiji14
Copy link
Member

weiji14 commented May 31, 2020

Yeah, let's skip conda. It's looking really good by the way! One more thing we might want is to have it print out a more specific GMT version using (gmt --version?). conda list used to show the build number I think.

@vercel vercel bot temporarily deployed to Preview May 31, 2020 19:25 Inactive
pygmt/__init__.py Show resolved Hide resolved
pygmt/__init__.py Show resolved Hide resolved
@seisman
Copy link
Member Author

seisman commented May 31, 2020

One more thing we might want is to have it print out a more specific GMT version using (gmt --version?).

Agree.

conda list used to show the build number I think.

Yes, but conda list is usually slow.

@vercel vercel bot temporarily deployed to Preview May 31, 2020 20:00 Inactive
@seisman
Copy link
Member Author

seisman commented May 31, 2020

GMT version added. See the first comment for the updated output.

@seisman seisman changed the title Add show_versions function for print useful debugging information Add show_versions() function for printing debugging information used in issue reports May 31, 2020
@seisman seisman added the feature Brand new feature label May 31, 2020
@seisman seisman added this to the 0.2.x milestone May 31, 2020
@seisman seisman added this to In progress in Release v0.2.x via automation May 31, 2020
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

Great work @seisman, just one small comment to improve the documentation of show_versions. This is what it looks like on my system, the GMT version is duplicated but that's fairly minor:

PyGMT information:
  version: v0.1.1+21.gb55250e.dirty
System information:
  python: 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 23:03:20)  [GCC 7.3.0]
  executable: /home/weiji/miniconda3/envs/pygmt/bin/python
  machine: Linux-4.19.0-8-amd64-x86_64-with-debian-10.4
Dependency information:
  numpy: 1.18.4
  pandas: 1.0.4
  xarray: 0.15.1
  netCDF4: 1.5.3
  packaging: 20.4
  ghostscript: 9.22
  gmt: 6.0.0
GMT library information:
  binary dir: /home/weiji/miniconda3/envs/pygmt/bin
  cores: 2
  grid layout: rows
  library path: /home/weiji/miniconda3/envs/pygmt/lib/libgmt.so
  padding: 2
  plugin dir: /home/weiji/miniconda3/envs/pygmt/lib/gmt/plugins
  share dir: /home/weiji/miniconda3/envs/pygmt/share/gmt
  version: 6.0.0

There should be room to add extra stuff to this going forward. Would be great ot print out what's in gmt.conf but that's low priority right now.

pygmt/__init__.py Outdated Show resolved Hide resolved
@seisman
Copy link
Member Author

seisman commented May 31, 2020

This is what it looks like on my system, the GMT version is duplicated but that's fairly minor:

Yes, the two GMT versions are different if

  • users are using the GMT master branch
  • there are multiple GMT installed, and the loaded library is different from the in the command line

There should be room to add extra stuff to this going forward. Would be great ot print out what's in gmt.conf but that's low priority right now.

We perhaps can wrap the gmt defaults module, but I agree it's very low priority.

Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview May 31, 2020 20:51 Inactive
pygmt/__init__.py Outdated Show resolved Hide resolved
pygmt/__init__.py Outdated Show resolved Hide resolved
pygmt/__init__.py Outdated Show resolved Hide resolved
@seisman seisman merged commit ec5e92c into master May 31, 2020
Release v0.2.x automation moved this from In progress to Done May 31, 2020
@seisman seisman deleted the show-versions branch May 31, 2020 21:22
@weiji14 weiji14 modified the milestones: 0.2.x, 0.1.x Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Brand new feature
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Add show_versions function for easier bug reporting
3 participants