diff options
Diffstat (limited to 'python-liknorm.spec')
| -rw-r--r-- | python-liknorm.spec | 266 |
1 files changed, 266 insertions, 0 deletions
diff --git a/python-liknorm.spec b/python-liknorm.spec new file mode 100644 index 0000000..71098de --- /dev/null +++ b/python-liknorm.spec @@ -0,0 +1,266 @@ +%global _empty_manifest_terminate_build 0 +Name: python-liknorm +Version: 1.2.10 +Release: 1 +Summary: Liknorm Python wrapper +License: MIT +URL: https://github.com/limix/liknorm-py +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/8c/ef/36617aa24e72591e59611b72b0f9f6ae2c5d368ab6a4ae7fa0760ef9ffb7/liknorm-1.2.10.tar.gz + +Requires: python3-cffi +Requires: python3-pytest +Requires: python3-urllib3 + +%description +# liknorm-py + +Liknorm Python wrapper. + +## Install + +It can be done via [pip](https://pypi.org/) or [conda](https://conda.io/). + +### Pip + +```bash +pip install liknorm +``` + +### Conda + +```bash +conda install -c conda-forge liknorm-py +``` + +## Running the tests + +After installation, you can test it + +```bash +python -c "import liknorm; liknorm.test()" +``` + +as long as you have [pytest](http://docs.pytest.org/en/latest/). + +## Example + +```python +>>> from numpy import empty +>>> from numpy.random import RandomState +>>> from liknorm import LikNormMachine +>>> +>>> machine = LikNormMachine('bernoulli') +>>> random = RandomState(0) +>>> outcome = random.randint(0, 2, 5) +>>> tau = random.rand(5) +>>> eta = random.randn(5) * tau +>>> +>>> log_zeroth = empty(5) +>>> mean = empty(5) +>>> variance = empty(5) +>>> +>>> moments = {'log_zeroth': log_zeroth, 'mean': mean, 'variance': variance} +>>> machine.moments(outcome, eta, tau, moments) +>>> +>>> print('%.3f %.3f %.3f' % (log_zeroth[0], mean[0], variance[0])) +-0.671 -0.515 0.946 +``` + +## Authors + +* [Danilo Horta](https://github.com/horta) + +## License + +This project is licensed under the +[MIT License](https://raw.githubusercontent.com/limix/liknorm-py/master/LICENSE.md). + + + +%package -n python3-liknorm +Summary: Liknorm Python wrapper +Provides: python-liknorm +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-liknorm +# liknorm-py + +Liknorm Python wrapper. + +## Install + +It can be done via [pip](https://pypi.org/) or [conda](https://conda.io/). + +### Pip + +```bash +pip install liknorm +``` + +### Conda + +```bash +conda install -c conda-forge liknorm-py +``` + +## Running the tests + +After installation, you can test it + +```bash +python -c "import liknorm; liknorm.test()" +``` + +as long as you have [pytest](http://docs.pytest.org/en/latest/). + +## Example + +```python +>>> from numpy import empty +>>> from numpy.random import RandomState +>>> from liknorm import LikNormMachine +>>> +>>> machine = LikNormMachine('bernoulli') +>>> random = RandomState(0) +>>> outcome = random.randint(0, 2, 5) +>>> tau = random.rand(5) +>>> eta = random.randn(5) * tau +>>> +>>> log_zeroth = empty(5) +>>> mean = empty(5) +>>> variance = empty(5) +>>> +>>> moments = {'log_zeroth': log_zeroth, 'mean': mean, 'variance': variance} +>>> machine.moments(outcome, eta, tau, moments) +>>> +>>> print('%.3f %.3f %.3f' % (log_zeroth[0], mean[0], variance[0])) +-0.671 -0.515 0.946 +``` + +## Authors + +* [Danilo Horta](https://github.com/horta) + +## License + +This project is licensed under the +[MIT License](https://raw.githubusercontent.com/limix/liknorm-py/master/LICENSE.md). + + + +%package help +Summary: Development documents and examples for liknorm +Provides: python3-liknorm-doc +%description help +# liknorm-py + +Liknorm Python wrapper. + +## Install + +It can be done via [pip](https://pypi.org/) or [conda](https://conda.io/). + +### Pip + +```bash +pip install liknorm +``` + +### Conda + +```bash +conda install -c conda-forge liknorm-py +``` + +## Running the tests + +After installation, you can test it + +```bash +python -c "import liknorm; liknorm.test()" +``` + +as long as you have [pytest](http://docs.pytest.org/en/latest/). + +## Example + +```python +>>> from numpy import empty +>>> from numpy.random import RandomState +>>> from liknorm import LikNormMachine +>>> +>>> machine = LikNormMachine('bernoulli') +>>> random = RandomState(0) +>>> outcome = random.randint(0, 2, 5) +>>> tau = random.rand(5) +>>> eta = random.randn(5) * tau +>>> +>>> log_zeroth = empty(5) +>>> mean = empty(5) +>>> variance = empty(5) +>>> +>>> moments = {'log_zeroth': log_zeroth, 'mean': mean, 'variance': variance} +>>> machine.moments(outcome, eta, tau, moments) +>>> +>>> print('%.3f %.3f %.3f' % (log_zeroth[0], mean[0], variance[0])) +-0.671 -0.515 0.946 +``` + +## Authors + +* [Danilo Horta](https://github.com/horta) + +## License + +This project is licensed under the +[MIT License](https://raw.githubusercontent.com/limix/liknorm-py/master/LICENSE.md). + + + +%prep +%autosetup -n liknorm-1.2.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-liknorm -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2.10-1 +- Package Spec generated |
