1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
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
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.0-1
- Package Spec generated
|