diff options
author | 2008-01-17 16:50:16 +0000 | |
---|---|---|
committer | 2008-01-17 16:50:16 +0000 | |
commit | deda0aaf91d9fbf2744830049280d713d2c5f3b8 (patch) | |
tree | 8a994a1ea2e59a0c2fc92006da9e9b696cacf0b8 /dev-python/rpy | |
parent | Add missing pkg-config dependency. Thanks Patrick in bug #206190. (diff) | |
download | gentoo-2-deda0aaf91d9fbf2744830049280d713d2c5f3b8.tar.gz gentoo-2-deda0aaf91d9fbf2744830049280d713d2c5f3b8.tar.bz2 gentoo-2-deda0aaf91d9fbf2744830049280d713d2c5f3b8.zip |
Version bump, added a test function, doc flag. lapack is not needed anymore because it links with the R module lapack, which always exists with R (system libs or internal). Added sci as herd maintainers and a longdescription
(Portage version: 2.1.4)
Diffstat (limited to 'dev-python/rpy')
-rw-r--r-- | dev-python/rpy/ChangeLog | 14 | ||||
-rw-r--r-- | dev-python/rpy/files/digest-rpy-1.0.1 | 3 | ||||
-rw-r--r-- | dev-python/rpy/files/rpy-lapack.patch | 20 | ||||
-rw-r--r-- | dev-python/rpy/files/rpy-testfiles.patch | 88 | ||||
-rw-r--r-- | dev-python/rpy/metadata.xml | 7 | ||||
-rw-r--r-- | dev-python/rpy/rpy-1.0.1.ebuild | 49 |
6 files changed, 179 insertions, 2 deletions
diff --git a/dev-python/rpy/ChangeLog b/dev-python/rpy/ChangeLog index 4615775de88d..e6ea0135c65e 100644 --- a/dev-python/rpy/ChangeLog +++ b/dev-python/rpy/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for dev-python/rpy -# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/rpy/ChangeLog,v 1.18 2007/10/14 06:33:41 genstef Exp $ +# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/rpy/ChangeLog,v 1.19 2008/01/17 16:50:15 bicatali Exp $ + +*rpy-1.0.1 (17 Jan 2008) + + 17 Jan 2008; Sébastien Fabbro <bicatali@gentoo.org> + +files/rpy-lapack.patch, +files/rpy-testfiles.patch, metadata.xml, + +rpy-1.0.1.ebuild: + Version bump, added a test function, doc flag. lapack is not needed anymore + because it links with the R module lapack, which always exists with R + (system libs or internal). Added sci as herd maintainers and a + longdescription 13 Oct 2007; Dirkjan Ochtman (djc) <mail@manuzhai.nl> +files/90rpy, +files/rpy-0.99.2-version-detect.patch, diff --git a/dev-python/rpy/files/digest-rpy-1.0.1 b/dev-python/rpy/files/digest-rpy-1.0.1 new file mode 100644 index 000000000000..940f9d1e9be4 --- /dev/null +++ b/dev-python/rpy/files/digest-rpy-1.0.1 @@ -0,0 +1,3 @@ +MD5 3897e05e67230717396859bcc00a8768 rpy-1.0.1.tar.gz 83692 +RMD160 4eb9343ade3907124f9e706dfe9cb9a25e7b4eea rpy-1.0.1.tar.gz 83692 +SHA256 7064de3662d9db69e35383de0c3c17d415406964e8f2f10cc915df71574eeba5 rpy-1.0.1.tar.gz 83692 diff --git a/dev-python/rpy/files/rpy-lapack.patch b/dev-python/rpy/files/rpy-lapack.patch new file mode 100644 index 000000000000..15d5dd09876f --- /dev/null +++ b/dev-python/rpy/files/rpy-lapack.patch @@ -0,0 +1,20 @@ +--- setup.py.orig 2008-01-17 16:34:18.090303918 +0000 ++++ setup.py 2008-01-17 16:34:34.247143104 +0000 +@@ -133,7 +133,7 @@ + elif sys.platform=='osf1V5': + include_dirs = [ os.path.join(RHOME.strip(), 'include'), + 'src' ] +- libraries=['R','Rlapack'] ++ libraries=['R','lapack'] + library_dirs = r_libs + runtime_libs = r_libs + extra_compile_args=["-shared"] +@@ -141,7 +141,7 @@ + else: # unix-like systems, this is known to work for Linux and Solaris + include_dirs = [ os.path.join(RHOME.strip(), 'include'), + 'src', '/usr/share/R/include' ] +- libraries=['R','Rlapack'] ++ libraries=['R','lapack'] + library_dirs = r_libs + runtime_libs = r_libs + extra_compile_args=["-shared"] diff --git a/dev-python/rpy/files/rpy-testfiles.patch b/dev-python/rpy/files/rpy-testfiles.patch new file mode 100644 index 000000000000..d9322130de3f --- /dev/null +++ b/dev-python/rpy/files/rpy-testfiles.patch @@ -0,0 +1,88 @@ +--- tests/table.txt 1970-01-01 01:00:00.000000000 +0100 ++++ tests/table.txt 2008-01-17 15:04:57.706382509 +0000 +@@ -0,0 +1,4 @@ ++A B C D ++X1 4 5 6 ++X2 7 8 9 ++X3 6.0 2 Foo +--- tests/logit.r 1970-01-01 01:00:00.000000000 +0100 ++++ tests/logit.r 2008-01-17 15:04:57.778386612 +0000 +@@ -0,0 +1,78 @@ ++glm.od <- ++function(object, maxit = 30, verbose = TRUE) ++{ ++ if (class(object)[1] != "glm") ++ stop("first argument must be a fitted model of class \"glm\" !") ++ class <- class(object) ++ if (!(family(object)$family == "binomial" & family(object)$link == "logit")) ++ stop("overdispersed model fitting available only for \nbinomial regression models with logit link function!") ++ ++ pearson.X2 <- function(x) sum(residuals(x, "pearson")^2) ++ ++ y <- object$model[,1] # observed proportion of success & failures ++ trials <- apply(y, 1, sum) # = object$prior.weights ++ X <- model.matrix(object) ++ p <- length(object$coefficients) ++ n <- dim(X)[[1]] ++ h <- lm.influence(object)$hat ++ X2 <- pearson.X2(object) ++ # initial estimate of dispersion parameter ++ phi <- (X2 - (n-p)) / sum((trials-1)*(1-h)) ++ if(phi <0){phi <- 0;} ++ w <- 1/(1+phi*(trials-1)) ++ if (verbose) ++ cat("\nBinomial overdispersed logit model fitting...\n") ++ # loop until Pearson X2 approx equal to 1 ++ i <- 0 ++ ++ while( (X2/(n-p)-1) > object$control$epsilon ) ++ { ++ i <- i + 1 ++ if (i > maxit) ++ { warning("algoritm not converged after ", i, " iterations!") ++ break } ++ else ++ if (verbose) cat("Iter. ", i, " phi:", format(phi), "\n") ++ # computes weights ++ w <- 1/(1+phi*(trials-1)) ++ # re-fit the model using update() evaluated in original model ++ # environment, usually R_GlobalEnv ++ disp.weights <<- w; object <<- object ++ object <- eval(expression(update(object, weights=disp.weights)), ++ envir = object$data) ++ ++ h <- lm.influence(object)$hat ++ X2 <- pearson.X2(object) ++ # current estimate of dispersion parameter ++ phi <- (X2 - sum(w*(1-h))) / sum(w*(trials-1)*(1-h)) ++ } ++ ++ if (verbose) ++ { cat("Converged after", i, "iterations. \n") ++ cat("Estimated dispersion parameter:", format(phi), "\n") ++ print(summary(object)) } ++ ##### Jun Lu ++ if (X2 < (n-p)){ ++ phi <- 0; ++ w <- 1; ++ } ++ #cat(c("w is ",w,"\n")); ++ #if(phi <0){phi <- 0;} ++ #w[w>1] <- 1; ++ #cat(c("w is ",w,"\n")); ++ ##### ++ object <- c(object, list(dispersion=phi, disp.weights=w)) ++ class(object) <- class ++ invisible(object) ++} ++ ++ ++logit.1fact <- function(lib.size, counts, gp.des){ ++ tmp <- counts ++ #if (sum(tmp)<5) next ; ++ #if(sum(tmp>0) <3) {tmp <- tmp+1;} ++ mod <- glm(cbind(tmp, lib.size-tmp) ~ gp.des, family=binomial(logit)); ++ mod.disp <- glm.od(mod,verbose=FALSE); ++ test <- summary(mod.disp)$coefficients[2,]; ++ return (list(zp = test)) ++} diff --git a/dev-python/rpy/metadata.xml b/dev-python/rpy/metadata.xml index de483c53568f..849436efe22f 100644 --- a/dev-python/rpy/metadata.xml +++ b/dev-python/rpy/metadata.xml @@ -2,4 +2,11 @@ <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <herd>python</herd> +<herd>sci</herd> +<longdescription lang="en"> + RPy provides a robust Python interface to the R programming + language. It can manage R objects and can execute arbitrary R + functions. All the errors from the R language are converted to + Python exceptions. +</longdescription> </pkgmetadata> diff --git a/dev-python/rpy/rpy-1.0.1.ebuild b/dev-python/rpy/rpy-1.0.1.ebuild new file mode 100644 index 000000000000..3de808490879 --- /dev/null +++ b/dev-python/rpy/rpy-1.0.1.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/rpy/rpy-1.0.1.ebuild,v 1.1 2008/01/17 16:50:15 bicatali Exp $ + +inherit distutils eutils + +DESCRIPTION="Python interface to the R Programming Language" +HOMEPAGE="http://rpy.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2 LGPL-2.1 MPL-1.1" +SLOT="0" +KEYWORDS="~amd64 ~ia64 ~x86" +IUSE="doc examples" + +RDEPEND=">=dev-lang/R-2.6.1 + dev-python/numpy" +DEPEND="${RDEPEND} + doc? ( || ( virtual/tetex dev-texlive/texlive-texinfo ) )" + +src_unpack() { + distutils_src_unpack + epatch "${FILESDIR}"/${PN}-lapack.patch + epatch "${FILESDIR}"/${PN}-1.0_rc3-version-detect.patch + epatch "${FILESDIR}"/${PN}-testfiles.patch +} + +src_test() { + cd tests + PYTHONPATH=$(ls -d ../build/lib.*) \ + "${python}" testall.py || die "tests failed" +} + +src_install() { + distutils_src_install + + if use examples; then + insinto /usr/share/doc/${PF} + doins -r examples || die + fi + + if use doc; then + cd doc + emake html pdf || die "emake docs failed" + dohtml rpy_html/* || die + insinto /usr/share/doc/${PF} + doins rpy.pdf || die + fi +} |