summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Herrmann <andreash87@gmx.ch>2014-06-14 18:24:31 +0200
committerAndreas Herrmann <andreash87@gmx.ch>2014-06-22 20:05:20 +0200
commit9ae6cc5967fea7c1f9b217a85103f57c35e39e2f (patch)
tree9c2a14b98c43af60292fb60f8b489588e0f2bb3d
parent2eea864503cf26957e8c4c0b0471783fc139458e (diff)
downloadnixlib-9ae6cc5967fea7c1f9b217a85103f57c35e39e2f.tar
nixlib-9ae6cc5967fea7c1f9b217a85103f57c35e39e2f.tar.gz
nixlib-9ae6cc5967fea7c1f9b217a85103f57c35e39e2f.tar.bz2
nixlib-9ae6cc5967fea7c1f9b217a85103f57c35e39e2f.tar.lz
nixlib-9ae6cc5967fea7c1f9b217a85103f57c35e39e2f.tar.xz
nixlib-9ae6cc5967fea7c1f9b217a85103f57c35e39e2f.tar.zst
nixlib-9ae6cc5967fea7c1f9b217a85103f57c35e39e2f.zip
numexpr: new package, version 2.4
Description from the numexpr project page [1]:
> Numexpr is a fast numerical expression evaluator for NumPy. With it,
> expressions that operate on arrays (like "3*a+4*b") are accelerated and use
> less memory than doing the same calculation in Python.

I am adding it, because it is a dependency of the pytables package.

[1]: https://github.com/pydata/numexpr
-rw-r--r--pkgs/top-level/python-packages.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index d4b78e11c89b..3c733f62ff44 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -4601,6 +4601,43 @@ rec {
     };
   };
 
+  numexpr = buildPythonPackage rec {
+    version = "2.4";
+    name = "numexpr-${version}";
+
+    src = fetchgit {
+      url = https://github.com/pydata/numexpr.git;
+      rev = "606cc9a110711e947d35ac2770749c00dab184c8";
+      sha256 = "1gxgkg7ncgjhnifn444iha5nrjhyr8sr6w5yp204186a1ysz858g";
+    };
+
+    propagatedBuildInputs = with pkgs; [ numpy ];
+
+    # Run the test suite.
+    # It requires the build path to be in the python search path.
+    checkPhase = ''
+      ${python}/bin/${python.executable} <<EOF
+      import sysconfig
+      import sys
+      import os
+      f = "lib.{platform}-{version[0]}.{version[1]}"
+      lib = f.format(platform=sysconfig.get_platform(),
+                     version=sys.version_info)
+      build = os.path.join(os.getcwd(), 'build', lib)
+      sys.path.insert(0, build)
+      import numexpr
+      r = numexpr.test()
+      if not r.wasSuccessful():
+          sys.exit(1)
+      EOF
+    '';
+
+    meta = {
+      description = "Fast numerical array expression evaluator for NumPy";
+      homepage = "https://github.com/pydata/numexpr";
+    };
+  };
+
   numpy = buildPythonPackage ( rec {
     name = "numpy-1.7.1";