From a9bb7b02c99badc91a2fc48b1b87ad48c37b24ea Mon Sep 17 00:00:00 2001 From: Alexander Kiselyov Date: Sat, 4 Sep 2021 00:23:38 +0300 Subject: [PATCH] python3Packages.scikit-learn-extra: init at 0.2.0 --- .../scikit-learn-extra/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/scikit-learn-extra/default.nix diff --git a/pkgs/development/python-modules/scikit-learn-extra/default.nix b/pkgs/development/python-modules/scikit-learn-extra/default.nix new file mode 100644 index 000000000000..a91f4ed74f17 --- /dev/null +++ b/pkgs/development/python-modules/scikit-learn-extra/default.nix @@ -0,0 +1,57 @@ +{ lib +, fetchFromGitHub +, buildPythonPackage +, numpy +, cython +, scipy +, scikit-learn +, matplotlib +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "scikit-learn-extra"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "scikit-learn-contrib"; + repo = pname; + rev = "v${version}"; + sha256 = "09v7a9jdycdrlqq349m1gbn8ppzv1bl5g3l72k6ywsx2xb01qw13"; + }; + + nativeBuildInputs = [ numpy cython ]; + propagatedBuildInputs = [ numpy scipy scikit-learn ]; + checkInputs = [ matplotlib pytestCheckHook ]; + + preCheck = '' + # Remove the package in the build dir, because Python defaults to it and + # ignores the one in Nix store with cythonized modules. + rm -r sklearn_extra + ''; + + pytestFlagsArray = [ "--pyargs sklearn_extra" ]; + disabledTestPaths = [ + "benchmarks" + "examples" + "doc" + ]; + disabledTests = [ + "build" # needs network connection + ]; + + # Check packages with cythonized modules + pythonImportsCheck = [ + "sklearn_extra" + "sklearn_extra.cluster" + "sklearn_extra.robust" + "sklearn_extra.utils" + ]; + + meta = { + description = "A set of tools for scikit-learn"; + homepage = "https://github.com/scikit-learn-contrib/scikit-learn-extra"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ yl3dy ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 239c706e0dbe..8069432b0847 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7950,6 +7950,8 @@ in { inherit (pkgs) gfortran glibcLocales; }; + scikit-learn-extra = callPackage ../development/python-modules/scikit-learn-extra { }; + scikit-optimize = callPackage ../development/python-modules/scikit-optimize { }; scikits-odes = callPackage ../development/python-modules/scikits-odes { };