From 3bb862d352cecbbe59917eaf0ac4dbd918627782 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Wed, 20 Sep 2023 10:46:30 +0100 Subject: [PATCH 1/5] Remove CI warnings --- .github/workflows/main.yaml | 4 ++-- .github/workflows/pypipublish.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f2e8abf..17d4c27 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -16,10 +16,10 @@ jobs: CONDA_ENV: [py310, py38, py39, upstream] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup conda - uses: mamba-org/provision-with-micromamba@main + uses: mamba-org/setup-micromamba@v1 with: environment-file: ci/environment-${{ matrix.CONDA_ENV }}.yml diff --git a/.github/workflows/pypipublish.yaml b/.github/workflows/pypipublish.yaml index b3080d3..0e93b58 100644 --- a/.github/workflows/pypipublish.yaml +++ b/.github/workflows/pypipublish.yaml @@ -8,9 +8,9 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.x" - name: Install dependencies From 6092e176c801adf096023591a70fe136ac385422 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 21 Sep 2023 14:06:19 +0100 Subject: [PATCH 2/5] Use explicit numpy dtypes --- intake_xarray/tests/test_image.py | 2 +- intake_xarray/tests/test_remote.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/intake_xarray/tests/test_image.py b/intake_xarray/tests/test_image.py index 1efc6a8..b983eeb 100644 --- a/intake_xarray/tests/test_image.py +++ b/intake_xarray/tests/test_image.py @@ -125,7 +125,7 @@ def test_coerce_shape_array_non_int(): expected = np.append(array[:2, :], [[0], [0]], axis=1) actual = _coerce_shape(array, shape) assert (expected == actual).all() - assert expected.dtype == "float" + assert expected.dtype == np.float64 def test_read_image(): diff --git a/intake_xarray/tests/test_remote.py b/intake_xarray/tests/test_remote.py index 8a85acd..673c5e0 100644 --- a/intake_xarray/tests/test_remote.py +++ b/intake_xarray/tests/test_remote.py @@ -1,6 +1,7 @@ # Tests for intake-server, local HTTP file server, local "S3" object server import aiohttp import intake +import numpy as np import os import pytest import requests @@ -122,7 +123,7 @@ def test_http_read_netcdf(data_server): url = f'{data_server}/example_1.nc' source = intake.open_netcdf(url) ds = source.read() - assert ds['rh'].isel(lat=0,lon=0,time=0).values.dtype == 'float32' + assert ds['rh'].isel(lat=0,lon=0,time=0).values.dtype == np.float32 assert ds['rh'].isel(lat=0,lon=0,time=0).values == 0.5 @@ -245,7 +246,7 @@ def test_s3_read_netcdf(s3): source = intake.open_netcdf(url, storage_options=s3options) ds = source.read() - assert ds['rh'].isel(lat=0,lon=0,time=0).values.dtype == 'float32' + assert ds['rh'].isel(lat=0,lon=0,time=0).values.dtype == np.float32 assert ds['rh'].isel(lat=0,lon=0,time=0).values == 0.5 From 85577151004ae2c1ccec18fe468f288eb9b1a5ed Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 21 Sep 2023 14:34:59 +0100 Subject: [PATCH 3/5] More numpy dtypes --- intake_xarray/tests/test_remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intake_xarray/tests/test_remote.py b/intake_xarray/tests/test_remote.py index 673c5e0..ab534cc 100644 --- a/intake_xarray/tests/test_remote.py +++ b/intake_xarray/tests/test_remote.py @@ -69,7 +69,7 @@ def test_http_read_rasterio(data_server): assert ("+init" in da.attrs.get('crs', "") or "+proj" in da.attrs.get('crs', "") or "PROJCS" in da.spatial_ref.attrs["crs_wkt"]) assert da.attrs['AREA_OR_POINT'] == 'Area' - assert da.dtype == 'uint8' + assert da.dtype == np.uint8 assert da.isel(band=2,x=300,y=500).values == 129 @@ -236,7 +236,7 @@ def test_s3_read_rasterio(s3): assert ("+init" in da.attrs.get('crs', "") or "+proj" in da.attrs.get('crs', "") or "PROJCS" in da.spatial_ref.attrs["crs_wkt"]) assert da.attrs['AREA_OR_POINT'] == 'Area' - assert da.dtype == 'uint8' + assert da.dtype == np.uint8 assert da.isel(band=2,x=300,y=500).values == 129 From a6adb1f2bdb4b28ec6b70c80eab1a1477fccd453 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Tue, 26 Sep 2023 12:52:25 +0100 Subject: [PATCH 4/5] Fix httpfs glob --- intake_xarray/tests/test_remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intake_xarray/tests/test_remote.py b/intake_xarray/tests/test_remote.py index ab534cc..bf17d69 100644 --- a/intake_xarray/tests/test_remote.py +++ b/intake_xarray/tests/test_remote.py @@ -49,7 +49,7 @@ def data_server(): def test_http_server_files(data_server): test_files = ['RGB.byte.tif', 'example_1.nc', 'example_2.nc', 'little_green.tif', 'little_red.tif'] h = fsspec.filesystem("http") - out = h.glob(data_server + '/') + out = h.glob(data_server + '/*') assert len(out) > 0 assert set([data_server+'/'+x for x in test_files]).issubset(set(out)) From 9ccff2f77287ecd6d09ace4e7c06f6d41990a557 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Tue, 26 Sep 2023 15:33:43 +0100 Subject: [PATCH 5/5] Pin rasterio <= 1.3.6 in python 3.8 CI --- ci/environment-py38.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/environment-py38.yml b/ci/environment-py38.yml index 68f6287..6b877da 100644 --- a/ci/environment-py38.yml +++ b/ci/environment-py38.yml @@ -13,7 +13,7 @@ dependencies: - pip - pydap - pytest - - rasterio + - rasterio <= 1.3.6 - s3fs >= 2021.08.0 - scikit-image - rangehttpserver