2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-11-30 08:33:03 +00:00
|
|
|
, buildPythonPackage
|
2023-07-15 17:15:38 +00:00
|
|
|
, dos2unix
|
|
|
|
, fetchpatch
|
2020-11-30 08:33:03 +00:00
|
|
|
, fetchPypi
|
|
|
|
, pytestCheckHook
|
2023-07-15 17:15:38 +00:00
|
|
|
, pythonOlder
|
2020-11-30 08:33:03 +00:00
|
|
|
, pandas
|
2022-09-09 14:08:57 +00:00
|
|
|
, torch
|
2021-12-06 16:07:01 +00:00
|
|
|
, scipy
|
2020-11-30 08:33:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "slicer";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "0.0.7";
|
2023-07-15 17:15:38 +00:00
|
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-11-30 08:33:03 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-9dX3tF+Y0VW5wLplVPqXcMaybVeTo+d6EDD7VpEOvuw=";
|
2020-11-30 08:33:03 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
prePatch = ''
|
|
|
|
dos2unix slicer/*
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# these patches add support for numpy>=1.24
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/interpretml/slicer/commit/028e09e639c4a3c99abe1d537cce30af2eebb081.patch";
|
|
|
|
hash = "sha256-jh/cbz7cx2ks6jMNh1gI1n5RS/OHBtSIDZRxUGyrl/I=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/interpretml/slicer/commit/d4bb09f136d7e1f64711633c16a37e7bee738696.patch";
|
|
|
|
hash = "sha256-9rh99s4JWF4iKClZ19jvqSeRulL32xB5Use8PGkh/SA=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/interpretml/slicer/commit/74b3683a5a7bd982f9eaaf8d8d665dfdaf2c6604.patch";
|
|
|
|
hash = "sha256-R3zsC3udYPFUT93eRhb6wyc9S5n2wceiOunWJ8K+648=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
dos2unix
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook pandas torch scipy ];
|
2020-11-30 08:33:03 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabledTests = [
|
|
|
|
# IndexError: too many indices for array
|
|
|
|
"test_slicer_sparse"
|
|
|
|
"test_operations_2d"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-30 08:33:03 +00:00
|
|
|
description = "Wraps tensor-like objects and provides a uniform slicing interface via __getitem__";
|
|
|
|
homepage = "https://github.com/interpretml/slicer";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ evax ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|