diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-10 06:56:32 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 06:56:32 +0000 |
commit | 9bedbedfc7aa699d1463b5197b27306829a0ae32 (patch) | |
tree | 8e8af3277dbcb7a591c79f4dc63264936d932623 | |
parent | 1d938bd2f1641fed116d7232f7c719f9515812af (diff) |
automatic import of python-pyslvs
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pyslvs.spec | 211 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 213 insertions, 0 deletions
@@ -0,0 +1 @@ +/pyslvs-22.7.0.tar.gz diff --git a/python-pyslvs.spec b/python-pyslvs.spec new file mode 100644 index 0000000..4d5bc42 --- /dev/null +++ b/python-pyslvs.spec @@ -0,0 +1,211 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pyslvs +Version: 22.7.0 +Release: 1 +Summary: Pyslvs core module. An open source planar linkage mechanism synthesis tool. +License: AGPL +URL: https://github.com/KmolYuan/pyslvs +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/bb/8c/c01ec1fe1487cac76b7091b9b453023a243807b10599b2d6c2aca16a9f21/pyslvs-22.7.0.tar.gz + +Requires: python3-numpy +Requires: python3-lark-parser + +%description +[](https://pypi.org/project/pyslvs/) +[](https://lgtm.com/projects/g/KmolYuan/pyslvs/context:python) + +# Pyslvs Libraries + +A no-GUI module of mechanism synthesis system and a 2D geometric constraint solver. + +## Installation + +Install from PyPI: + +```bash +pip install pyslvs +``` + +Or install and test from source: + +```bash +pip install -e . +python test +``` + +## Documentation + +Run the solver through an example: + +```python +from pyslvs import example_list, parse_vpoints, t_config, expr_solving + +# Get example with name +expr, inputs = example_list("Jansen's linkage (Single)") +# Parse the mechanism expression into a list of joint data +vpoints = parse_vpoints(expr) +# Config joint data and control data for the solver +exprs = t_config(vpoints, inputs) +# Solve the position +result = expr_solving(exprs, vpoints, {pair: 0. for pair in inputs}) +# Get the result from joint 7 +x, y = result[7] +print(x, y) # -43.170055 -91.753226 +``` + +The documentation of Pyslvs library is on [Readthedocs](https://pyslvs-ui.readthedocs.io/en/latest/pyslvs-lib/). + +If you have any questions, please post on GitHub issue or contact <pyslvs@gmail.com>. + + +%package -n python3-pyslvs +Summary: Pyslvs core module. An open source planar linkage mechanism synthesis tool. +Provides: python-pyslvs +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-pyslvs +[](https://pypi.org/project/pyslvs/) +[](https://lgtm.com/projects/g/KmolYuan/pyslvs/context:python) + +# Pyslvs Libraries + +A no-GUI module of mechanism synthesis system and a 2D geometric constraint solver. + +## Installation + +Install from PyPI: + +```bash +pip install pyslvs +``` + +Or install and test from source: + +```bash +pip install -e . +python test +``` + +## Documentation + +Run the solver through an example: + +```python +from pyslvs import example_list, parse_vpoints, t_config, expr_solving + +# Get example with name +expr, inputs = example_list("Jansen's linkage (Single)") +# Parse the mechanism expression into a list of joint data +vpoints = parse_vpoints(expr) +# Config joint data and control data for the solver +exprs = t_config(vpoints, inputs) +# Solve the position +result = expr_solving(exprs, vpoints, {pair: 0. for pair in inputs}) +# Get the result from joint 7 +x, y = result[7] +print(x, y) # -43.170055 -91.753226 +``` + +The documentation of Pyslvs library is on [Readthedocs](https://pyslvs-ui.readthedocs.io/en/latest/pyslvs-lib/). + +If you have any questions, please post on GitHub issue or contact <pyslvs@gmail.com>. + + +%package help +Summary: Development documents and examples for pyslvs +Provides: python3-pyslvs-doc +%description help +[](https://pypi.org/project/pyslvs/) +[](https://lgtm.com/projects/g/KmolYuan/pyslvs/context:python) + +# Pyslvs Libraries + +A no-GUI module of mechanism synthesis system and a 2D geometric constraint solver. + +## Installation + +Install from PyPI: + +```bash +pip install pyslvs +``` + +Or install and test from source: + +```bash +pip install -e . +python test +``` + +## Documentation + +Run the solver through an example: + +```python +from pyslvs import example_list, parse_vpoints, t_config, expr_solving + +# Get example with name +expr, inputs = example_list("Jansen's linkage (Single)") +# Parse the mechanism expression into a list of joint data +vpoints = parse_vpoints(expr) +# Config joint data and control data for the solver +exprs = t_config(vpoints, inputs) +# Solve the position +result = expr_solving(exprs, vpoints, {pair: 0. for pair in inputs}) +# Get the result from joint 7 +x, y = result[7] +print(x, y) # -43.170055 -91.753226 +``` + +The documentation of Pyslvs library is on [Readthedocs](https://pyslvs-ui.readthedocs.io/en/latest/pyslvs-lib/). + +If you have any questions, please post on GitHub issue or contact <pyslvs@gmail.com>. + + +%prep +%autosetup -n pyslvs-22.7.0 + +%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-pyslvs -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 22.7.0-1 +- Package Spec generated @@ -0,0 +1 @@ +d5b62fedf6178073d0998f531c6cb685 pyslvs-22.7.0.tar.gz |