summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/dask-image/default.nix
blob: 1c9e706633b7cc1760cccbe3a505936da6c8efe3 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  setuptools-scm,

  # dependencies
  dask,
  numpy,
  scipy,
  pandas,
  pims,

  # tests
  pyarrow,
  pytestCheckHook,
  scikit-image,
}:

buildPythonPackage rec {
  pname = "dask-image";
  version = "2024.5.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "dask";
    repo = "dask-image";
    tag = "v${version}";
    hash = "sha256-kXCAqJ2Zgo/2Khvo2YcK+n4oGM219GyQ2Hsq9re1Lac=";
  };

  postPatch = ''
    substituteInPlace dask_image/ndinterp/__init__.py \
      --replace-fail "out_bounds.ptp(axis=1)" "np.ptp(out_bounds, axis=1)"
  '';

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    dask
    numpy
    scipy
    pandas
    pims
  ];

  nativeCheckInputs = [
    pyarrow
    pytestCheckHook
    scikit-image
  ];

  pythonImportsCheck = [ "dask_image" ];

  disabledTests = [
    # The following tests are from 'tests/test_dask_image/test_ndmeasure/test_find_objects.py' and
    # fail because of errors on numpy slices
    # AttributeError: 'str' object has no attribute 'start'
    "test_find_objects"
    "test_3d_find_objects"
    # AssertionError (comparing slices)
    "test_find_objects_with_empty_chunks"
  ];

  meta = {
    description = "Distributed image processing";
    homepage = "https://github.com/dask/dask-image";
    changelog = "https://github.com/dask/dask-image/releases/tag/v${version}";
    license = lib.licenses.bsdOriginal;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}