You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support passing in 'datetime' like inputs into the 'region' or '-R' argument in plot.
The region argument doesn't work with numpy datetime64 objects, have to convert to a string using np.datetime_as_string in order to set the map frame bounds.
The decorator kwargs_to_strings convert the list [w, e, s, n] to a string w/e/s/n. We need to convert datetime64 object to string internally, but it's not ideal to do the conversion in the decorator. I don't have a good solution now.
Activity
seisman commentedon Aug 13, 2020
Add a check in the
kwargs_to_stringsdecorator?pygmt/pygmt/helpers/decorators.py
Line 244 in 2ddbb0e
weiji14 commentedon Aug 13, 2020
I'm wondering if this functionality is specific to
plotonly, or if there are other places which can take datetime-like 'region' arguments.seisman commentedon Aug 14, 2020
Almost any modules can accept datetime-like region, for example, basemap, histogram, and even grdimage (maybe, but never tried).
weiji14 commentedon Aug 14, 2020
Ok, the extra 'datetime' check might slow things down by a bit, but since it's only checking for 4 (or 6) items in a list, it should be fine.