diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-fisher.spec | 243 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 245 insertions, 0 deletions
@@ -0,0 +1 @@ +/fisher-0.1.10.tar.gz diff --git a/python-fisher.spec b/python-fisher.spec new file mode 100644 index 0000000..23b3869 --- /dev/null +++ b/python-fisher.spec @@ -0,0 +1,243 @@ +%global _empty_manifest_terminate_build 0 +Name: python-fisher +Version: 0.1.10 +Release: 1 +Summary: Fast Fisher's Exact Test +License: BSD +URL: http://github.com/brentp/fishers_exact_test +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d8/96/734587ac0ca747f4a84724627013ae5d44f14fabfd43646473fd8c2bd6e4/fisher-0.1.10.tar.gz +BuildArch: noarch + + +%description +# Fisher\'s Exact Test + +[](https://travis-ci.org/brentp/fishers_exact_test) +[](https://pypi.org/project/fisher) + +Simple, fast implementation of [Fisher\'s exact +test](http://en.wikipedia.org/wiki/Fisher's_exact_test). For example, +for the following table: + +| | Having the property | Not having the property | +| ------------ | ------------------- | ----------------------- | +| Selected | 12 | 5 | +| Not selected | 29 | 2 | + +Perhaps we are interested in whether there is any difference of property +in selected vs. non-selected groups, then we can do the Fisher\'s exact +test. + +## Installation + +Within this folder : + + git clone git://github.com/brentp/fishers_exact_test.git + pip install . + +From PyPI : + + pip install fisher + +Or install the development version : + + pip install git+git://github.com/brentp/fishers_exact_test.git + +## Usage + +`fisher.pvalue()` accepts 4 values corresponding to the 2-by-2 +contingency table, returns an object with attributes for left_tail, +right_tail, and two_tail p-values : + + >>> from fisher import pvalue + >>> mat = [[12, 5], [29, 2]] + >>> p = pvalue(12, 5, 29, 2) + >>> p.left_tail, p.right_tail, p.two_tail # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS + (0.04455473783507..., 0.994525206021..., 0.0802685520741...) + +## Benchmark + +A simple benchmark that calls the Fisher\'s exact test 1000 times (in +`scripts/rfisher.py`): + + calling python fisher... + iterations/sec: 3000.62526381 + calling rpy fisher... + iterations/sec: 289.225902364 + calling R directly... + iterations/sec: 244.36542276 + +So the cython fisher is up to 10 times faster than rpy or R version. + +%package -n python3-fisher +Summary: Fast Fisher's Exact Test +Provides: python-fisher +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-fisher +# Fisher\'s Exact Test + +[](https://travis-ci.org/brentp/fishers_exact_test) +[](https://pypi.org/project/fisher) + +Simple, fast implementation of [Fisher\'s exact +test](http://en.wikipedia.org/wiki/Fisher's_exact_test). For example, +for the following table: + +| | Having the property | Not having the property | +| ------------ | ------------------- | ----------------------- | +| Selected | 12 | 5 | +| Not selected | 29 | 2 | + +Perhaps we are interested in whether there is any difference of property +in selected vs. non-selected groups, then we can do the Fisher\'s exact +test. + +## Installation + +Within this folder : + + git clone git://github.com/brentp/fishers_exact_test.git + pip install . + +From PyPI : + + pip install fisher + +Or install the development version : + + pip install git+git://github.com/brentp/fishers_exact_test.git + +## Usage + +`fisher.pvalue()` accepts 4 values corresponding to the 2-by-2 +contingency table, returns an object with attributes for left_tail, +right_tail, and two_tail p-values : + + >>> from fisher import pvalue + >>> mat = [[12, 5], [29, 2]] + >>> p = pvalue(12, 5, 29, 2) + >>> p.left_tail, p.right_tail, p.two_tail # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS + (0.04455473783507..., 0.994525206021..., 0.0802685520741...) + +## Benchmark + +A simple benchmark that calls the Fisher\'s exact test 1000 times (in +`scripts/rfisher.py`): + + calling python fisher... + iterations/sec: 3000.62526381 + calling rpy fisher... + iterations/sec: 289.225902364 + calling R directly... + iterations/sec: 244.36542276 + +So the cython fisher is up to 10 times faster than rpy or R version. + +%package help +Summary: Development documents and examples for fisher +Provides: python3-fisher-doc +%description help +# Fisher\'s Exact Test + +[](https://travis-ci.org/brentp/fishers_exact_test) +[](https://pypi.org/project/fisher) + +Simple, fast implementation of [Fisher\'s exact +test](http://en.wikipedia.org/wiki/Fisher's_exact_test). For example, +for the following table: + +| | Having the property | Not having the property | +| ------------ | ------------------- | ----------------------- | +| Selected | 12 | 5 | +| Not selected | 29 | 2 | + +Perhaps we are interested in whether there is any difference of property +in selected vs. non-selected groups, then we can do the Fisher\'s exact +test. + +## Installation + +Within this folder : + + git clone git://github.com/brentp/fishers_exact_test.git + pip install . + +From PyPI : + + pip install fisher + +Or install the development version : + + pip install git+git://github.com/brentp/fishers_exact_test.git + +## Usage + +`fisher.pvalue()` accepts 4 values corresponding to the 2-by-2 +contingency table, returns an object with attributes for left_tail, +right_tail, and two_tail p-values : + + >>> from fisher import pvalue + >>> mat = [[12, 5], [29, 2]] + >>> p = pvalue(12, 5, 29, 2) + >>> p.left_tail, p.right_tail, p.two_tail # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS + (0.04455473783507..., 0.994525206021..., 0.0802685520741...) + +## Benchmark + +A simple benchmark that calls the Fisher\'s exact test 1000 times (in +`scripts/rfisher.py`): + + calling python fisher... + iterations/sec: 3000.62526381 + calling rpy fisher... + iterations/sec: 289.225902364 + calling R directly... + iterations/sec: 244.36542276 + +So the cython fisher is up to 10 times faster than rpy or R version. + +%prep +%autosetup -n fisher-0.1.10 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-fisher -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.10-1 +- Package Spec generated @@ -0,0 +1 @@ +865298753a2b9584fce005083c2ba548 fisher-0.1.10.tar.gz |