1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, pytestCheckHook
6, future
7, numpy
8, pillow
9, fetchpatch
10, scipy
11, scikit-learn
12, scikitimage
13, threadpoolctl
14}:
15
16buildPythonPackage rec {
17 pname = "batchgenerators";
18 version = "0.24";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "MIC-DKFZ";
25 repo = pname;
26 rev = "v${version}";
27 hash = "sha256-47jAeHMJPBk7GpUvXtQuJchgiSy6M50anftsuXWk2ag=";
28 };
29
30 propagatedBuildInputs = [
31 future
32 numpy
33 pillow
34 scipy
35 scikit-learn
36 scikitimage
37 threadpoolctl
38 ];
39
40 # see https://github.com/MIC-DKFZ/batchgenerators/pull/78
41 postPatch = ''
42 substituteInPlace setup.py \
43 --replace '"unittest2",' ""
44 '';
45
46 checkInputs = [
47 pytestCheckHook
48 ];
49
50 # see https://github.com/MIC-DKFZ/batchgenerators/pull/78
51 disabledTestPaths = [ "tests/test_axis_mirroring.py" ];
52
53 pythonImportsCheck = [
54 "batchgenerators"
55 "batchgenerators.augmentations"
56 "batchgenerators.dataloading"
57 "batchgenerators.datasets"
58 "batchgenerators.transforms"
59 "batchgenerators.utilities"
60 ];
61
62 meta = with lib; {
63 description = "2D and 3D image data augmentation for deep learning";
64 homepage = "https://github.com/MIC-DKFZ/batchgenerators";
65 license = licenses.asl20;
66 maintainers = with maintainers; [ bcdarwin ];
67 };
68}