From 601abf3649447e137907b497490d91fb4a9be29c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 19 Nov 2023 11:08:25 +0100 Subject: [PATCH] python311Packages.apricot-select: init at 0.6.1 Module for submodular optimization for the purpose of selecting subsets of massive data sets https://github.com/jmschrei/apricot --- .../python-modules/apricot-select/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/development/python-modules/apricot-select/default.nix diff --git a/pkgs/development/python-modules/apricot-select/default.nix b/pkgs/development/python-modules/apricot-select/default.nix new file mode 100644 index 000000000000..105f6a71c915 --- /dev/null +++ b/pkgs/development/python-modules/apricot-select/default.nix @@ -0,0 +1,63 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, numba +, numpy +, pytestCheckHook +, pythonOlder +, torchvision +, scikit-learn +, scipy +, setuptools +, tqdm +}: + +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="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + numba + numpy + scipy + tqdm + ]; + + nativeCheckInputs = [ + pytestCheckHook + torchvision + scikit-learn + ]; + + pythonImportsCheck = [ + "apricot" + ]; + + disabledTestPaths = [ + # Tests require nose + "tests/test_optimizers/test_knapsack_facility_location.py" + "tests/test_optimizers/test_knapsack_feature_based.py" + ]; + + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c76f4ea814d6..0c5aa80b372d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -634,6 +634,8 @@ self: super: with self; { appthreat-vulnerability-db = callPackage ../development/python-modules/appthreat-vulnerability-db { }; + apricot-select = callPackage ../development/python-modules/apricot-select { }; + aprslib = callPackage ../development/python-modules/aprslib { }; apscheduler = callPackage ../development/python-modules/apscheduler { };