1{ stdenv 2, lib 3, buildPythonPackage 4, fetchFromGitHub 5, pytestCheckHook 6, pythonOlder 7, deprecated 8, humanize 9, matplotlib 10, nibabel 11, numpy 12, parameterized 13, scipy 14, simpleitk 15, torch 16, tqdm 17, typer 18}: 19 20buildPythonPackage rec { 21 pname = "torchio"; 22 version = "0.19.1"; 23 format = "pyproject"; 24 25 disabled = pythonOlder "3.8"; 26 27 src = fetchFromGitHub { 28 owner = "fepegar"; 29 repo = pname; 30 rev = "refs/tags/v${version}"; 31 hash = "sha256-SNX558kSRCS9Eks00Kj2kFmo7hCUgV6saYLsnx/Kus0="; 32 }; 33 34 propagatedBuildInputs = [ 35 deprecated 36 humanize 37 nibabel 38 numpy 39 scipy 40 simpleitk 41 torch 42 tqdm 43 typer 44 ] ++ typer.passthru.optional-dependencies.all; 45 46 nativeCheckInputs = [ pytestCheckHook matplotlib parameterized ]; 47 disabledTests = [ 48 # tries to download models: 49 "test_load_all" 50 ] ++ lib.optionals stdenv.isAarch64 [ 51 # RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly 52 "test_queue_multiprocessing" 53 ]; 54 pythonImportsCheck = [ 55 "torchio" 56 "torchio.data" 57 ]; 58 59 meta = with lib; { 60 description = "Medical imaging toolkit for deep learning"; 61 homepage = "https://torchio.readthedocs.io"; 62 license = licenses.asl20; 63 maintainers = [ maintainers.bcdarwin ]; 64 }; 65}