GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add show_versions() function for printing debugging information used in issue reports by seisman · Pull Request #466 · GenericMappingTools/pygmt

Conversation

@seisman

@seisman seisman commented May 31, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@seisman
Add show_versions function for print useful debugging information
5e0aa5e
@seisman
seisman requested review from leouieda and weiji14 May 31, 2020 18:26
seisman added 6 commits May 31, 2020 14:33
@seisman
Replace print_clib_info with show_versions in Makefile
addd9c9
@seisman
Replace print_clib_info with show_versions in pygmt.test function
28ff569
@seisman
Move imports inside the function
5e04431
@seisman
Replace print_clib_info with show_versions in pygmt test instruction
9e0b8a4
@seisman
Update issue template
9f769d9
@seisman
Add show_verrsion to API documentations
7dfaef5
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 18:38 Inactive
@weiji14

weiji14 commented May 31, 2020

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman

seisman commented May 31, 2020

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman
Fix a typo
625c40f
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 19:06 Inactive
@seisman
Aslo check ghostscript version
0522361
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 19:19 Inactive
@weiji14

weiji14 commented May 31, 2020

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman
Refractor the _get_module_version function
b0f909a
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 19:25 Inactive
stickler-ci
stickler-ci reviewed May 31, 2020
View reviewed changes
Comment thread pygmt/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pygmt/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@seisman
Remove extra blank lines
b009c24
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 19:26 Inactive
@seisman
Small fix
f321439
@seisman

seisman commented May 31, 2020

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman
subprocess.check_output do not have the text argument until Py3.7
4c6d3cd
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 19:44 Inactive
@seisman
Output gmt --version
daf3f43
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 20:00 Inactive
@seisman

seisman commented May 31, 2020

Copy link
Copy Markdown
Member Author

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

weiji14 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman
Add a code block in issue template
b55250e
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 20:04 Inactive
@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
weiji14
weiji14 reviewed May 31, 2020
View reviewed changes

@weiji14 weiji14 left a comment

Copy link
Copy Markdown
Member

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.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pygmt/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@seisman

seisman commented May 31, 2020

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman @weiji14
Update function docstring
71630e3
Co-authored-by: Wei Ji <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 20:51 Inactive
stickler-ci
stickler-ci reviewed May 31, 2020
View reviewed changes
Comment thread pygmt/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pygmt/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pygmt/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@seisman
Fix
d82b872
@vercel
vercel Bot temporarily deployed to Preview May 31, 2020 20:53 Inactive
weiji14
weiji14 approved these changes May 31, 2020
View reviewed changes
@seisman
seisman merged commit ec5e92c into master 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
@weiji14 weiji14 mentioned this pull request Mar 5, 2023
Allow printing show_versions() to in-memory buffer to enable testing #2399
Merged
1 of 7 tasks
This was referenced May 12, 2024
pygmt.show_versions: Warn about incompatible ghostscript versions #3244
Merged
Remove the unused pygmt.print_clib_info function #3257
Merged
@seisman seisman mentioned this pull request Oct 19, 2024
Refactor the _get_module_version function using importlib and add two more tests #3538
Merged

This branch was previously deployed

1 inactive deployment
Preview — d82b872c Deployed May 31, 2020 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@weiji14 weiji14 weiji14 approved these changes
@leouieda leouieda Awaiting requested review from leouieda
+1 more reviewer
@stickler-ci stickler-ci stickler-ci left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

feature Brand new feature

Projects

None yet

Milestone

0.1.x

Development

Successfully merging this pull request may close these issues.

Add show_versions function for easier bug reporting

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@seisman @weiji14 @stickler-ci
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.