From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] Add python-statsmodels. Date: Fri, 16 Oct 2015 15:48:29 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn5NB-0002Br-GJ for guix-devel@gnu.org; Fri, 16 Oct 2015 09:48:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zn5N8-0004De-3A for guix-devel@gnu.org; Fri, 16 Oct 2015 09:48:41 -0400 Received: from pegasus.bbbm.mdc-berlin.de ([141.80.25.20]:58804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn5N7-0004Bo-NJ for guix-devel@gnu.org; Fri, 16 Oct 2015 09:48:38 -0400 Received: from localhost (localhost [127.0.0.1]) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTP id 76300380F2A for ; Fri, 16 Oct 2015 15:48:35 +0200 (CEST) Received: from pegasus.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (pegasus.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1sQ2hgzlP_2z for ; Fri, 16 Oct 2015 15:48:30 +0200 (CEST) Received: from HTCAONE.mdc-berlin.net (mab.citx.mdc-berlin.de [141.80.36.102]) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTP for ; Fri, 16 Oct 2015 15:48:29 +0200 (CEST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel --=-=-= Content-Type: text/plain Hi Guix, the attached patch adds python{,2}-statsmodels to statistics.scm. Note that this depends on my previous patch adding patsy to the same module. ~~ Ricardo --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0001-gnu-Add-python-statsmodels.patch" >From 33ddc045065722a0bac9b28ad909e838b169d7cb Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 13 Oct 2015 13:28:58 +0200 Subject: [PATCH 1/2] gnu: Add python-statsmodels. * gnu/packages/statistics.scm (python-statsmodels, python2-statsmodels): New variables. --- gnu/packages/statistics.scm | 64 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 1492094..0c0464c 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -989,3 +989,67 @@ building design matrices.") ,@(alist-delete "python-numpy" (alist-delete "python-scipy" (package-propagated-inputs patsy)))))))) + +(define-public python-statsmodels + (package + (name "python-statsmodels") + (version "0.6.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://pypi.python.org/packages/source/" + "s/statsmodels/statsmodels-" version ".tar.gz")) + (sha256 + (base32 + "0xn67sqr0cc1lmlhzm71352hrb4hw7g318p5ff5q97pc98vl8kmy")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; tests must be run after installation + (delete 'check) + (add-after 'unpack 'set-matplotlib-backend-to-agg + (lambda _ + ;; Set the matplotlib backend to Agg to avoid problems using the + ;; GTK backend without a display. + (substitute* (find-files "statsmodels/graphics/tests" "\\.py") + (("import matplotlib\\.pyplot as plt" line) + (string-append "import matplotlib;matplotlib.use('Agg');" + line))) + #t)) + (add-after 'install 'check + (lambda _ + (with-directory-excursion "/tmp" + (zero? (system* "nosetests" + "--stop" + "-v" "statsmodels")))))))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("python-scipy" ,python-scipy) + ("python-pandas" ,python-pandas) + ("python-patsy" ,python-patsy) + ("python-matplotlib" ,python-matplotlib))) + (native-inputs + `(("python-cython" ,python-cython) + ("python-nose" ,python-nose) + ("python-sphinx" ,python-sphinx))) + (home-page "http://statsmodels.sourceforge.net/") + (synopsis "Statistical modeling and econometrics in Python") + (description + "Statsmodels is a Python package that provides a complement to scipy for +statistical computations including descriptive statistics and estimation and +inference for statistical models.") + (license license:bsd-3))) + +(define-public python2-statsmodels + (let ((stats (package-with-python2 python-statsmodels))) + (package (inherit stats) + (propagated-inputs + `(("python2-numpy" ,python2-numpy) + ("python2-scipy" ,python2-scipy) + ("python2-pandas" ,python2-pandas) + ("python2-patsy" ,python2-patsy) + ("python2-matplotlib" ,python2-matplotlib))) + (native-inputs + `(("python2-setuptools" ,python2-setuptools) + ,@(package-native-inputs stats)))))) -- 2.1.0 --=-=-=--