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

Improve the pygmt.show_versions() function #1830

Closed
seisman opened this issue Mar 18, 2022 · 0 comments · Fixed by #1838
Closed

Improve the pygmt.show_versions() function #1830

seisman opened this issue Mar 18, 2022 · 0 comments · Fixed by #1838
Labels
maintenance Boring but important stuff for the core devs upstream Bug or missing feature of upstream core GMT
Milestone

Comments

@seisman
Copy link
Member

seisman commented Mar 18, 2022

I build the GMT master branch from source code and install it to /home/user/opt/GMT-master/. It's the only GMT version installed on my computer.

Here is the output of pygmt.show_versions()

>>> import pygmt
>>> pygmt.show_versions()
PyGMT information:
  version: v0.6.1.dev3+g26d72c896
System information:
  python: 3.9.7 (default, Sep 16 2021, 13:09:58)  [GCC 7.5.0]
  executable: /home/user/opt/miniconda/bin/python
  machine: Linux-5.15.18-200.fc35.x86_64-x86_64-with-glibc2.34
Dependency information:
  numpy: 1.22.3
  pandas: 1.4.1
  xarray: 2022.3.0
  netCDF4: 1.5.8
  packaging: 21.3
  ghostscript: 9.55.0
  gmt: 6.4.0_434ed18_2022.03.11
GMT library information:
  binary dir: /home/user/opt/miniconda/bin
  cores: 80
  grid layout: rows
  image layout: 
  library path: /home/user/opt/GMT-master/lib64/libgmt.so
  padding: 2
  plugin dir: /home/user/opt/GMT-master/lib64/gmt/plugins
  share dir: /home/user/opt/GMT-master/share
  version: 6.4.0

There are some issues here:

  1. It should also report the version information of optional dependencies (i.e., geopandas) if available
  2. The GMT version information gmt: 6.4.0_434ed18_2022.03.11 is obtained by calling gmt --version. However, when multiple GMT versions are installed, the command gmt and the library libgmt may come from different GMT verisons. For example, if I have GMT 6.3 in my conda environment and GMT dev in another installation path, PyGMT may load the GMT 6.3 library but find GMT dev comman, or vice versa, depending on the settings of PATH and GMT_LIBRARY_PATH. It causes some confusion because PyGMT reports inconsistent GMT versions. I think we should remove the gmt: 6.4.0_434ed18_2022.03.11 information.
  3. The GMT's binary dir: /home/user/opt/miniconda/bin information comes from GMT's API_BINDIR parameter in libgmt. It's the path of the program that loads and call the libgmt library. So, for GMT CLI, it points to GMT's bin directory, but for PyGMT, it's the path of the python interpreter. So the information is useless and also cause some confusion. I think we should remove it too.
@seisman seisman added the maintenance Boring but important stuff for the core devs label Mar 18, 2022
@seisman seisman added this to the 0.6.1 milestone Mar 21, 2022
@seisman seisman modified the milestones: 0.6.1, 0.7.0 Mar 31, 2022
@seisman seisman added the upstream Bug or missing feature of upstream core GMT label Apr 2, 2022
@seisman seisman modified the milestones: 0.7.0, 0.8.0 Jun 23, 2022
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 upstream Bug or missing feature of upstream core GMT
Projects
None yet
1 participant