diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-15 07:32:41 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-15 07:32:41 +0000 |
| commit | 26b3c47b84b94d12eaad3c6bcc5898582f71f63b (patch) | |
| tree | d7e75be9529ed20f7a4eb8edc2fe39fe37cb94e0 | |
| parent | c1f8d8224f686b73ae562cb0316d8754340a7b1f (diff) | |
automatic import of python-peace-performance-python
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-peace-performance-python.spec | 315 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 317 insertions, 0 deletions
@@ -0,0 +1 @@ +/peace-performance-python-2.0.0.tar.gz diff --git a/python-peace-performance-python.spec b/python-peace-performance-python.spec new file mode 100644 index 0000000..07c9dc6 --- /dev/null +++ b/python-peace-performance-python.spec @@ -0,0 +1,315 @@ +%global _empty_manifest_terminate_build 0 +Name: python-peace-performance-python +Version: 2.0.0 +Release: 1 +Summary: Rust binding for python. To calculate star ratings and performance points for all osu! gamemodes, and quickly parse Beatmap into python objects. +License: MIT License Copyright (c) 2021 Pure-Peace Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +URL: https://github.com/Pure-Peace/peace-performance-python +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a6/74/f2234c1a41410aafedae2c7e4fd711bb9c0163c7c3ad5f26a950c573631f/peace-performance-python-2.0.0.tar.gz + +Requires: python3-typing-extensions +Requires: python3-pytest +Requires: python3-pytest-cov[all] +Requires: python3-setuptools-rust +Requires: python3-maturin +Requires: python3-pytest-benchmark +Requires: python3-pytest-benchmark[histogram] + +%description +## Beatmap parse +### Examples +```python +from peace_performance_python.prelude import * +from tests import join_beatmap, HITORIGOTO +# *No longer available by default (compile without `rust_logger` features enabled)* +# Initialize Rust logger (optional) +''' +set_log_level('trace') +init_logger() +''' +def main(): + path = join_beatmap(HITORIGOTO) + # Load beatmap + b = Beatmap(path) + print('\n>>>>> Beatmap:', b) + print('\n>>>>> Beatmap.hit_objects (0-3):', b.hit_objects[:3]) + print('\n>>>>> Beatmap.timing_points:', b.timing_points) + print('\n>>>>> Beatmap.difficulty_points (0-3):', b.difficulty_points[:3]) + print('\n>>>>> Beatmap.hit_objects[0].pos:', b.hit_objects[0].pos) + print('\n>>>>> Beatmap.hit_objects[3].kind:', b.hit_objects[3].kind) + print('\n>>>>> Beatmap.hit_objects[3].kind.curve_points:', + b.hit_objects[3].kind.curve_points) + pos_0 = b.hit_objects[0].pos + pos_1 = b.hit_objects[1].pos + print('\n>>>>> Beatmap object(0):', b.hit_objects[0]) + print('\n>>>>> Beatmap object(1):', b.hit_objects[1]) + print('\n>>>>> Beatmap object pos(0):', pos_0) + print('\n>>>>> Beatmap object pos(1):', pos_1) + print('\n>>>>> Beatmap object pos(0) length, squared:', + pos_0.length, pos_0.length_squared) + print('\n>>>>> Beatmap object pos(0 and 1) distance:', pos_0.distance(pos_1)) + print('\n>>>>> Beatmap object pos(0 and 1) add:', pos_0.add(pos_1)) + print('\n>>>>> Beatmap object pos(0 and 1) sub:', pos_0.sub(pos_1)) +if __name__ == '__main__': + main() +``` +### Running results +```rust + TRACE peace_performance_python::methods::common > function=sync_read_file duration=78.3µs + TRACE peace_performance_python::methods::pp > function=sync_parse_beatmap duration=193.4µs +>>>>> Beatmap: <Beatmap object ( + path: ./test_beatmaps/hitorigoto.osu, + is_initialized: True, + mode: 0, mode_str: std, version: 14, + n_circles: 207, n_sliders: 132, n_spinners: 1, + ar: 9, od: 8.5, cs: 4, hp: 6, sv: 1.7, tick_rate: 1, + stack_leniency: None + ), hidden: hit_objects, timing_points, difficulty_points> +>>>>> Beatmap.hit_objects (0-3): [ + <HitObject object ( + start_time: 536, sound: 4, end_time: 536, kind: circle, pos: (44, 136))>, + <HitObject object ( + start_time: 717, sound: 0, end_time: 717, kind: circle, pos: (315, 196))>, + <HitObject object ( + start_time: 899, sound: 0, end_time: 899, kind: slider, pos: (152, 304))>] +>>>>> Beatmap.timing_points: [<TimingPoint object (time: 536, beat_len: 363.63635)>] +>>>>> Beatmap.difficulty_points (0-3): [ + <DifficultyPoint object (time: 23808, speed_multiplier: 1)>, + <DifficultyPoint object (time: 35445, speed_multiplier: 0.8)>, + <DifficultyPoint object (time: 41263, speed_multiplier: 1)>] +>>>>> Beatmap.hit_objects[0].pos: <Pos2 object (x: 44, y: 136)> +>>>>> Beatmap.hit_objects[3].kind: <HitObjectKind object ( + kind: slider, pixel_len: Some(85.0), repeats: Some(1), + path_type: Some("perfect_curve"), end_time: None)> +>>>>> Beatmap.hit_objects[3].kind.curve_points: [ + <Pos2 object (x: 315, y: 196)>, + <Pos2 object (x: 277, y: 176)>, + <Pos2 object (x: 248, y: 145)>] +>>>>> Beatmap object(0): <HitObject object ( + start_time: 536, sound: 4, end_time: 536, kind: circle, pos: (44, 136))> +>>>>> Beatmap object(1): <HitObject object ( + start_time: 717, sound: 0, end_time: 717, kind: circle, pos: (315, 196))> +>>>>> Beatmap object pos(0): <Pos2 object (x: 44, y: 136)> +>>>>> Beatmap object pos(1): <Pos2 object (x: 315, y: 196)> +>>>>> Beatmap object pos(0) length, squared: 142.9405517578125 20432.0 +>>>>> Beatmap object pos(0 and 1) distance: 277.5625915527344 +>>>>> Beatmap object pos(0 and 1) add: <Pos2 object (x: 359, y: 332)> +>>>>> Beatmap object pos(0 and 1) sub: <Pos2 object (x: -271, y: -60)> + +%package -n python3-peace-performance-python +Summary: Rust binding for python. To calculate star ratings and performance points for all osu! gamemodes, and quickly parse Beatmap into python objects. +Provides: python-peace-performance-python +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-peace-performance-python +## Beatmap parse +### Examples +```python +from peace_performance_python.prelude import * +from tests import join_beatmap, HITORIGOTO +# *No longer available by default (compile without `rust_logger` features enabled)* +# Initialize Rust logger (optional) +''' +set_log_level('trace') +init_logger() +''' +def main(): + path = join_beatmap(HITORIGOTO) + # Load beatmap + b = Beatmap(path) + print('\n>>>>> Beatmap:', b) + print('\n>>>>> Beatmap.hit_objects (0-3):', b.hit_objects[:3]) + print('\n>>>>> Beatmap.timing_points:', b.timing_points) + print('\n>>>>> Beatmap.difficulty_points (0-3):', b.difficulty_points[:3]) + print('\n>>>>> Beatmap.hit_objects[0].pos:', b.hit_objects[0].pos) + print('\n>>>>> Beatmap.hit_objects[3].kind:', b.hit_objects[3].kind) + print('\n>>>>> Beatmap.hit_objects[3].kind.curve_points:', + b.hit_objects[3].kind.curve_points) + pos_0 = b.hit_objects[0].pos + pos_1 = b.hit_objects[1].pos + print('\n>>>>> Beatmap object(0):', b.hit_objects[0]) + print('\n>>>>> Beatmap object(1):', b.hit_objects[1]) + print('\n>>>>> Beatmap object pos(0):', pos_0) + print('\n>>>>> Beatmap object pos(1):', pos_1) + print('\n>>>>> Beatmap object pos(0) length, squared:', + pos_0.length, pos_0.length_squared) + print('\n>>>>> Beatmap object pos(0 and 1) distance:', pos_0.distance(pos_1)) + print('\n>>>>> Beatmap object pos(0 and 1) add:', pos_0.add(pos_1)) + print('\n>>>>> Beatmap object pos(0 and 1) sub:', pos_0.sub(pos_1)) +if __name__ == '__main__': + main() +``` +### Running results +```rust + TRACE peace_performance_python::methods::common > function=sync_read_file duration=78.3µs + TRACE peace_performance_python::methods::pp > function=sync_parse_beatmap duration=193.4µs +>>>>> Beatmap: <Beatmap object ( + path: ./test_beatmaps/hitorigoto.osu, + is_initialized: True, + mode: 0, mode_str: std, version: 14, + n_circles: 207, n_sliders: 132, n_spinners: 1, + ar: 9, od: 8.5, cs: 4, hp: 6, sv: 1.7, tick_rate: 1, + stack_leniency: None + ), hidden: hit_objects, timing_points, difficulty_points> +>>>>> Beatmap.hit_objects (0-3): [ + <HitObject object ( + start_time: 536, sound: 4, end_time: 536, kind: circle, pos: (44, 136))>, + <HitObject object ( + start_time: 717, sound: 0, end_time: 717, kind: circle, pos: (315, 196))>, + <HitObject object ( + start_time: 899, sound: 0, end_time: 899, kind: slider, pos: (152, 304))>] +>>>>> Beatmap.timing_points: [<TimingPoint object (time: 536, beat_len: 363.63635)>] +>>>>> Beatmap.difficulty_points (0-3): [ + <DifficultyPoint object (time: 23808, speed_multiplier: 1)>, + <DifficultyPoint object (time: 35445, speed_multiplier: 0.8)>, + <DifficultyPoint object (time: 41263, speed_multiplier: 1)>] +>>>>> Beatmap.hit_objects[0].pos: <Pos2 object (x: 44, y: 136)> +>>>>> Beatmap.hit_objects[3].kind: <HitObjectKind object ( + kind: slider, pixel_len: Some(85.0), repeats: Some(1), + path_type: Some("perfect_curve"), end_time: None)> +>>>>> Beatmap.hit_objects[3].kind.curve_points: [ + <Pos2 object (x: 315, y: 196)>, + <Pos2 object (x: 277, y: 176)>, + <Pos2 object (x: 248, y: 145)>] +>>>>> Beatmap object(0): <HitObject object ( + start_time: 536, sound: 4, end_time: 536, kind: circle, pos: (44, 136))> +>>>>> Beatmap object(1): <HitObject object ( + start_time: 717, sound: 0, end_time: 717, kind: circle, pos: (315, 196))> +>>>>> Beatmap object pos(0): <Pos2 object (x: 44, y: 136)> +>>>>> Beatmap object pos(1): <Pos2 object (x: 315, y: 196)> +>>>>> Beatmap object pos(0) length, squared: 142.9405517578125 20432.0 +>>>>> Beatmap object pos(0 and 1) distance: 277.5625915527344 +>>>>> Beatmap object pos(0 and 1) add: <Pos2 object (x: 359, y: 332)> +>>>>> Beatmap object pos(0 and 1) sub: <Pos2 object (x: -271, y: -60)> + +%package help +Summary: Development documents and examples for peace-performance-python +Provides: python3-peace-performance-python-doc +%description help +## Beatmap parse +### Examples +```python +from peace_performance_python.prelude import * +from tests import join_beatmap, HITORIGOTO +# *No longer available by default (compile without `rust_logger` features enabled)* +# Initialize Rust logger (optional) +''' +set_log_level('trace') +init_logger() +''' +def main(): + path = join_beatmap(HITORIGOTO) + # Load beatmap + b = Beatmap(path) + print('\n>>>>> Beatmap:', b) + print('\n>>>>> Beatmap.hit_objects (0-3):', b.hit_objects[:3]) + print('\n>>>>> Beatmap.timing_points:', b.timing_points) + print('\n>>>>> Beatmap.difficulty_points (0-3):', b.difficulty_points[:3]) + print('\n>>>>> Beatmap.hit_objects[0].pos:', b.hit_objects[0].pos) + print('\n>>>>> Beatmap.hit_objects[3].kind:', b.hit_objects[3].kind) + print('\n>>>>> Beatmap.hit_objects[3].kind.curve_points:', + b.hit_objects[3].kind.curve_points) + pos_0 = b.hit_objects[0].pos + pos_1 = b.hit_objects[1].pos + print('\n>>>>> Beatmap object(0):', b.hit_objects[0]) + print('\n>>>>> Beatmap object(1):', b.hit_objects[1]) + print('\n>>>>> Beatmap object pos(0):', pos_0) + print('\n>>>>> Beatmap object pos(1):', pos_1) + print('\n>>>>> Beatmap object pos(0) length, squared:', + pos_0.length, pos_0.length_squared) + print('\n>>>>> Beatmap object pos(0 and 1) distance:', pos_0.distance(pos_1)) + print('\n>>>>> Beatmap object pos(0 and 1) add:', pos_0.add(pos_1)) + print('\n>>>>> Beatmap object pos(0 and 1) sub:', pos_0.sub(pos_1)) +if __name__ == '__main__': + main() +``` +### Running results +```rust + TRACE peace_performance_python::methods::common > function=sync_read_file duration=78.3µs + TRACE peace_performance_python::methods::pp > function=sync_parse_beatmap duration=193.4µs +>>>>> Beatmap: <Beatmap object ( + path: ./test_beatmaps/hitorigoto.osu, + is_initialized: True, + mode: 0, mode_str: std, version: 14, + n_circles: 207, n_sliders: 132, n_spinners: 1, + ar: 9, od: 8.5, cs: 4, hp: 6, sv: 1.7, tick_rate: 1, + stack_leniency: None + ), hidden: hit_objects, timing_points, difficulty_points> +>>>>> Beatmap.hit_objects (0-3): [ + <HitObject object ( + start_time: 536, sound: 4, end_time: 536, kind: circle, pos: (44, 136))>, + <HitObject object ( + start_time: 717, sound: 0, end_time: 717, kind: circle, pos: (315, 196))>, + <HitObject object ( + start_time: 899, sound: 0, end_time: 899, kind: slider, pos: (152, 304))>] +>>>>> Beatmap.timing_points: [<TimingPoint object (time: 536, beat_len: 363.63635)>] +>>>>> Beatmap.difficulty_points (0-3): [ + <DifficultyPoint object (time: 23808, speed_multiplier: 1)>, + <DifficultyPoint object (time: 35445, speed_multiplier: 0.8)>, + <DifficultyPoint object (time: 41263, speed_multiplier: 1)>] +>>>>> Beatmap.hit_objects[0].pos: <Pos2 object (x: 44, y: 136)> +>>>>> Beatmap.hit_objects[3].kind: <HitObjectKind object ( + kind: slider, pixel_len: Some(85.0), repeats: Some(1), + path_type: Some("perfect_curve"), end_time: None)> +>>>>> Beatmap.hit_objects[3].kind.curve_points: [ + <Pos2 object (x: 315, y: 196)>, + <Pos2 object (x: 277, y: 176)>, + <Pos2 object (x: 248, y: 145)>] +>>>>> Beatmap object(0): <HitObject object ( + start_time: 536, sound: 4, end_time: 536, kind: circle, pos: (44, 136))> +>>>>> Beatmap object(1): <HitObject object ( + start_time: 717, sound: 0, end_time: 717, kind: circle, pos: (315, 196))> +>>>>> Beatmap object pos(0): <Pos2 object (x: 44, y: 136)> +>>>>> Beatmap object pos(1): <Pos2 object (x: 315, y: 196)> +>>>>> Beatmap object pos(0) length, squared: 142.9405517578125 20432.0 +>>>>> Beatmap object pos(0 and 1) distance: 277.5625915527344 +>>>>> Beatmap object pos(0 and 1) add: <Pos2 object (x: 359, y: 332)> +>>>>> Beatmap object pos(0 and 1) sub: <Pos2 object (x: -271, y: -60)> + +%prep +%autosetup -n peace-performance-python-2.0.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-peace-performance-python -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.0-1 +- Package Spec generated @@ -0,0 +1 @@ +f1cb008e429fd0e7839f90debb5cbb17 peace-performance-python-2.0.0.tar.gz |
