Skip to content

Commit d6ffe1a

Browse files
committed
Minor updates to the cache data workflow file
1 parent ca8973b commit d6ffe1a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/cache_data.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
with:
8181
name: gmt-cache
8282
path: |
83-
~/.gmt/cache
84-
~/.gmt/server
85-
~/.gmt/gmt_data_server.txt
86-
~/.gmt/gmt_hash_server.txt
83+
~/.gmt/cache
84+
~/.gmt/server
85+
~/.gmt/gmt_data_server.txt
86+
~/.gmt/gmt_hash_server.txt

pygmt/datatypes/dataset.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@ def to_strings(self) -> np.ndarray[Any, np.dtype[np.str_]]:
158158
# Workaround for upstream GMT bug reported in
159159
# https://github.com/GenericMappingTools/pygmt/issues/3170.
160160
msg = (
161-
"The trailing text column contains `None' values, "
162-
"likely due to upstream GMT API bug. Please consider reporting to us."
161+
"The trailing text column contains `None' values and has been replace "
162+
"with an empty string to avoid TypeError exceptions. "
163+
"It's likely caused by an upstream GMT API bug. "
164+
"Please consider reporting to us."
163165
)
164-
raise warnings.warn(msg, stacklevel=2)
165-
textvector = np.where(textvector == None, b"", textvector) # noqa: E711
166+
warnings.warn(msg, stacklevel=1)
167+
textvector = [item if item is not None else b"" for item in textvector]
166168
return np.char.decode(textvector) if textvector else np.array([], dtype=str)
167169

168170
def to_dataframe(

0 commit comments

Comments
 (0)