-
Notifications
You must be signed in to change notification settings - Fork 224
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
Let pygmt.info load datetime columns into a str dtype array #960
Conversation
Fixes problem with pygmt.info not being able to handle datetime64 inputs. I.e. `ValueError: could not convert string to float: '2021-01-01T12:34:56'` However, users will still need to use`pygmt.info(..., f="0T")` until upstream issue at GenericMappingTools/gmt#4241 is resolved. Also added two extra unit tests using numpy datetime64 types.
Used to specify data types of input and/or output columns (time or geographical data). See also: - https://docs.generic-mapping-tools.org/6.1/gmt.html#f-full - https://github.com/GenericMappingTools/gmt/blob/6.1.1/doc/rst/source/explain_-f.rst_ - https://github.com/GenericMappingTools/gmt/blob/master/doc/rst/source/explain_-f_full.rst_ - https://docs.generic-mapping-tools.org/6.1/cookbook/options.html#data-type-selection-the-f-option Needed for the workaround datetime bugfix at #960
Used to specify data types of input and/or output columns (time or geographical data). See also: - https://docs.generic-mapping-tools.org/6.1/gmt.html#f-full - https://github.com/GenericMappingTools/gmt/blob/6.1.1/doc/rst/source/explain_-f.rst_ - https://github.com/GenericMappingTools/gmt/blob/master/doc/rst/source/explain_-f_full.rst_ - https://docs.generic-mapping-tools.org/6.1/cookbook/options.html#data-type-selection-the-f-option Needed for the workaround datetime bugfix at #960
Hmm, that crash on the Windows GMT dev test at https://github.com/GenericMappingTools/pygmt/runs/2025836161?check_suite_focus=true#step:15:86 at the start (before any tests got run) doesn't look nice. |
/test-gmt-dev
It may be just a sporadic crash. Just re-triggered the dev tests. Edit: Jobs at https://github.com/GenericMappingTools/pygmt/actions/runs/619017413 |
Thanks! Windows tests have passed at https://github.com/GenericMappingTools/pygmt/runs/2026019634?check_suite_focus=true#step:15:867. Any other comment on this PR? |
…MappingTools#994) Used to specify data types of input and/or output columns (time or geographical data). See also: - https://docs.generic-mapping-tools.org/6.1/gmt.html#f-full - https://github.com/GenericMappingTools/gmt/blob/6.1.1/doc/rst/source/explain_-f.rst_ - https://github.com/GenericMappingTools/gmt/blob/master/doc/rst/source/explain_-f_full.rst_ - https://docs.generic-mapping-tools.org/6.1/cookbook/options.html#data-type-selection-the-f-option Needed for the workaround datetime bugfix at GenericMappingTools#960
…appingTools#960) Fixes problem with pygmt.info not being able to handle datetime64 inputs. I.e. `ValueError: could not convert string to float: '2021-01-01T12:34:56'` However, users will still need to use`pygmt.info(..., coltypes="0T")` until upstream issue at GenericMappingTools/gmt#4241 is resolved. Also added two extra unit tests using numpy datetime64 types. * Use common alias coltypes (f) in tests and make a note on the workaround
Description of proposed changes
Fixes problem with pygmt.info not being able to handle datetime64 inputs. I.e.
ValueError: could not convert string to float: '2021-01-01T12:34:56'
.However, users will still need to use
pygmt.info(..., f="0T")
until upstream issue at GenericMappingTools/gmt#4241 is resolved. Something like so:Also added two extra unit tests using numpy datetime64 types.
References:
Addresses #597 on the pygmt side using fix mentioned in #597 (comment). Assuming that GenericMappingTools/gmt#4241 is fixed in GMT 6.2.0, then issue #597 can be closed once PyGMT bumps minimum required GMT version to 6.2.0.
Reminders
make format
andmake check
to 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