Skip to content

Commit

Permalink
Minor updates to the cache data workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Apr 16, 2024
1 parent ca8973b commit d6ffe1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
with:
name: gmt-cache
path: |
~/.gmt/cache
~/.gmt/server
~/.gmt/gmt_data_server.txt
~/.gmt/gmt_hash_server.txt
~/.gmt/cache
~/.gmt/server
~/.gmt/gmt_data_server.txt
~/.gmt/gmt_hash_server.txt
10 changes: 6 additions & 4 deletions pygmt/datatypes/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@ def to_strings(self) -> np.ndarray[Any, np.dtype[np.str_]]:
# Workaround for upstream GMT bug reported in
# https://github.com/GenericMappingTools/pygmt/issues/3170.
msg = (

Check warning on line 160 in pygmt/datatypes/dataset.py

View check run for this annotation

Codecov / codecov/patch

pygmt/datatypes/dataset.py#L160

Added line #L160 was not covered by tests
"The trailing text column contains `None' values, "
"likely due to upstream GMT API bug. Please consider reporting to us."
"The trailing text column contains `None' values and has been replace "
"with an empty string to avoid TypeError exceptions. "
"It's likely caused by an upstream GMT API bug. "
"Please consider reporting to us."
)
raise warnings.warn(msg, stacklevel=2)
textvector = np.where(textvector == None, b"", textvector) # noqa: E711
warnings.warn(msg, stacklevel=1)
textvector = [item if item is not None else b"" for item in textvector]

Check warning on line 167 in pygmt/datatypes/dataset.py

View check run for this annotation

Codecov / codecov/patch

pygmt/datatypes/dataset.py#L166-L167

Added lines #L166 - L167 were not covered by tests
return np.char.decode(textvector) if textvector else np.array([], dtype=str)

def to_dataframe(
Expand Down

0 comments on commit d6ffe1a

Please sign in to comment.