2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-01-19 23:45:15 +00:00
|
|
|
, pythonOlder
|
2020-05-03 17:38:23 +00:00
|
|
|
, fetchFromGitHub
|
2020-10-11 12:50:04 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, future
|
|
|
|
, numpy
|
2020-05-03 17:38:23 +00:00
|
|
|
, pillow
|
2022-01-19 23:45:15 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, scipy
|
2021-05-20 23:08:51 +00:00
|
|
|
, scikit-learn
|
2020-04-24 23:36:52 +00:00
|
|
|
, scikitimage
|
|
|
|
, threadpoolctl
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "batchgenerators";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "0.21";
|
2022-01-19 23:45:15 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MIC-DKFZ";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-01-19 23:45:15 +00:00
|
|
|
hash = "sha256-q8mBWcy+PkJcfiKtq8P2bnTw56FE1suVS0zUgUEmc5k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-01-19 23:45:15 +00:00
|
|
|
future
|
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
scipy
|
|
|
|
scikit-learn
|
|
|
|
scikitimage
|
|
|
|
threadpoolctl
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2020-05-03 17:38:23 +00:00
|
|
|
];
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
patches = [
|
|
|
|
# Remove deprecated unittest2, https://github.com/MIC-DKFZ/batchgenerators/pull/78
|
|
|
|
(fetchpatch {
|
|
|
|
name = "remove-unittest2.patch";
|
|
|
|
url = "https://github.com/MIC-DKFZ/batchgenerators/commit/87a9437057df8a7550aa3b3eaf840871cc0d5cef.patch";
|
|
|
|
sha256 = "sha256-vozBK7g2dLxx9din/R2vU28Mm+LoGAO/BmQlt/ShmEo=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '"unittest2",' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"batchgenerators"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "2D and 3D image data augmentation for deep learning";
|
|
|
|
homepage = "https://github.com/MIC-DKFZ/batchgenerators";
|
2022-01-19 23:45:15 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|