11from pathlib import Path
2- from . import BaseGetter
32from typing import Dict , List , Optional , Tuple
43
4+ from .types import BaseGetter
5+
56
67class DifficultyPoint (BaseGetter ):
78 '''
8- DifficultyPoint object
9+ DifficultyPoint object (`Rust`)
910
1011 `time`: `float`
1112
@@ -23,7 +24,7 @@ class DifficultyPoint(BaseGetter):
2324
2425class TimingPoint (BaseGetter ):
2526 '''
26- TimingPoint object
27+ TimingPoint object (`Rust`)
2728
2829 `time`: `float`
2930
@@ -41,7 +42,7 @@ class TimingPoint(BaseGetter):
4142
4243class Pos2 (BaseGetter ):
4344 '''
44- Pos2 object
45+ Pos2 object (`Rust`)
4546
4647 `x`: `float`
4748
@@ -81,7 +82,7 @@ class Pos2(BaseGetter):
8182
8283class HitObjectKind (BaseGetter ):
8384 '''
84- HitObjectKind object
85+ HitObjectKind object (`Rust`)
8586
8687 `kind`: `str`
8788
@@ -111,7 +112,7 @@ class HitObjectKind(BaseGetter):
111112
112113class HitObject (BaseGetter ):
113114 '''
114- HitObject object
115+ HitObject object (`Rust`)
115116
116117 `start_time`: `float`
117118
@@ -150,13 +151,13 @@ class HitObject(BaseGetter):
150151
151152class Beatmap (BaseGetter ):
152153 '''
153- The Beatmap used to calculate the pp, it contains the parsed .osu beatmap.
154+ The Beatmap (`Rust`) used to calculate the pp, it contains the parsed .osu beatmap.
154155
155156 `path`: `Optional[Path]`
156157
157158 `mode`: `int`
158159
159- `mode_str`: `str`
160+ `mode_str`: `Optional[ str] `
160161
161162 `version`: `int`
162163
@@ -185,51 +186,9 @@ class Beatmap(BaseGetter):
185186 `timing_points`: `Optional[List[TimingPoint]]`
186187
187188 `difficulty_points`: `Optional[List[DifficultyPoint]]`
188-
189-
190- # Examples:
191- ```
192- # Read and parse .osu files from local
193- beatmap = Beatmap('path_to_osu_file')
194- # Same as
195- beatmap = Beatmap.create('path_to_osu_file')
196-
197- # Async Rust
198- beatmap = await Beatmap.create_async_rs('path_to_osu_file')
199- # Async Python (wrapper)
200- beatmap = await Beatmap.create_async_py('path_to_osu_file')
201-
202-
203-
204- # We can reload this .osu files as:
205- beatmap.reload()
206-
207- # Async Rust
208- await beatmap.reload_async_rs()
209- # Async Python (wrapper)
210- await beatmap.reload_async_py()
211-
212- # We can load another .osu files as:
213- beatmap.init('path_to_another_osu_file')
214-
215- # Async Rust
216- await beatmap.init_rs('path_to_another_osu_file')
217- # Async Python (wrapper)
218- await beatmap.init_py('path_to_another_osu_file')
219-
220- # Calculate PP
221- c = Calculator()
222- c.set_acc(98.8)
223- c.set_combo(727)
224- # or
225- c = Calculator({'acc': 98.8, 'combo': 727})
226- # then
227- result = c.calculate(beatmap)
228-
229- ```
230189 '''
231190 mode : int
232- mode_str : str
191+ mode_str : Optional [ str ]
233192 version : int
234193
235194 n_circles : int
@@ -244,6 +203,11 @@ class Beatmap(BaseGetter):
244203 tick_rate : float
245204 stack_leniency : Optional [float ]
246205
206+ @property
207+ def as_dict (self ) -> Dict [str , float , str , None ]: ...
208+ @property
209+ def attrs_dict (self ) -> Dict [str , float , str , None ]: ...
210+
247211 @property
248212 def hit_objects (self ) -> List [HitObject ]: ...
249213 @property
@@ -252,5 +216,11 @@ class Beatmap(BaseGetter):
252216 def difficulty_points (self ) -> List [DifficultyPoint ]: ...
253217
254218
255- async def read_beatmap_async (path : Path ) -> Beatmap : ...
256- def read_beatmap_sync (path : Path ) -> Beatmap : ...
219+ async def read_beatmap_async (path : Path ) -> Beatmap :
220+ '''Read a beatmap async, returns Beatmap object (`Rust`)'''
221+ ...
222+
223+
224+ def read_beatmap_sync (path : Path ) -> Beatmap :
225+ '''Read a beatmap, returns Beatmap object (`Rust`)'''
226+ ...
0 commit comments