Skip to content

Commit 3fd94d7

Browse files
committed
Merge remote-tracking branch 'origin/main' into rajeeja/apply_precomputed_weights
2 parents 340aa5e + 6fb17d8 commit 3fd94d7

30 files changed

Lines changed: 1655 additions & 3812 deletions

.github/workflows/asv-benchmarking.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
path: uxarray-asv
3939

4040
- name: Setup Miniforge
41-
uses: conda-incubator/setup-miniconda@v3
41+
uses: conda-incubator/setup-miniconda@v4
4242
with:
4343
miniforge-version: "24.1.2-0"
4444
activate-environment: asv

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
# github.repository == 'UXARRAY/uxarray'
1212
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
1313
runs-on: ${{ matrix.os }}
14+
env:
15+
MPLBACKEND: Agg
1416
defaults:
1517
run:
1618
shell: bash -l {0}
@@ -32,7 +34,7 @@ jobs:
3234
token: ${{ github.token }}
3335

3436
- name: conda_setup (x64)
35-
uses: conda-incubator/setup-miniconda@v3
37+
uses: conda-incubator/setup-miniconda@v4
3638
if: matrix.os != 'macos-14'
3739
with:
3840
activate-environment: uxarray_build
@@ -44,7 +46,7 @@ jobs:
4446
miniforge-version: latest
4547

4648
- name: conda_setup (ARM64)
47-
uses: conda-incubator/setup-miniconda@v3
49+
uses: conda-incubator/setup-miniconda@v4
4850
if: matrix.os == 'macos-14'
4951
with:
5052
activate-environment: uxarray_build

.github/workflows/upstream-dev-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
shell: bash -l {0}
7171
steps:
7272
- name: checkout
73-
uses: actions/checkout@v6.0.2
73+
uses: actions/checkout@v6
7474

7575
- name: Create or update failure issue
7676
shell: bash

.github/workflows/yac-optional.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: YAC Optional CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/yac-optional.yml"
7+
- "uxarray/remap/**"
8+
- "test/test_remap_yac.py"
9+
workflow_dispatch:
10+
11+
jobs:
12+
yac-optional:
13+
name: YAC core v3.14.0_p1 (Ubuntu)
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
shell: bash -l {0}
18+
env:
19+
YAC_VERSION: v3.14.0_p1
20+
YAXT_VERSION: v0.11.5.1
21+
MPIEXEC: /usr/bin/mpirun
22+
MPIRUN: /usr/bin/mpirun
23+
MPICC: /usr/bin/mpicc
24+
MPIFC: /usr/bin/mpif90
25+
MPIF90: /usr/bin/mpif90
26+
OMPI_ALLOW_RUN_AS_ROOT: 1
27+
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
28+
steps:
29+
- name: checkout
30+
uses: actions/checkout@v6
31+
with:
32+
token: ${{ github.token }}
33+
34+
- name: conda_setup
35+
uses: conda-incubator/setup-miniconda@v4
36+
with:
37+
activate-environment: uxarray_build
38+
channel-priority: strict
39+
python-version: "3.11"
40+
channels: conda-forge
41+
environment-file: ci/environment.yml
42+
miniforge-variant: Miniforge3
43+
miniforge-version: latest
44+
45+
- name: Install build dependencies (apt)
46+
run: |
47+
sudo apt-get update
48+
sudo apt-get install -y \
49+
autoconf \
50+
automake \
51+
gawk \
52+
gfortran \
53+
libopenmpi-dev \
54+
libtool \
55+
make \
56+
openmpi-bin \
57+
pkg-config
58+
- name: Verify MPI tools
59+
run: |
60+
which mpirun
61+
which mpicc
62+
which mpif90
63+
mpirun --version
64+
mpicc --version
65+
mpif90 --version
66+
- name: Install Python build dependencies
67+
run: |
68+
python -m pip install --upgrade pip
69+
python -m pip install cython wheel
70+
- name: Build and install YAXT
71+
run: |
72+
set -euxo pipefail
73+
YAC_PREFIX="${GITHUB_WORKSPACE}/yac_prefix"
74+
echo "YAC_PREFIX=${YAC_PREFIX}" >> "${GITHUB_ENV}"
75+
git clone --depth 1 --branch "${YAXT_VERSION}" https://gitlab.dkrz.de/dkrz-sw/yaxt.git
76+
if [ ! -x yaxt/configure ]; then
77+
if [ -x yaxt/autogen.sh ]; then
78+
(cd yaxt && ./autogen.sh)
79+
else
80+
(cd yaxt && autoreconf -i)
81+
fi
82+
fi
83+
mkdir -p yaxt/build
84+
cd yaxt/build
85+
../configure \
86+
--prefix="${YAC_PREFIX}" \
87+
--without-regard-for-quality \
88+
CC="${MPICC}" \
89+
FC="${MPIF90}"
90+
make -j2
91+
make install
92+
- name: Build and install YAC
93+
run: |
94+
set -euxo pipefail
95+
git clone --depth 1 --branch "${YAC_VERSION}" https://gitlab.dkrz.de/dkrz-sw/yac.git
96+
if [ ! -x yac/configure ]; then
97+
if [ -x yac/autogen.sh ]; then
98+
(cd yac && ./autogen.sh)
99+
else
100+
(cd yac && autoreconf -i)
101+
fi
102+
fi
103+
mkdir -p yac/build
104+
cd yac/build
105+
../configure \
106+
--prefix="${YAC_PREFIX}" \
107+
--with-yaxt-root="${YAC_PREFIX}" \
108+
--disable-mci \
109+
--disable-utils \
110+
--disable-examples \
111+
--disable-tools \
112+
--disable-netcdf \
113+
--enable-python-bindings \
114+
CC="${MPICC}" \
115+
FC="${MPIF90}"
116+
make -j2
117+
make install
118+
- name: Configure YAC runtime paths
119+
run: |
120+
set -euxo pipefail
121+
PY_VER="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
122+
echo "LD_LIBRARY_PATH=${YAC_PREFIX}/lib:${LD_LIBRARY_PATH:-}" >> "${GITHUB_ENV}"
123+
echo "PYTHONPATH=${YAC_PREFIX}/lib/python${PY_VER}/site-packages:${YAC_PREFIX}/lib/python${PY_VER}/dist-packages:${PYTHONPATH:-}" >> "${GITHUB_ENV}"
124+
- name: Verify YAC core Python bindings
125+
run: |
126+
python - <<'PY'
127+
from pathlib import Path
128+
import sys
129+
candidates = []
130+
for entry in sys.path:
131+
pkg = Path(entry) / "yac"
132+
candidates.extend(pkg.glob("core*.so"))
133+
candidates.extend(pkg.glob("core*.pyd"))
134+
assert candidates, "yac.core extension not found on sys.path"
135+
print("Found yac.core extension:", candidates[0])
136+
PY
137+
- name: Install uxarray
138+
run: |
139+
python -m pip install . --no-deps
140+
- name: Run tests (uxarray with YAC)
141+
run: |
142+
python -m pytest test/test_remap_yac.py

docs/api.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ Top Level Functions
2424
concat
2525
load_remap_weights
2626

27+
Tutorial
28+
--------
29+
30+
.. autosummary::
31+
:toctree: generated/
32+
33+
tutorial.available_datasets
34+
tutorial.describe_dataset
35+
tutorial.file_path
36+
tutorial.file_paths
37+
tutorial.open_grid
38+
tutorial.open_dataset
39+
tutorial.open_mfdataset
2740

2841
Grid
2942
----

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
from sphinx.application import Sphinx
1818
from sphinx.util import logging
1919

20+
PROJECT_ROOT = pathlib.Path(__file__).resolve().parents[1]
21+
os.environ.setdefault(
22+
"UXARRAY_DATA_DIR",
23+
str(PROJECT_ROOT / "test" / "meshfiles"),
24+
)
25+
2026
import uxarray
2127

2228
__all__ = (uxarray, matplotlib.pyplot)

0 commit comments

Comments
 (0)