diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5a53d4d..b9ba7de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,13 +33,18 @@ jobs: run: | micromamba create --name TEST python=${{ matrix.python-version }} python-build numpy=${{ matrix.numpy-version }} --file requirements-dev.txt --channel conda-forge micromamba activate TEST - pip install -e . --no-deps --force-reinstall + python -m pip install -e . --no-deps --no-build-isolation --force-reinstall + + - name: Debug + shell: bash -l {0} + run: | + micromamba activate TEST micromamba info --all micromamba list + python -c "import numpy; print(f'Running numpy {numpy.__version__}')" - name: Tests shell: bash -l {0} run: | micromamba activate TEST - python -c "import numpy; print(f'Running numpy {numpy.__version__}')" pytest -s -rxs -v gsw/tests diff --git a/gsw/geostrophy.py b/gsw/geostrophy.py index 7c7104e..42e2328 100644 --- a/gsw/geostrophy.py +++ b/gsw/geostrophy.py @@ -184,8 +184,9 @@ def distance(lon, lat, p=0, axis=-1): % (lon.shape, axis)) if lon.ndim == 1: one_d = True - lon = lon[np.newaxis, :] - lat = lat[np.newaxis, :] + # xarray requires expand_dims() rather than [newaxis, :] + lon = np.expand_dims(lon, 0) + lat = np.expand_dims(lat, 0) axis = -1 else: one_d = False diff --git a/pyproject.toml b/pyproject.toml index 820e39e..5bc1231 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["pip >9.0.1", "setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "oldest-supported-numpy", "build"] +requires = ["pip>9.0.1", "setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "oldest-supported-numpy", "build"] build-backend = "setuptools.build_meta"