File tree Expand file tree Collapse file tree 3 files changed +37
-9
lines changed Expand file tree Collapse file tree 3 files changed +37
-9
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
# install cython for building cftime without build isolation
4
- micromamba install " cython>=0.29.20" py-cpuinfo
4
+ micromamba install " cython>=0.29.20" py-cpuinfo setuptools-scm
5
5
# temporarily (?) remove numbagg and numba
6
6
micromamba remove -y numba numbagg sparse
7
7
# temporarily remove numexpr
8
8
micromamba remove -y numexpr
9
9
# temporarily remove backends
10
- micromamba remove -y cf_units hdf5 h5py netcdf4
10
+ micromamba remove -y cf_units hdf5 h5py netcdf4 pydap
11
11
# forcibly remove packages to avoid artifacts
12
12
micromamba remove -y --force \
13
13
numpy \
@@ -31,7 +31,8 @@ python -m pip install \
31
31
numpy \
32
32
scipy \
33
33
matplotlib \
34
- pandas
34
+ pandas \
35
+ h5py
35
36
# for some reason pandas depends on pyarrow already.
36
37
# Remove once a `pyarrow` version compiled with `numpy>=2.0` is on `conda-forge`
37
38
python -m pip install \
@@ -70,6 +71,6 @@ python -m pip install \
70
71
git+https://github.com/intake/filesystem_spec \
71
72
git+https://github.com/SciTools/nc-time-axis \
72
73
git+https://github.com/xarray-contrib/flox \
74
+ git+https://github.com/h5netcdf/h5netcdf \
73
75
git+https://github.com/dgasmith/opt_einsum
74
76
# git+https://github.com/pydata/sparse
75
- # git+https://github.com/h5netcdf/h5netcdf
Original file line number Diff line number Diff line change @@ -142,8 +142,36 @@ def _importorskip(
142
142
not has_scipy_or_netCDF4 , reason = "requires scipy or netCDF4"
143
143
)
144
144
has_numpy_array_api , requires_numpy_array_api = _importorskip ("numpy" , "1.26.0" )
145
- has_h5netcdf_ros3 , requires_h5netcdf_ros3 = _importorskip ("h5netcdf" , "1.3.0" )
146
145
146
+
147
+ def _importorskip_h5netcdf_ros3 ():
148
+ try :
149
+ import h5netcdf
150
+
151
+ has_h5netcdf = True
152
+ except ImportError :
153
+ has_h5netcdf = False
154
+
155
+ if not has_h5netcdf :
156
+ return has_h5netcdf , pytest .mark .skipif (
157
+ not has_h5netcdf , reason = "requires h5netcdf"
158
+ )
159
+
160
+ h5netcdf_with_ros3 = Version (h5netcdf .__version__ ) >= Version ("1.3.0" )
161
+
162
+ import h5py
163
+
164
+ h5py_with_ros3 = h5py .get_config ().ros3
165
+
166
+ has_h5netcdf_ros3 = h5netcdf_with_ros3 and h5py_with_ros3
167
+
168
+ return has_h5netcdf_ros3 , pytest .mark .skipif (
169
+ not has_h5netcdf_ros3 ,
170
+ reason = "requires h5netcdf>=1.3.0 and h5py with ros3 support" ,
171
+ )
172
+
173
+
174
+ has_h5netcdf_ros3 , requires_h5netcdf_ros3 = _importorskip_h5netcdf_ros3 ()
147
175
has_netCDF4_1_6_2_or_above , requires_netCDF4_1_6_2_or_above = _importorskip (
148
176
"netCDF4" , "1.6.2"
149
177
)
Original file line number Diff line number Diff line change 6
6
import numpy as np
7
7
import pandas as pd
8
8
import pytest
9
- from numpy .core import defchararray
10
9
11
10
import xarray as xr
12
11
from xarray .core import formatting
@@ -770,9 +769,9 @@ def test_repr_file_collapsed(tmp_path) -> None:
770
769
)
771
770
def test__mapping_repr (display_max_rows , n_vars , n_attr ) -> None :
772
771
long_name = "long_name"
773
- a = defchararray .add (long_name , np .arange (0 , n_vars ).astype (str ))
774
- b = defchararray .add ("attr_" , np .arange (0 , n_attr ).astype (str ))
775
- c = defchararray .add ("coord" , np .arange (0 , n_vars ).astype (str ))
772
+ a = np . char .add (long_name , np .arange (0 , n_vars ).astype (str ))
773
+ b = np . char .add ("attr_" , np .arange (0 , n_attr ).astype (str ))
774
+ c = np . char .add ("coord" , np .arange (0 , n_vars ).astype (str ))
776
775
attrs = {k : 2 for k in b }
777
776
coords = {_c : np .array ([0 , 1 ], dtype = np .uint64 ) for _c in c }
778
777
data_vars = dict ()
You can’t perform that action at this time.
0 commit comments