aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/python.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r--gnu/packages/python.scm122
1 files changed, 122 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 3cf2c545ed..772a214eb3 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -53,6 +53,7 @@
#:use-module (gnu packages readline)
#:use-module (gnu packages texlive)
#:use-module (gnu packages texinfo)
+ #:use-module (gnu packages web)
#:use-module (gnu packages which)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
@@ -1722,6 +1723,37 @@ environments and back.")
(define-public python2-itsdangerous
(package-with-python2 python-itsdangerous))
+(define-public python-pyyaml
+ (package
+ (name "python-pyyaml")
+ (version "3.11")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1s26125vfnskng58ym37xhwv8v0mm95b2cwbjfag8prfhy596v63"))))
+ (build-system python-build-system)
+ (inputs
+ `(("libyaml" ,libyaml)))
+ (native-inputs
+ `(("python-setuptools" ,python-setuptools)))
+ (home-page "http://pyyaml.org/wiki/PyYAML")
+ (synopsis "YAML parser and emitter for Python")
+ (description
+ "PyYAML is a YAML parser and emitter for Python. PyYAML features a
+complete YAML 1.1 parser, Unicode support, pickle support, capable extension
+API, and sensible error messages. PyYAML supports standard YAML tags and
+provides Python-specific tags that allow to represent an arbitrary Python
+object.")
+ (license license:expat)))
+
+(define-public python2-pyyaml
+ (package-with-python2 python-pyyaml))
+
(define-public python-virtualenv
(package
(name "python-virtualenv")
@@ -1920,6 +1952,74 @@ sources.")
(define-public python2-sphinx-rtd-theme
(package-with-python2 python-sphinx-rtd-theme))
+(define-public python-scikit-learn
+ (package
+ (name "python-scikit-learn")
+ (version "0.15.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/scikit-learn/scikit-learn/archive/"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1rb93h2q15f219sz60sczjb65rg70xjmnp0q4pkkaairx5s05q55"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (alist-cons-before
+ 'build 'set-environment-variables
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((atlas-threaded
+ (string-append (assoc-ref inputs "atlas")
+ "/lib/libtatlas.so"))
+ ;; On single core CPUs only the serial library is created.
+ (atlas-lib
+ (if (file-exists? atlas-threaded)
+ atlas-threaded
+ (string-append (assoc-ref inputs "atlas")
+ "/lib/libsatlas.so"))))
+ (setenv "ATLAS" atlas-lib)))
+ (alist-cons-before
+ 'check 'set-HOME
+ ;; some tests require access to "$HOME"
+ (lambda _ (setenv "HOME" "/tmp"))
+ ;; Tests can only be run after the library has been installed and not
+ ;; within the source directory.
+ (alist-cons-after
+ 'install 'check
+ (lambda _
+ (with-directory-excursion "/tmp"
+ ;; With Python 3 one test of 3334 fails
+ ;; (sklearn.tests.test_common.test_transformers); see
+ ;; https://github.com/scikit-learn/scikit-learn/issues/3693
+ (system* "nosetests" "-v" "sklearn")))
+ (alist-delete 'check %standard-phases))))))
+ (inputs
+ `(("atlas" ,atlas)
+ ("python-nose" ,python-nose)))
+ (propagated-inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-scipy" ,python-scipy)))
+ (home-page "http://scikit-learn.org/")
+ (synopsis "Machine Learning in Python")
+ (description
+ "Scikit-learn provides simple and efficient tools for data
+mining and data analysis.")
+ (license bsd-3)))
+
+(define-public python2-scikit-learn
+ (let ((scikit (package-with-python2 python-scikit-learn)))
+ (package (inherit scikit)
+ (propagated-inputs
+ `(("python2-numpy" ,python2-numpy)
+ ("python2-scipy" ,python2-scipy)
+ ,@(alist-delete
+ "python-numpy"
+ (alist-delete
+ "python-scipy" (package-propagated-inputs scikit))))))))
+
(define-public python-cython
(package
(name "python-cython")
@@ -3183,3 +3283,25 @@ interfaces in an easy and portable manner.")
(define-public python2-netifaces
(package-with-python2 python-netifaces))
+
+(define-public snakemake
+ (package
+ (name "snakemake")
+ (version "3.2.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/s/snakemake/snakemake-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "0fi4b63sj60hvi7rfydvmz2icl4wj74djw5sn2gl8hxd02qw4b91"))))
+ (build-system python-build-system)
+ (inputs `(("python-setuptools" ,python-setuptools)))
+ (home-page "https://bitbucket.org/johanneskoester/snakemake")
+ (synopsis "Python-based execution environment for make-like workflows")
+ (description
+ "Snakemake aims to reduce the complexity of creating workflows by
+providing a clean and modern domain specific specification language (DSL) in
+Python style, together with a fast and comfortable execution environment.")
+ (license license:expat)))