1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 numpy,
11 packaging,
12 pyproj,
13 rasterio,
14 xarray,
15
16 # tests
17 dask,
18 netcdf4,
19 pytestCheckHook,
20 stdenv,
21}:
22
23buildPythonPackage rec {
24 pname = "rioxarray";
25 version = "0.19.0";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "corteva";
30 repo = "rioxarray";
31 tag = version;
32 hash = "sha256-tNcBuMyBVDVPbmujfn4WauquutOEn727lxcR19hfyuE=";
33 };
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 numpy
39 packaging
40 pyproj
41 rasterio
42 xarray
43 ];
44
45 nativeCheckInputs = [
46 dask
47 netcdf4
48 pytestCheckHook
49 ];
50
51 disabledTests = [
52 # AssertionError: assert 535727386 == 535691205
53 "test_clip_geojson__no_drop"
54 # Fails with GDAL 3.11 warning
55 "test_rasterio_vrt"
56 # Fails with small numerical errors on GDAL 3.11
57 "test_rasterio_vrt_gcps"
58 "test_reproject__gcps"
59 # https://github.com/corteva/rioxarray/issues/862
60 "test_merge_datasets__mask_and_scale"
61 ]
62 ++ lib.optionals stdenv.hostPlatform.isAarch64 [
63 # numerical errors
64 "test_clip_geojson"
65 "test_open_rasterio_mask_chunk_clip"
66 ];
67
68 pythonImportsCheck = [ "rioxarray" ];
69
70 meta = {
71 description = "Geospatial xarray extension powered by rasterio";
72 homepage = "https://corteva.github.io/rioxarray/";
73 changelog = "https://github.com/corteva/rioxarray/releases/tag/${version}";
74 license = lib.licenses.asl20;
75 teams = [ lib.teams.geospatial ];
76 };
77}