From 8b40fb9792fa94649979a4b0f935febc2a54b957 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 29 May 2023 13:12:15 +0000 Subject: automatic import of python-pystats --- .gitignore | 1 + python-pystats.spec | 494 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 496 insertions(+) create mode 100644 python-pystats.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..6714cb4 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/PyStats-0.1.tar.gz diff --git a/python-pystats.spec b/python-pystats.spec new file mode 100644 index 0000000..9d4c560 --- /dev/null +++ b/python-pystats.spec @@ -0,0 +1,494 @@ +%global _empty_manifest_terminate_build 0 +Name: python-PyStats +Version: 0.1 +Release: 1 +Summary: A Python 3 package of statistical analysis and distributions +License: MIT License +URL: https://github.com/marcizhu/PyStats +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/cb/78/28ced26af1c3511cc864db2c032a93d87761616c93f7d805bb62c19ced60/PyStats-0.1.tar.gz + + +%description +# PyStats + +PyStats is a Python 3 library of statistical analysis and distribution functions with simple **R**-like syntax, scalar/list input/output with OpenMP parallelization. + +### Contents +- [Distributions](#distributions) +- [Installation](#installation) +- [Documentation](#documentation) +- [Syntax and Examples](#syntax-and-examples) +- [Credits](#credits) +- [License](#license) + +## Distributions +Functions to compute the cdf, pdf, quantile, as well as random sampling methods, are available for the following distributions: + +- Bernoulli +- Beta +- Binomial +- Cauchy +- Chi-squared +- Exponential +- F +- Gamma +- Inverse-Gamma +- Laplace +- Logistic +- Log-Normal +- Normal (Gaussian) +- Poisson +- Student's t +- Uniform +- Weibull + + +## Installation +You can use pip to install this library: + +```sh +pip3 install pystats +``` + +Alternatively, you can also clone this repository and install the plugin manually using `pip`: + +```sh +$ git clone git@github.com:marcizhu/PyStats.git +$ pip3 install ./PyStats +``` + +After that, you can just `import pystats` (or do `from pystats import *` if you don't want to type `pystats.` before all functions) and you're ready to go. + + +## Documentation +Full documentation is available online: + +[![Documentation Status](https://readthedocs.org/projects/pystats/badge/?version=latest)](https://pystats.readthedocs.io/en/latest/?badge=latest) + +A PDF version of the documentation is available [here](https://buildmedia.readthedocs.org/media/pdf/pystats/latest/pystats.pdf). + + +## Syntax and Examples +Functions are called using an **R**-like syntax. Some general rules: + +- Density functions: `pystats.d*`. For example, the Normal (Gaussian) density is called using +```python3 +pystats.dnorm(, , ) +``` + +- Cumulative distribution functions: `pystats.p*`. For example, the Gamma CDF is called using +```python3 +pystats.pgamma(, , ) +``` + +- Quantile functions: `pystats.q*`. For example, the Beta quantile is called using +```python3 +pystats.qbeta(, , ) +``` + +- Random sampling: `pystats.r*`. For example, to generate a single draw from the Logistic distribution: +```python3 +pystats.rlogis(, ) +``` + +The library also supports lists as input/output: +- The pdf, cdf and quantile functions can take list arguments. For example: +```python3 +norm_pdf_vals = pystats.dnorm([x / 10 for x in range(-10, 10, 1)], 1.0, 2.0) +``` + +- The randomization functions (`r*`) can output lists of arbitrary size. For example, the following code will generate a 100-item list of iid draws from a Gamma(3,2) distribution: +```python3 +gamma_rvs = pystats.rgamma(100, 3.0, 2.0) +``` + +Additionally, most parameters have defaults to most common values and named parameters are also supported. For example, to generate a single draw from a Normal(0, 2) the following can be used: +```python3 +norm_draw = pystats.rnorm(sd=2.0) +``` + + +### Examples +More examples with code: +```python3 +# Evaluate the normal PDF at x = 1, mu = 0, sigma = 1 +dval_1 = pystats.dnorm(1.0, 0.0, 1.0) + +# Evaluate the normal PDF at x = 1, mu = 0, sigma = 1, and return the log value +dval_2 = pystats.dnorm(1.0, 0.0, 1.0, True) + +# Same as above, but using default values and named parameters +dval_3 = pystats.dnorm(1.0, log=True) + +# Evaluate the normal CDF at x = 1, mu = 0, sigma = 1 +pval = pystats.pnorm(1.0, 0.0, 1.0) + +# Evaluate the Laplacian quantile at q = 0.1, mu = 0, sigma = 1 +qval = pystats.qlaplace(0.1, 0.0, 1.0) + +# Draw from a t-distribution with dof = 30 +rval = pystats.rt(dof=30) + +# List output +beta_rvs = pystats.rbeta(100, 3.0, 2.0) + +# List input +beta_cdf_vals = pystats.pbeta(beta_rvs, 3.0, 2.0) +``` + +For more information on default values, parameter names and other examples, check the [documentation](#documentation). + + +## Credits +This library uses [kthohr/stats](https://github.com/kthohr/stats) for the statistical distribution functions, [kthohr/gcem](https://github.com/kthohr/gcem) (a dependency of the previous library) and [pybind/pybind11](https://github.com/pybind/pybind11) to generate the binding code. + + +## License +Copyright (c) Marc Izquierdo 2021 +This library is licensed under the [MIT License](https://choosealicense.com/licenses/mit/). See +[LICENSE](https://github.com/marcizhu/pystats/blob/master/LICENSE) for more details. + + + + +%package -n python3-PyStats +Summary: A Python 3 package of statistical analysis and distributions +Provides: python-PyStats +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-PyStats +# PyStats + +PyStats is a Python 3 library of statistical analysis and distribution functions with simple **R**-like syntax, scalar/list input/output with OpenMP parallelization. + +### Contents +- [Distributions](#distributions) +- [Installation](#installation) +- [Documentation](#documentation) +- [Syntax and Examples](#syntax-and-examples) +- [Credits](#credits) +- [License](#license) + +## Distributions +Functions to compute the cdf, pdf, quantile, as well as random sampling methods, are available for the following distributions: + +- Bernoulli +- Beta +- Binomial +- Cauchy +- Chi-squared +- Exponential +- F +- Gamma +- Inverse-Gamma +- Laplace +- Logistic +- Log-Normal +- Normal (Gaussian) +- Poisson +- Student's t +- Uniform +- Weibull + + +## Installation +You can use pip to install this library: + +```sh +pip3 install pystats +``` + +Alternatively, you can also clone this repository and install the plugin manually using `pip`: + +```sh +$ git clone git@github.com:marcizhu/PyStats.git +$ pip3 install ./PyStats +``` + +After that, you can just `import pystats` (or do `from pystats import *` if you don't want to type `pystats.` before all functions) and you're ready to go. + + +## Documentation +Full documentation is available online: + +[![Documentation Status](https://readthedocs.org/projects/pystats/badge/?version=latest)](https://pystats.readthedocs.io/en/latest/?badge=latest) + +A PDF version of the documentation is available [here](https://buildmedia.readthedocs.org/media/pdf/pystats/latest/pystats.pdf). + + +## Syntax and Examples +Functions are called using an **R**-like syntax. Some general rules: + +- Density functions: `pystats.d*`. For example, the Normal (Gaussian) density is called using +```python3 +pystats.dnorm(, , ) +``` + +- Cumulative distribution functions: `pystats.p*`. For example, the Gamma CDF is called using +```python3 +pystats.pgamma(, , ) +``` + +- Quantile functions: `pystats.q*`. For example, the Beta quantile is called using +```python3 +pystats.qbeta(, , ) +``` + +- Random sampling: `pystats.r*`. For example, to generate a single draw from the Logistic distribution: +```python3 +pystats.rlogis(, ) +``` + +The library also supports lists as input/output: +- The pdf, cdf and quantile functions can take list arguments. For example: +```python3 +norm_pdf_vals = pystats.dnorm([x / 10 for x in range(-10, 10, 1)], 1.0, 2.0) +``` + +- The randomization functions (`r*`) can output lists of arbitrary size. For example, the following code will generate a 100-item list of iid draws from a Gamma(3,2) distribution: +```python3 +gamma_rvs = pystats.rgamma(100, 3.0, 2.0) +``` + +Additionally, most parameters have defaults to most common values and named parameters are also supported. For example, to generate a single draw from a Normal(0, 2) the following can be used: +```python3 +norm_draw = pystats.rnorm(sd=2.0) +``` + + +### Examples +More examples with code: +```python3 +# Evaluate the normal PDF at x = 1, mu = 0, sigma = 1 +dval_1 = pystats.dnorm(1.0, 0.0, 1.0) + +# Evaluate the normal PDF at x = 1, mu = 0, sigma = 1, and return the log value +dval_2 = pystats.dnorm(1.0, 0.0, 1.0, True) + +# Same as above, but using default values and named parameters +dval_3 = pystats.dnorm(1.0, log=True) + +# Evaluate the normal CDF at x = 1, mu = 0, sigma = 1 +pval = pystats.pnorm(1.0, 0.0, 1.0) + +# Evaluate the Laplacian quantile at q = 0.1, mu = 0, sigma = 1 +qval = pystats.qlaplace(0.1, 0.0, 1.0) + +# Draw from a t-distribution with dof = 30 +rval = pystats.rt(dof=30) + +# List output +beta_rvs = pystats.rbeta(100, 3.0, 2.0) + +# List input +beta_cdf_vals = pystats.pbeta(beta_rvs, 3.0, 2.0) +``` + +For more information on default values, parameter names and other examples, check the [documentation](#documentation). + + +## Credits +This library uses [kthohr/stats](https://github.com/kthohr/stats) for the statistical distribution functions, [kthohr/gcem](https://github.com/kthohr/gcem) (a dependency of the previous library) and [pybind/pybind11](https://github.com/pybind/pybind11) to generate the binding code. + + +## License +Copyright (c) Marc Izquierdo 2021 +This library is licensed under the [MIT License](https://choosealicense.com/licenses/mit/). See +[LICENSE](https://github.com/marcizhu/pystats/blob/master/LICENSE) for more details. + + + + +%package help +Summary: Development documents and examples for PyStats +Provides: python3-PyStats-doc +%description help +# PyStats + +PyStats is a Python 3 library of statistical analysis and distribution functions with simple **R**-like syntax, scalar/list input/output with OpenMP parallelization. + +### Contents +- [Distributions](#distributions) +- [Installation](#installation) +- [Documentation](#documentation) +- [Syntax and Examples](#syntax-and-examples) +- [Credits](#credits) +- [License](#license) + +## Distributions +Functions to compute the cdf, pdf, quantile, as well as random sampling methods, are available for the following distributions: + +- Bernoulli +- Beta +- Binomial +- Cauchy +- Chi-squared +- Exponential +- F +- Gamma +- Inverse-Gamma +- Laplace +- Logistic +- Log-Normal +- Normal (Gaussian) +- Poisson +- Student's t +- Uniform +- Weibull + + +## Installation +You can use pip to install this library: + +```sh +pip3 install pystats +``` + +Alternatively, you can also clone this repository and install the plugin manually using `pip`: + +```sh +$ git clone git@github.com:marcizhu/PyStats.git +$ pip3 install ./PyStats +``` + +After that, you can just `import pystats` (or do `from pystats import *` if you don't want to type `pystats.` before all functions) and you're ready to go. + + +## Documentation +Full documentation is available online: + +[![Documentation Status](https://readthedocs.org/projects/pystats/badge/?version=latest)](https://pystats.readthedocs.io/en/latest/?badge=latest) + +A PDF version of the documentation is available [here](https://buildmedia.readthedocs.org/media/pdf/pystats/latest/pystats.pdf). + + +## Syntax and Examples +Functions are called using an **R**-like syntax. Some general rules: + +- Density functions: `pystats.d*`. For example, the Normal (Gaussian) density is called using +```python3 +pystats.dnorm(, , ) +``` + +- Cumulative distribution functions: `pystats.p*`. For example, the Gamma CDF is called using +```python3 +pystats.pgamma(, , ) +``` + +- Quantile functions: `pystats.q*`. For example, the Beta quantile is called using +```python3 +pystats.qbeta(, , ) +``` + +- Random sampling: `pystats.r*`. For example, to generate a single draw from the Logistic distribution: +```python3 +pystats.rlogis(, ) +``` + +The library also supports lists as input/output: +- The pdf, cdf and quantile functions can take list arguments. For example: +```python3 +norm_pdf_vals = pystats.dnorm([x / 10 for x in range(-10, 10, 1)], 1.0, 2.0) +``` + +- The randomization functions (`r*`) can output lists of arbitrary size. For example, the following code will generate a 100-item list of iid draws from a Gamma(3,2) distribution: +```python3 +gamma_rvs = pystats.rgamma(100, 3.0, 2.0) +``` + +Additionally, most parameters have defaults to most common values and named parameters are also supported. For example, to generate a single draw from a Normal(0, 2) the following can be used: +```python3 +norm_draw = pystats.rnorm(sd=2.0) +``` + + +### Examples +More examples with code: +```python3 +# Evaluate the normal PDF at x = 1, mu = 0, sigma = 1 +dval_1 = pystats.dnorm(1.0, 0.0, 1.0) + +# Evaluate the normal PDF at x = 1, mu = 0, sigma = 1, and return the log value +dval_2 = pystats.dnorm(1.0, 0.0, 1.0, True) + +# Same as above, but using default values and named parameters +dval_3 = pystats.dnorm(1.0, log=True) + +# Evaluate the normal CDF at x = 1, mu = 0, sigma = 1 +pval = pystats.pnorm(1.0, 0.0, 1.0) + +# Evaluate the Laplacian quantile at q = 0.1, mu = 0, sigma = 1 +qval = pystats.qlaplace(0.1, 0.0, 1.0) + +# Draw from a t-distribution with dof = 30 +rval = pystats.rt(dof=30) + +# List output +beta_rvs = pystats.rbeta(100, 3.0, 2.0) + +# List input +beta_cdf_vals = pystats.pbeta(beta_rvs, 3.0, 2.0) +``` + +For more information on default values, parameter names and other examples, check the [documentation](#documentation). + + +## Credits +This library uses [kthohr/stats](https://github.com/kthohr/stats) for the statistical distribution functions, [kthohr/gcem](https://github.com/kthohr/gcem) (a dependency of the previous library) and [pybind/pybind11](https://github.com/pybind/pybind11) to generate the binding code. + + +## License +Copyright (c) Marc Izquierdo 2021 +This library is licensed under the [MIT License](https://choosealicense.com/licenses/mit/). See +[LICENSE](https://github.com/marcizhu/pystats/blob/master/LICENSE) for more details. + + + + +%prep +%autosetup -n PyStats-0.1 + +%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-PyStats -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 29 2023 Python_Bot - 0.1-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..53e2bb0 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +0e6329d8056d4f5cceb4f64b690f6bbf PyStats-0.1.tar.gz -- cgit v1.2.3