Skip to content

Commit ca75ae4

Browse files
committed
o Fix actions
1 parent fe66a32 commit ca75ae4

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

.github/workflows/yac-optional.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ jobs:
6363
echo "YAC_PREFIX=${YAC_PREFIX}" >> "${GITHUB_ENV}"
6464
git clone --depth 1 --branch "${YAXT_VERSION}" https://gitlab.dkrz.de/dkrz-sw/yaxt.git
6565
if [ ! -x yaxt/configure ]; then
66-
(cd yaxt && ./autogen.sh)
66+
if [ -x yaxt/autogen.sh ]; then
67+
(cd yaxt && ./autogen.sh)
68+
else
69+
(cd yaxt && autoreconf -i)
70+
fi
6771
fi
6872
mkdir -p yaxt/build
6973
cd yaxt/build
@@ -76,7 +80,11 @@ jobs:
7680
set -euxo pipefail
7781
git clone --depth 1 --branch "${YAC_VERSION}" https://gitlab.dkrz.de/dkrz-sw/yac.git
7882
if [ ! -x yac/configure ]; then
79-
(cd yac && ./autogen.sh)
83+
if [ -x yac/autogen.sh ]; then
84+
(cd yac && ./autogen.sh)
85+
else
86+
(cd yac && autoreconf -i)
87+
fi
8088
fi
8189
mkdir -p yac/build
8290
cd yac/build

uxarray/remap/yac.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import numpy as np
88

99
import uxarray.core.dataarray
10-
1110
from uxarray.remap.utils import (
1211
LABEL_TO_COORD,
1312
_assert_dimension,
@@ -44,8 +43,12 @@ def _get_lon_lat(grid, dim_kind: str) -> tuple[np.ndarray, np.ndarray]:
4443
lon = getattr(grid, f"{prefix}_lon", None)
4544
lat = getattr(grid, f"{prefix}_lat", None)
4645
if lon is not None and lat is not None:
47-
return np.asarray(lon, dtype=np.float64), np.asarray(lat, dtype=np.float64)
48-
raise AttributeError("Grid has neither node_lon/node_lat nor vertex_lon/vertex_lat")
46+
return np.asarray(lon, dtype=np.float64), np.asarray(
47+
lat, dtype=np.float64
48+
)
49+
raise AttributeError(
50+
"Grid has neither node_lon/node_lat nor vertex_lon/vertex_lat"
51+
)
4952
if dim_kind == "edge":
5053
lon = getattr(grid, "edge_lon", None)
5154
lat = getattr(grid, "edge_lat", None)
@@ -212,12 +215,8 @@ def _build_points(self, src_grid, tgt_grid, src_dim, tgt_dim, yac_method):
212215
self._tgt_grid = yac.CloudGrid(
213216
self._tgt_grid_name, np.deg2rad(tgt_lon), np.deg2rad(tgt_lat)
214217
)
215-
src_points = self._src_grid.def_points(
216-
np.deg2rad(src_lon), np.deg2rad(src_lat)
217-
)
218-
tgt_points = self._tgt_grid.def_points(
219-
np.deg2rad(tgt_lon), np.deg2rad(tgt_lat)
220-
)
218+
src_points = self._src_grid.def_points(np.deg2rad(src_lon), np.deg2rad(src_lat))
219+
tgt_points = self._tgt_grid.def_points(np.deg2rad(tgt_lon), np.deg2rad(tgt_lat))
221220
return src_points, tgt_points
222221

223222
def remap(self, values: np.ndarray) -> np.ndarray:

0 commit comments

Comments
 (0)