Skip to content

Commit

Permalink
Switch back to using np.asarray, but use dtype 'object' in test
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Jul 13, 2020
1 parent f70db5f commit a2258a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pygmt/clib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def _check_dtype_and_dim(self, array, ndim):
if array.dtype.type not in DTYPES:
try:
# Try to convert any unknown numpy data types to np.datetime64
array = np.datetime64(array)
array = np.asarray(array, dtype=np.datetime64)
except ValueError:
raise GMTInvalidInput(
"Unsupported numpy data type '{}'.".format(array.dtype.type)
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_clib.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def test_put_vector_invalid_dtype():
mode="GMT_CONTAINER_ONLY",
dim=[2, 3, 1, 0], # columns, rows, layers, dtype
)
data = np.array([37, 12, 556], dtype="complex128")
data = np.array([37, 12, 556], dtype="object")
with pytest.raises(GMTInvalidInput):
lib.put_vector(dataset, column=1, vector=data)

Expand Down

0 comments on commit a2258a5

Please sign in to comment.