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

GMTver is not in string type #476

Closed
seisman opened this issue Nov 14, 2020 · 4 comments
Closed

GMTver is not in string type #476

seisman opened this issue Nov 14, 2020 · 4 comments

Comments

@seisman
Copy link
Member

seisman commented Nov 14, 2020

Tried GMT.jl in the try-gmt environment. The GMTver variable is in float64 type and it reports 6.109999999999999 instead of 6.1.1.

image

One more question: how to show the installed GMT.jl version in a Julia console?

@joa-quim
Copy link
Member

Yes, GMTver is a float variable because I need to do several internal decisions depending on the GMT version installed and a float is much more handy that a string. It prints that ugly number because 0.1 has no exact representation in binary. It will look nicer with GMT 6.2. But that variable is for internal use so no big deal with that floating point feature.

To get the GMT.jl version one can do

 julia> using Pkg

julia> Pkg.status("GMT")
Status `C:\Users\joaqu\.julia\environments\tomls\Project.toml`
  [5752ebe1] GMT v0.27.0 `C:\Users\joaqu\.julia\dev\GMT`

@seisman
Copy link
Member Author

seisman commented Nov 15, 2020

To get the GMT.jl version one can do

 julia> using Pkg

julia> Pkg.status("GMT")
Status `C:\Users\joaqu\.julia\environments\tomls\Project.toml`
  [5752ebe1] GMT v0.27.0 `C:\Users\joaqu\.julia\dev\GMT`

Thanks. Is there a good way to check the GMT version in a Julia console if GMTver is only for internal use?

@joa-quim
Copy link
Member

Well, GMTver is obtained by parsing the output of

julia> readlines(`gmt --version`)[1][1:5]
"6.2.0"

@seisman
Copy link
Member Author

seisman commented Nov 15, 2020

Looks like an ugly way to display the GMT version. Closing.

@seisman seisman closed this as completed Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants