diff --git a/pkgs/development/python-modules/pynndescent/default.nix b/pkgs/development/python-modules/pynndescent/default.nix new file mode 100644 index 000000000000..aab8f4e743a2 --- /dev/null +++ b/pkgs/development/python-modules/pynndescent/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchPypi +, fetchpatch +, nose +, scikitlearn +, scipy +, numba +, llvmlite +, joblib +}: + +buildPythonPackage rec { + pname = "pynndescent"; + version = "0.5.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "74a05a54d13573a38878781d44812ac6df97d8762a56f9bb5dd87a99911820fe"; + }; + + patches = [ + # fixes tests, included in 0.5.2 + (fetchpatch { + url = "https://github.com/lmcinnes/pynndescent/commit/ef5d8c3c3bfe976063b6621e3e0734c0c22d813b.patch"; + sha256 = "sha256-49n3kevs3wpzd4FfZVKmNpF2o1V8pJs4KOx8zCAhR3s="; + }) + ]; + + checkInputs = [ + nose + ]; + + propagatedBuildInputs = [ + scikitlearn + scipy + numba + llvmlite + joblib + ]; + + checkPhase = '' + nosetests + ''; + + meta = with lib; { + description = "Nearest Neighbor Descent"; + homepage = "https://github.com/lmcinnes/pynndescent"; + license = licenses.bsd2; + maintainers = [ maintainers.mic92 ]; + }; +} diff --git a/pkgs/development/python-modules/umap-learn/default.nix b/pkgs/development/python-modules/umap-learn/default.nix index f471fbef4c8c..b9abe2bb7682 100644 --- a/pkgs/development/python-modules/umap-learn/default.nix +++ b/pkgs/development/python-modules/umap-learn/default.nix @@ -6,22 +6,25 @@ , scikitlearn , scipy , numba +, pynndescent +, tensorflow , pytestCheckHook }: buildPythonPackage rec { pname = "umap-learn"; - version = "0.4.5"; + version = "0.5.0"; src = fetchFromGitHub { owner = "lmcinnes"; repo = "umap"; rev = version; - sha256 = "080by8h4rxr5ijx8vp8kn952chiqz029j26c04k4js4g9s7201bq"; + sha256 = "sha256-2Z5RDi4bz8hh8zMwkcCQY9NrGaVd1DJEBOmrCl2oSvM="; }; checkInputs = [ nose + tensorflow pytestCheckHook ]; @@ -30,8 +33,13 @@ buildPythonPackage rec { scikitlearn scipy numba + pynndescent ]; + preCheck = '' + export HOME=$TMPDIR + ''; + disabledTests = [ # Plot functionality requires additional packages. # These test also fail with 'RuntimeError: cannot cache function' error. diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 13ef9ec9b00a..f8b4baf882d3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4867,6 +4867,8 @@ in { pkuseg = callPackage ../development/python-modules/pkuseg { }; + pynndescent = callPackage ../development/python-modules/pynndescent { }; + pysbd = callPackage ../development/python-modules/pysbd { }; python-codon-tables = callPackage ../development/python-modules/python-codon-tables { };