Skip to content

Commit

Permalink
Merge branch 'main' into add-aliases-meca-tpaxes
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonnefroehlich authored Oct 19, 2024
2 parents c48ed01 + d1ab97c commit 46bc736
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 144 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Test PyGMT with GMT legacy versions on Linux/macOS/Windows
#
# This workflow runs regular PyGMT tests with GMT legacy versions. Due to the
# minor baseline image changes between GMT versions, the workflow only runs
# the tests but doesn't do image comparisons.
# This workflow runs regular PyGMT tests with GMT legacy versions. Due to the minor
# baseline image changes between GMT versions, the workflow only runs the tests but
# doesn't do image comparisons.
#
# It is scheduled to run every Tuesday on the main branch.
#
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
gmt=${{ matrix.gmt_version }}
ghostscript<10
numpy
pandas<2
pandas
xarray
netCDF4
packaging
Expand All @@ -85,9 +85,9 @@ jobs:
run: |
# Download cached files to ~/.gmt directory and list them
gh run download --name gmt-cache --dir ~/.gmt/
# Change modification times of the two files, so GMT won't refresh it
# The two files are in the `~/.gmt/server` directory for GMT<=6.4, and
# in the `~/.gmt` directory for GMT>=6.5.
# Change modification times of the two files, so GMT won't refresh it.
# The two files are in the `~/.gmt/server` directory for GMT<=6.4, and in the
# `~/.gmt` directory for GMT>=6.5.
mkdir -p ~/.gmt/server/
mv ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt ~/.gmt/server/
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/advanced/draping_on_3d_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
fig = pygmt.Figure()

# Set up a colormap with two colors for the EU flag: blue (0/51/153) for the background
# (value 0 in the nedCDF file -> lower half of 0-255 range) and yellow (255/204/0) for
# (value 0 in the netCDF file -> lower half of 0-255 range) and yellow (255/204/0) for
# the stars (value 255 -> upper half)
pygmt.makecpt(cmap="0/51/153,255/204/0", series=[0, 256, 128])

Expand Down
2 changes: 1 addition & 1 deletion pygmt/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GMTDataArrayAccessor:
>>> longrid, latgrid = np.meshgrid(lon, lat)
>>> data = np.sin(np.deg2rad(longrid)) * np.cos(np.deg2rad(latgrid))
>>> grid = xr.DataArray(data, coords=[("latitude", lat), ("longitude", lon)])
>>> # default to a gridline-registrated Cartesian grid
>>> # default to a gridline-registered Cartesian grid
>>> grid.gmt.registration, grid.gmt.gtype
(0, 0)
>>> # set it to a gridline-registered geographic grid
Expand Down
4 changes: 2 additions & 2 deletions pygmt/clib/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def sequence_to_ctypes_array(
return (ctype * size)(*sequence)


def strings_to_ctypes_array(strings: Sequence[str]) -> ctp.Array:
def strings_to_ctypes_array(strings: Sequence[str] | np.ndarray) -> ctp.Array:
"""
Convert a sequence (e.g., a list) of strings into a ctypes array.
Expand All @@ -307,7 +307,7 @@ def strings_to_ctypes_array(strings: Sequence[str]) -> ctp.Array:
return (ctp.c_char_p * len(strings))(*[s.encode() for s in strings])


def array_to_datetime(array: Sequence[Any]) -> np.ndarray:
def array_to_datetime(array: Sequence[Any] | np.ndarray) -> np.ndarray:
"""
Convert a 1-D datetime array from various types into numpy.datetime64.
Expand Down
Loading

0 comments on commit 46bc736

Please sign in to comment.