1{
2 lib,
3 buildPythonPackage,
4 einops,
5 fetchFromGitHub,
6 flit-core,
7 numba,
8 numpy,
9 pytestCheckHook,
10 pythonOlder,
11 scipy,
12 xarray,
13}:
14
15buildPythonPackage rec {
16 pname = "xarray-einstats";
17 version = "0.9.1";
18 pyproject = true;
19
20 disabled = pythonOlder "3.10";
21
22 src = fetchFromGitHub {
23 owner = "arviz-devs";
24 repo = "xarray-einstats";
25 tag = "v${version}";
26 hash = "sha256-CgyMc2Yvut+1LfH9F2FAd62HuLu+58Xr50txbWj4mYU=";
27 };
28
29 build-system = [ flit-core ];
30
31 dependencies = [
32 numpy
33 scipy
34 xarray
35 ];
36
37 optional-dependencies = {
38 einops = [ einops ];
39 numba = [ numba ];
40 };
41
42 nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (builtins.attrValues optional-dependencies);
43
44 pythonImportsCheck = [ "xarray_einstats" ];
45
46 disabledTests = [
47 # TypeError
48 "test_pinv"
49 ];
50
51 meta = with lib; {
52 description = "Stats, linear algebra and einops for xarray";
53 homepage = "https://github.com/arviz-devs/xarray-einstats";
54 license = licenses.asl20;
55 maintainers = with maintainers; [ fab ];
56 };
57}