Uh oh!
There was an error while loading. Please reload this page.
Support passing string type numbers, geographic coordinates and datetimes - #975
Conversation
cb910a1 to
416cf8fCompare/test-gmt-dev |
weiji14
commented
Mar 2, 2021
Can you add a doc API line at https://github.com/GenericMappingTools/pygmt/blame/v0.3.0/doc/api/index.rst#L214 for |
seisman
commented
Mar 2, 2021
Done in 24ad0af |
seisman
commented
Mar 2, 2021
See https://github.com/GenericMappingTools/pygmt/actions/runs/609196993 for the tests with GMT dev versions. All the tests (including the new one) pass. Tests with GMT 6.1.1 fails, because in the old codes, datetime strings can processed by |
| for i, j in itertools.combinations_with_replacement(range(3), r=2): | ||
| # TODO: Change range(3) to range(4) |
There was a problem hiding this comment.
The idea of the test is to pass different combinations of strings to GMT, let GMT write it to a temporary file, and check if the output is the same as expected (i.e., if vector=expected_vetcor.
Still has trouble testing datetime strings, when the text file contains strings,
dtype=[("x", np.str_), ("y", np.str_)],
doesn't works as I expect.
weiji14
left a comment
There was a problem hiding this comment.
Great to finally see this come through!
…imes (GenericMappingTools#975) Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Description of proposed changes
This PR adds support for passing string type data to GMT via
GMT_Put_Vectors. Supported string type data include:"0.5")"3:30W","3:30N")2010-01-01T00:00)This PR should address the bug/feature request in #647 and #633.
To test this branch, you need GMT dev versions (i.e., GMT>=6.2.0). You can install the latest GMT dev versions using:
Example script for testing:
Expected and actual output:

Fixes#647.
Fixes#633.
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash commands are:
/format: automatically format and lint the code/test-gmt-dev: run full tests on the latest GMT development version