about summary refs log tree commit diff
path: root/pkgs/development/python-modules/tables
diff options
context:
space:
mode:
authorAndreas Herrmann <andreash87@gmx.ch>2014-06-14 18:24:50 +0200
committerAndreas Herrmann <andreash87@gmx.ch>2014-06-22 20:05:21 +0200
commit52762ed4163b7eeba076b3393991b19f36798c65 (patch)
treee1f5a6d8a7976445c0d96736f0b09d2f949efe29 /pkgs/development/python-modules/tables
parent5a960436373a44e25d08ad709ef604fc93b8bf2f (diff)
downloadnixlib-52762ed4163b7eeba076b3393991b19f36798c65.tar
nixlib-52762ed4163b7eeba076b3393991b19f36798c65.tar.gz
nixlib-52762ed4163b7eeba076b3393991b19f36798c65.tar.bz2
nixlib-52762ed4163b7eeba076b3393991b19f36798c65.tar.lz
nixlib-52762ed4163b7eeba076b3393991b19f36798c65.tar.xz
nixlib-52762ed4163b7eeba076b3393991b19f36798c65.tar.zst
nixlib-52762ed4163b7eeba076b3393991b19f36798c65.zip
tables: add new package, version 3.1.1
From the project page [1]:
> PyTables is a package for managing hierarchical datasets and designed to
> efficiently and easily cope with extremely large amounts of data.

It offers read/write access to hdf5 archives through a hierarchical interface.

I am adding it, because pandas depends on tables for hdf5 read/write
functionality.

Note: The name is a bit of an issue. The project is called pytables, whereas
the python module is simply called tables. I chose to name the nix-expression
tables for consistency with the source-tarball and the module name.

[1]: http://www.pytables.org/moin
Diffstat (limited to 'pkgs/development/python-modules/tables')
-rw-r--r--pkgs/development/python-modules/tables/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/tables/default.nix b/pkgs/development/python-modules/tables/default.nix
new file mode 100644
index 000000000000..d3edf54788ab
--- /dev/null
+++ b/pkgs/development/python-modules/tables/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, python, buildPythonPackage
+, cython, bzip2, lzo, numpy, numexpr, hdf5 }:
+
+buildPythonPackage rec {
+  version = "3.1.1";
+  name = "tables-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pytables/${name}.tar.gz";
+    sha256 = "18rdzv9xwiapb5c8y47rk2fi3fdm2dpjf68wfycma67ifrih7f9r";
+  };
+
+  buildInputs = [ hdf5 cython bzip2 lzo ];
+  propagatedBuildInputs = [ numpy numexpr ];
+
+  # The setup script complains about missing run-paths, but they are
+  # actually set.
+  setupPyBuildFlags =
+    [ "--hdf5=${hdf5}"
+      "--lzo=${lzo}"
+      "--bzip2=${bzip2}"
+    ];
+  setupPyInstallFlags = setupPyBuildFlags;
+
+  # Run the test suite.
+  # It requires the build path to be in the python search path.
+  # These tests take quite some time.
+  # If the hdf5 library is built with zlib then there is only one
+  # test-failure. That is the same failure as described in the following
+  # github issue:
+  #     https://github.com/PyTables/PyTables/issues/269
+  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 tables
+    r = tables.test()
+    if not r.wasSuccessful():
+        sys.exit(1)
+    EOF
+  '';
+
+  # Disable tests until the failure described above is fixed.
+  doCheck = false;
+
+  meta = {
+    description = "Hierarchical datasets for Python";
+    homepage = "http://www.pytables.org/";
+  };
+}