Xarray: add support for multi-file dataset (#1233)

* Xarray: add support for multi-file dataset

* fix flake8

* test
This commit is contained in:
Tom Kralidis
2023-04-30 16:11:21 -04:00
committed by GitHub
parent c02d8f5ba2
commit 8f54a0d6dc
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -95,6 +95,7 @@ jobs:
python3 setup.py install
pip3 install --upgrade numpy elasticsearch
pip3 install --upgrade numpy "sqlalchemy<2"
pip3 install --upgrade flake8
pip3 install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
#pip3 install --upgrade rasterio==1.1.8
- name: setup test data ⚙️
+6 -1
View File
@@ -62,7 +62,12 @@ class XarrayProvider(BaseProvider):
if provider_def['data'].endswith('.zarr'):
open_func = xarray.open_zarr
else:
open_func = xarray.open_dataset
if '*' in self.data:
LOGGER.debug('Detected multi file dataset')
open_func = xarray.open_mfdataset
else:
open_func = xarray.open_dataset
self._data = open_func(self.data)
self._data = _convert_float32_to_float64(self._data)
self._coverage_properties = self._get_coverage_properties()