2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-09-19 14:19:46 +00:00
|
|
|
fetchpatch2,
|
2024-06-05 15:53:02 +00:00
|
|
|
apricot-select,
|
|
|
|
numba,
|
|
|
|
numpy,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
scikit-learn,
|
|
|
|
scipy,
|
|
|
|
setuptools,
|
|
|
|
torchvision,
|
|
|
|
tqdm,
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "apricot-select";
|
|
|
|
version = "0.6.1";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jmschrei";
|
|
|
|
repo = "apricot";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-v9BHFxmlbwXVipPze/nV35YijdFBuka3gAl85AlsffQ=";
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
patches = [
|
|
|
|
# migrate to pytest, https://github.com/jmschrei/apricot/pull/43
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://github.com/jmschrei/apricot/commit/ffa5cce97292775c0d6890671a19cacd2294383f.patch?full_index=1";
|
|
|
|
hash = "sha256-9A49m4587kAPK/kzZBqMRPwuA40S3HinLXaslYUcWdM=";
|
|
|
|
})
|
|
|
|
];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2024-01-02 11:29:13 +00:00
|
|
|
numba
|
|
|
|
numpy
|
2024-06-05 15:53:02 +00:00
|
|
|
scikit-learn
|
2024-01-02 11:29:13 +00:00
|
|
|
scipy
|
2024-06-05 15:53:02 +00:00
|
|
|
torchvision
|
2024-01-02 11:29:13 +00:00
|
|
|
tqdm
|
|
|
|
];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "apricot" ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests require nose
|
|
|
|
"tests/test_optimizers/test_knapsack_facility_location.py"
|
|
|
|
"tests/test_optimizers/test_knapsack_feature_based.py"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# NOTE: These tests seem to be flaky.
|
|
|
|
disabledTests = [
|
|
|
|
"test_digits_modular"
|
|
|
|
"test_digits_modular_object"
|
|
|
|
"test_digits_modular_sparse"
|
|
|
|
"test_digits_sqrt_modular"
|
|
|
|
"test_digits_sqrt_modular_object"
|
|
|
|
"test_digits_sqrt_modular_sparse"
|
|
|
|
];
|
|
|
|
|
|
|
|
# NOTE: Tests are disabled by default because they can run for hours and timeout on Hydra.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
passthru.tests.check = apricot-select.overridePythonAttrs { doCheck = true; };
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Module for submodular optimization for the purpose of selecting subsets of massive data sets";
|
|
|
|
homepage = "https://github.com/jmschrei/apricot";
|
|
|
|
changelog = "https://github.com/jmschrei/apricot/releases/tag/${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|