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

gmtconvert -S cannot match string longer than 21 characters on intel mac #8497

Open
noirchen opened this issue May 23, 2024 · 6 comments
Open
Labels
bug Something isn't working

Comments

@noirchen
Copy link

noirchen commented May 23, 2024

Description of the problem

I installed gmt through pygmt on mac, and when I use gmt convert -S to match strings I found that when the string is longer than 21 characters, the command returns nothing. The gmt version is Version 6.5.0 [64-bit] [MP] [4 cores], and on ubuntu linux with gmt installed from the apt source, the bug doesn't exist.

Minimal Complete Verifiable Example

# this extracts the data as intended
gmt convert  gprv.gmt -S"prov_name=Some L01234567ng Name" -V > out.txt
# this extracts nothing
gmt convert  gprv.gmt -S"prov_name=Some L012345678ng Name" -V > out.txt
# this extracts the data as intended
gmt convert  gprv.gmt -S"prov_name=Some L0123456ng Name" -V > out.txt

# contents of data
# @VGMT1.0 @GPOLYGON 
# @Nid|prov_name|prov_type|prov_ref|prov_group|lastorogen|continent|conjugate1|comment|crust_type|conjugate2|area
# @Tdouble|string|string|string|string|string|string|string|string|string|string|double
# FEATURE_DATA
>
# @D1|"Some L012345678ng Name"||||||||||
# @P
119.618 22.2686
119.712279387314 21.9668188009922
119.839341058907 21.6051817356889
120.034820553666 21.1262569735306
>
# @D2|"Some L01234567ng Name”||||||||||
# @P
119.618 22.2686
119.712279387314 21.9668188009922
119.839341058907 21.6051817356889
120.034820553666 21.1262569735306
>
# @D3|"Some L0123456ng Name”||||||||||
# @P
119.618 22.2686
119.712279387314 21.9668188009922
119.839341058907 21.6051817356889
120.034820553666 21.1262569735306
>

Full error message

No response

System information

PyGMT information:
  version: v0.12.0
System information:
  python: 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:53:34) [Clang 16.0.6 ]
  executable: /Applications/homebrew/Caskroom/miniforge/base/bin/python3.10
  machine: macOS-13.6.7-x86_64-i386-64bit
Dependency information:
  numpy: 1.26.4
  pandas: 2.2.2
  xarray: 2024.5.0
  netCDF4: 1.6.5
  packaging: 24.0
  contextily: None
  geopandas: None
  ipython: None
  rioxarray: None
  ghostscript: 10.03.1
GMT library information:
  binary version: 6.5.0
  cores: 4
  grid layout: rows
  image layout:
  library path: /Applications/homebrew/Caskroom/miniforge/base/lib/libgmt.dylib
  padding: 2
  plugin dir: /Applications/homebrew/Caskroom/miniforge/base/lib/gmt/plugins
  share dir: /Applications/homebrew/Caskroom/miniforge/base/share/gmt
  version: 6.5.0
@noirchen noirchen added the bug Something isn't working label May 23, 2024
Copy link

welcome bot commented May 23, 2024

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.

@yvonnefroehlich
Copy link
Member

It looks like this issue is directly related to GMT, not an PyGMT issue. In this case we should transfer it to the GMT repository. There is no wrapper for gmt convert in PyGMT yet.

I tried the provided examples on Linux and Windows with GMT 6.5/dev and GMT 6.4 and all three seem to work. So this is potentially an OS-dependent / mac-related issue, and we need an mac user to test this.

One side aspect is, that in the last line of the example the separator (the > at the end of the line) should be in the next line.

@noirchen
Copy link
Author

noirchen commented May 23, 2024

Seems like only occurring on intel mac, because I tested a M1 mac running sonoma and the bug doesn't exist

@seisman
Copy link
Member

seisman commented May 24, 2024

I think I can reproduce the issue on Intel Mac, so there must be a bug.

I agree with @yvonnefroehlich that this is a GMT issue, so I'll transfer it to the GMT repository and will see if I can find some time fix it.

Copy link

welcome bot commented May 24, 2024

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

Please make sure you read our Contributing Guide and abide by our Code of Conduct.

@seisman seisman transferred this issue from GenericMappingTools/pygmt May 24, 2024
@Esteban82
Copy link
Member

I see that the bug is only on mac? So, in the title we could replace "in pygmt" to "in GMT with mac".

@noirchen noirchen changed the title gmtconvert -S cannot match string longer than 21 characters in pygmt gmtconvert -S cannot match string longer than 21 characters on intel mac May 25, 2024
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

4 participants