Skip to content

Commit 7717e3f

Browse files
committed
Merge branch 'cdeil-fix-docstrings' into development
2 parents 64546b7 + 8b846c5 commit 7717e3f

21 files changed

+47
-64
lines changed

arcade/application.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,9 +1388,9 @@ def on_mouse_drag(
13881388
Change in x since the last time this method was called
13891389
dy:
13901390
Change in y since the last time this method was called
1391-
buttons:
1391+
_buttons:
13921392
Which button is pressed
1393-
modifiers:
1393+
_modifiers:
13941394
Bitwise 'and' of all modifiers (shift, ctrl, num lock)
13951395
active during this event. See :ref:`keyboard_modifiers`.
13961396
"""
@@ -1493,9 +1493,9 @@ def on_key_release(self, _symbol: int, _modifiers: int) -> bool | None:
14931493
* Showing which keys are currently pressed down
14941494
14951495
Args:
1496-
symbol:
1496+
_symbol:
14971497
Key that was released
1498-
modifiers:
1498+
_modifiers:
14991499
Bitwise 'and' of all modifiers (shift, ctrl, num lock) active
15001500
during this event. See :ref:`keyboard_modifiers`.
15011501
"""

arcade/cache/hit_box.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ def get(self, name_or_texture: str | Texture) -> Point2List | None:
5959
points = cache.get("hash|(0, 1, 2, 3)|simple|")
6060
6161
Args:
62-
keys:
62+
name_or_texture:
6363
The texture or cache name to get the hit box for
64-
hit_box_algorithm:
65-
The hit box algorithm used
6664
"""
6765
from arcade import Texture
6866

@@ -85,7 +83,7 @@ def put(self, name_or_texture: str | Texture, points: Point2List) -> None:
8583
cache.put("my_custom_points", points)
8684
8785
Args:
88-
keys:
86+
name_or_texture:
8987
The texture or cache name to store the hit box for
9088
points:
9189
The hit box points

arcade/camera/camera_2d.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,14 @@ def match_window(
343343
Should be called when the window is resized.
344344
345345
Args:
346-
and_projection: Flag whether to also equalize the projection to the viewport.
346+
viewport: Flag whether to equalise the viewport to the value.
347+
projection: Flag whether to also equalize the projection to the viewport.
347348
On by default
348-
and_scissor: Flag whether to also equalize the scissor box to the viewport.
349+
scissor: Flag whether to also equalize the scissor box to the viewport.
349350
On by default
350-
and_position: Flag whether to also center the camera to the viewport.
351+
position: Flag whether to also center the camera to the viewport.
351352
Off by default
352-
aspect_ratio: The ratio between width and height that the viewport should
353+
aspect: The ratio between width and height that the viewport should
353354
be constrained to. If unset then the viewport just matches the window
354355
size. The aspect ratio describes how much larger the width should be
355356
compared to the height. i.e. for an aspect ratio of ``4:3`` you should
@@ -383,7 +384,7 @@ def match_target(
383384
scissor: Flag whether to update the scissor value.
384385
position: Flag whether to also center the camera to the value.
385386
Off by default
386-
aspect_ratio: The ratio between width and height that the value should
387+
aspect: The ratio between width and height that the value should
387388
be constrained to. i.e. for an aspect ratio of ``4:3`` you should
388389
input ``4.0/3.0`` or ``1.33333...``. Cannot be equal to zero.
389390
If unset then the value will not be updated.
@@ -425,7 +426,7 @@ def update_values(
425426
scissor: Flag whether to update the scissor value.
426427
position: Flag whether to also center the camera to the value.
427428
Off by default
428-
aspect_ratio: The ratio between width and height that the value should
429+
aspect: The ratio between width and height that the value should
429430
be constrained to. i.e. for an aspect ratio of ``4:3`` you should
430431
input ``4.0/3.0`` or ``1.33333...``. Cannot be equal to zero.
431432
If unset then the value will not be updated.

arcade/camera/data_types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,6 @@ def unproject(self, screen_coordinate: Point) -> Vec3:
450450
Args:
451451
screen_coordinate: A 2D position in pixels should generally be inside
452452
the range of the active viewport.
453-
depth: The depth of the query. This can be though of how far along the forward vector
454-
the final coord will be.
455453
Returns:
456454
A 3D vector in world space.
457455
"""

arcade/camera/default.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ViewportProjector:
2424
2525
Args:
2626
viewport: The viewport to project to.
27-
window: The window to bind the camera to. Defaults to the currently active window.
27+
context: The window context to bind the camera to. Defaults to the currently active window.
2828
"""
2929

3030
def __init__(
@@ -108,7 +108,7 @@ class DefaultProjector(ViewportProjector):
108108
no instance where a developer would want to use this class.
109109
110110
Args:
111-
window: The window to bind the camera to. Defaults to the currently active window.
111+
context: The window context to bind the camera to. Defaults to the currently active window.
112112
"""
113113

114114
def __init__(self, *, context: ArcadeContext | None = None):

arcade/camera/orthographic.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,9 @@ def unproject(self, screen_coordinate: Point) -> Vec3:
181181
Args:
182182
screen_coordinate: A 2D position in pixels from the bottom left of the screen.
183183
This should ALWAYS be in the range of 0.0 - screen size.
184-
depth: The depth of the query
185184
Returns:
186185
A 3D vector in world space.
187186
"""
188-
189187
_projection = generate_orthographic_matrix(self._projection, self._view.zoom)
190188
_view = generate_view_matrix(self._view)
191189
return unproject_orthographic(screen_coordinate, self.viewport.lbwh_int, _view, _projection)

arcade/draw/rect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ def draw_lbwh_rectangle_outline(
207207
Draw a rectangle extending from bottom left to top right
208208
209209
Args:
210-
bottom_left_x:
210+
left:
211211
The x coordinate of the left edge of the rectangle.
212-
bottom_left_y:
212+
bottom:
213213
The y coordinate of the bottom of the rectangle.
214214
width:
215215
The width of the rectangle.

arcade/future/light/lights.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ class LightLayer(RenderTargetTexture):
8787
The size of a layer should ideally be of the same size and the screen.
8888
8989
Args:
90-
size: Width and height of light layer
90+
width: Width of light layer
91+
height: Height of light layer
9192
"""
9293

9394
def __init__(self, width: int, height: int):

arcade/future/video/video_player.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,16 @@ def __init__(self, path: str | Path, loop: bool = False):
3737

3838
def draw(self, left: int = 0, bottom: int = 0, size: tuple[int, int] | None = None) -> None:
3939
"""
40-
Call this in `on_draw`.
40+
Draw the current video frame.
4141
4242
Args:
43-
size: Pass None as one of the elements if you want to use the
44-
dimension(width, height) attribute.
43+
left:
44+
Window position from the left.
45+
bottom:
46+
Window position from the bottom.
47+
size:
48+
The size of the video rectangle.
49+
If `None`, the video will be drawn in its original size.
4550
"""
4651
if size and len(size) == 2:
4752
self._width = size[0] or self.width

arcade/gl/framebuffer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,6 @@ def clear(
347347
A 3 or 4 component tuple containing the color in normalized form
348348
depth:
349349
Value to clear the depth buffer (unused)
350-
normalized:
351-
If the color values are normalized or not
352350
viewport:
353351
The viewport range to clear
354352
"""

arcade/gl/glsl.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class ShaderSource:
3232
Common source code to inject
3333
source_type:
3434
The shader type
35-
depth_attachment:
36-
A depth attachment (optional)
3735
"""
3836

3937
def __init__(

arcade/gui/surface.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ def draw(
229229
Args:
230230
area: Limit the area in the surface we're drawing
231231
(l, b, w, h)
232-
pixelated: If True, the texture will be rendered pixelated
233232
"""
234233
# Set blend function
235234
blend_func = self.ctx.blend_func

arcade/paths.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ class AStarBarrierList:
253253
Bottom of playing field
254254
top (int):
255255
Top of playing field
256-
barrier_list:
257-
SpriteList of barriers to use in _AStarSearch,
258-
``None`` if not recalculated
259256
260257
Attributes:
261258
grid_size:

arcade/sections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ def on_key_release(self, _symbol: int, _modifiers: int):
425425
Called when the user releases a key.
426426
427427
Args:
428-
symbol: the key released
429-
modifiers: the modifiers pressed
428+
_symbol: the key released
429+
_modifiers: the modifiers pressed
430430
"""
431431
pass
432432

arcade/shape_list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ def create_lines(
247247
Args:
248248
point_list: A list of points that make up the shape.
249249
color: A color such as a :py:class:`~arcade.types.Color`
250-
line_width: Width of the line
251250
"""
252251
return create_line_generic(point_list, color, gl.GL_LINES)
253252

arcade/sound.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def play_sound(
317317
try:
318318
return sound.play(volume, pan, loop, speed)
319319
except Exception as ex:
320-
logger.warn("Error playing sound.", ex)
320+
logger.warning("Error playing sound.", ex)
321321
return None
322322

323323

arcade/sprite/animated.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class TextureAnimation:
5252
Args:
5353
keyframes:
5454
List of keyframes for the animation.
55-
loop:
56-
If the animation should loop.
5755
"""
5856

5957
__slots__ = ("_keyframes", "_duration_ms", "_timeline")
@@ -358,7 +356,7 @@ def update_animation(self, delta_time: float = 1 / 60) -> None:
358356
self.texture = texture_list[self.cur_texture_index]
359357

360358
if self._texture is None:
361-
logger.warn("Error, no texture set")
359+
logger.warning("Error, no texture set")
362360
else:
363361
self.width = self._texture.width * self.scale_x
364362
self.height = self._texture.height * self.scale_x

arcade/texture/manager.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,16 @@ def load_or_get_spritesheet_texture(
133133
hit_box_algorithm: hitbox.HitBoxAlgorithm | None = None,
134134
) -> Texture:
135135
"""
136-
Slice out a a texture at x, y, width, height from a sprite sheet.
136+
Slice out a texture slice from a sprite sheet.
137137
138138
* If the spritesheet is not already loaded, it will be loaded and cached.
139139
* If the sliced texture is already cached, it will be returned instead.
140140
141141
Args:
142142
path:
143143
Path to the sprite sheet image
144-
x:
145-
X position of the texture in the sprite sheet
146-
y:
147-
Y position of the texture in the sprite sheet
148-
width:
149-
Width of the texture
150-
height:
151-
Height of the texture
144+
rect:
145+
Slice of the texture in the sprite sheet.
152146
hit_box_algorithm (optional):
153147
Hit box algorithm to use. If not specified, the global default will be used.
154148
"""
@@ -188,9 +182,6 @@ def load_or_get_image(
188182
Path of the file to load.
189183
hash:
190184
Optional override for image hash
191-
cache:
192-
If ``True``, the image will be cached. If ``False``, the
193-
image will not be cached or returned from the cache.
194185
mode:
195186
The mode to use for the image. Default is "RGBA".
196187
"""
@@ -223,7 +214,7 @@ def load_or_get_texture(
223214
entire image is loaded.
224215
225216
Args:
226-
file_name:
217+
file_path:
227218
Path to the image file.
228219
x (optional):
229220
X coordinate of the texture in the image.

arcade/texture_atlas/atlas_default.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def get_texture_id(self, texture: "Texture") -> int:
605605
Get the internal id for a Texture in the atlas
606606
607607
Args:
608-
atlas_name: The name of the texture in the atlas
608+
texture: The texture to get.
609609
"""
610610
return self._texture_uvs.get_slot_or_raise(texture.atlas_name)
611611

@@ -883,7 +883,7 @@ def to_image(
883883
Number of components. (3 = RGB, 4 = RGBA)
884884
draw_borders:
885885
Draw region borders into image
886-
color:
886+
border_color:
887887
RGB color of the borders
888888
Returns:
889889
A pillow image containing the atlas texture
@@ -931,7 +931,7 @@ def show(
931931
Number of components. (3 = RGB, 4 = RGBA)
932932
draw_borders:
933933
Draw region borders into image
934-
color:
934+
border_color:
935935
RGB color of the borders
936936
"""
937937
self.to_image(
@@ -962,7 +962,9 @@ def save(
962962
Flip the image horizontally
963963
components:
964964
Number of components. (3 = RGB, 4 = RGBA)
965-
color:
965+
draw_borders:
966+
Draw region borders into image
967+
border_color:
966968
RGB color of the borders
967969
"""
968970
self.to_image(

arcade/texture_atlas/base.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def get_texture_id(self, texture: Texture) -> int:
207207
Get the internal id for a Texture in the atlas
208208
209209
Args:
210-
atlas_name: The name of the texture in the atlas
210+
texture: The texture to get
211211
"""
212212
...
213213

@@ -364,7 +364,7 @@ def to_image(
364364
Number of components. (3 = RGB, 4 = RGBA)
365365
draw_borders:
366366
Draw region borders into image
367-
color:
367+
border_color:
368368
RGB color of the borders
369369
Returns:
370370
A pillow image containing the atlas texture
@@ -392,7 +392,7 @@ def show(
392392
Number of components. (3 = RGB, 4 = RGBA)
393393
draw_borders:
394394
Draw region borders into image
395-
color:
395+
border_color:
396396
RGB color of the borders
397397
"""
398398
self.to_image(
@@ -425,7 +425,9 @@ def save(
425425
Flip the image horizontally
426426
components:
427427
Number of components. (3 = RGB, 4 = RGBA)
428-
color:
428+
draw_borders:
429+
Draw region borders into image
430+
border_color:
429431
RGB color of the borders
430432
"""
431433

arcade/texture_atlas/region.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class AtlasRegion:
4040
Args:
4141
atlas:
4242
The atlas this region belongs to
43-
texture:
44-
The Arcade texture
4543
x:
4644
The x position of the texture
4745
y:

0 commit comments

Comments
 (0)