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

pygmt.show_versions: Remove _get_gdal_version and create a dictionary for dependency versions #3376

Merged
merged 8 commits into from
Aug 7, 2024

Conversation

seisman
Copy link
Member

@seisman seisman commented Aug 5, 2024

Description of proposed changes

  1. Remove _get_gdal_version and create a dictionary for dependency versions The private function was added in Let pygmt.show_versions show GDAL version #3364.
  2. Move imports out of the functions
  3. Check gs_version=None in _check_ghostscript_version May fail to find ghostscript as shown in Module 'psconvert' failed with status code 79: psconvert [ERROR]: Cannot execute Ghostscript (gswin64c). #3366.
>>> import pygmt

>>> pygmt.show_versions()
PyGMT information:
  version: v0.12.1.dev78+g9c13eb04b.d20240709
System information:
  python: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:38:13) [GCC 12.3.0]
  executable: /home/seisman/opt/miniforge/envs/pygmt/bin/python3.12
  machine: Linux-6.9.9-200.fc40.x86_64-x86_64-with-glibc2.39
Dependency information:
  numpy: 2.0.0
  pandas: 2.2.2
  xarray: 2024.6.0
  netCDF4: 1.6.5
  packaging: 24.1
  contextily: 1.6.0
  geopandas: 1.0.0
  IPython: 8.25.0
  rioxarray: 0.15.6
  gdal: 3.9.0
  ghostscript: 10.03.1
GMT library information:
  version: 6.5.0
  padding: 2
  share dir: /home/seisman/opt/miniforge/envs/pygmt/share/gmt
  plugin dir: /home/seisman/opt/miniforge/envs/pygmt/lib/gmt/plugins
  library path: /home/seisman/opt/miniforge/envs/pygmt/lib/libgmt.so
  cores: 80
  grid layout: rows
  image layout:
  binary version: 6.5.0

@seisman seisman added the maintenance Boring but important stuff for the core devs label Aug 5, 2024
@seisman seisman added this to the 0.13.0 milestone Aug 5, 2024
@seisman seisman added the needs review This PR has higher priority and needs review. label Aug 5, 2024
@seisman seisman changed the title pygmt.show_versions: Remove the _get_gdal_version and create a dictionary for dependency versions pygmt.show_versions: Remove _get_gdal_version and create a dictionary for dependency versions Aug 5, 2024
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Aug 6, 2024
@seisman seisman requested a review from weiji14 August 7, 2024 03:18
Comment on lines 76 to 77
if gs_version is None:
return None
Copy link
Member

Choose a reason for hiding this comment

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

If ghostscript version cannot be detected, should there be a warning raised here?

Copy link
Member Author

Choose a reason for hiding this comment

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

pygmt/_show_versions.py Outdated Show resolved Hide resolved
@seisman seisman merged commit 8d12796 into main Aug 7, 2024
18 of 19 checks passed
@seisman seisman deleted the show-versions branch August 7, 2024 05:33
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Aug 7, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants