Skip to content

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

@jhtong33

Description

@jhtong33

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions