Skip to content

Commit 6092e17

Browse files
committed
Use explicit numpy dtypes
1 parent 3bb862d commit 6092e17

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

intake_xarray/tests/test_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def test_coerce_shape_array_non_int():
125125
expected = np.append(array[:2, :], [[0], [0]], axis=1)
126126
actual = _coerce_shape(array, shape)
127127
assert (expected == actual).all()
128-
assert expected.dtype == "float"
128+
assert expected.dtype == np.float64
129129

130130

131131
def test_read_image():

intake_xarray/tests/test_remote.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Tests for intake-server, local HTTP file server, local "S3" object server
22
import aiohttp
33
import intake
4+
import numpy as np
45
import os
56
import pytest
67
import requests
@@ -122,7 +123,7 @@ def test_http_read_netcdf(data_server):
122123
url = f'{data_server}/example_1.nc'
123124
source = intake.open_netcdf(url)
124125
ds = source.read()
125-
assert ds['rh'].isel(lat=0,lon=0,time=0).values.dtype == 'float32'
126+
assert ds['rh'].isel(lat=0,lon=0,time=0).values.dtype == np.float32
126127
assert ds['rh'].isel(lat=0,lon=0,time=0).values == 0.5
127128

128129

@@ -245,7 +246,7 @@ def test_s3_read_netcdf(s3):
245246
source = intake.open_netcdf(url,
246247
storage_options=s3options)
247248
ds = source.read()
248-
assert ds['rh'].isel(lat=0,lon=0,time=0).values.dtype == 'float32'
249+
assert ds['rh'].isel(lat=0,lon=0,time=0).values.dtype == np.float32
249250
assert ds['rh'].isel(lat=0,lon=0,time=0).values == 0.5
250251

251252

0 commit comments

Comments
 (0)