Skip to content

Error when import name 'build_arg_string' from 'pygmt.helpers' #3806

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

Closed
jhtong33 opened this issue Feb 13, 2025 · 2 comments
Closed

Error when import name 'build_arg_string' from 'pygmt.helpers' #3806

jhtong33 opened this issue Feb 13, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@jhtong33
Copy link
Contributor

Description of the problem

Following contributor-testing-your-code and make test, the coverage result is 74%.

The short test summary info is (because I can not upload index.html here):
FAILED ../clib/session.py::pygmt.clib.session.Session.virtualfile_to_dataset
FAILED ../datatypes/dataset.py::pygmt.datatypes.dataset._GMT_DATASET.to_dataframe
FAILED ../helpers/decorators.py::pygmt.helpers.decorators.fmt_docstring
FAILED ../src/grd2xyz.py::pygmt.src.grd2xyz.grd2xyz
FAILED ../src/grdhisteq.py::pygmt.src.grdhisteq.grdhisteq.compute_bins

Pytest System information:
pytest 7.4.0
pytest-mpl 0.17.0

Minimal Complete Verifiable Example

4 from pygmt.clib import Session
      5 from pygmt.exceptions import GMTError, GMTInvalidInput
----> 6 from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias
      7 from pygmt.src.meca import convention_params, convention_code
     10 @fmt_docstring
     11 @use_alias(
     12     A="section",
   (...)
     42     **kwargs
     43 ):

Full error message

ImportError: cannot import name 'build_arg_string' from 'pygmt.helpers' (/Users/tong/opt/anaconda3/envs/pygmt/lib/python3.13/site-packages/pygmt/helpers/__init__.py)

System information

PyGMT information:
  version: v0.14.1
System information:
  python: 3.13.1 | packaged by conda-forge | (main, Jan 13 2025, 09:45:31) [Clang 18.1.8 ]
  executable: /Users/tong/opt/anaconda3/envs/pygmt/bin/python
  machine: macOS-12.3.1-arm64-arm-64bit-Mach-O
Dependency information:
  numpy: 2.2.2
  pandas: 2.2.3
  xarray: 2025.1.2
  netCDF4: 1.7.2
  packaging: 24.2
  contextily: 1.6.2
  geopandas: 1.0.1
  IPython: 8.32.0
  pyarrow: 19.0.0
  rioxarray: 0.18.2
  gdal: 3.10.1
  ghostscript: 10.02.0
GMT library information:
  version: 6.5.0
  padding: 2
  share dir: /Users/tong/opt/anaconda3/envs/pygmt/share/gmt
  plugin dir: /Users/tong/opt/anaconda3/envs/pygmt/lib/gmt/plugins
  library path: /Users/tong/opt/anaconda3/envs/pygmt/lib/libgmt.dylib
  cores: 8
  grid layout: rows
  image layout: 
  binary version: 6.5.0
@jhtong33 jhtong33 added the bug Something isn't working label Feb 13, 2025
@seisman
Copy link
Member

seisman commented Feb 13, 2025

Why do you want to import build_arg_string. This function has been deprecated since v0.12.0 and was fully removed in v0.14.0 (#3184). Use build_arg_list instead.

@seisman
Copy link
Member

seisman commented Feb 14, 2025

Closing this issue, since it's clear that the function is deprecated.

@seisman seisman closed this as completed Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants