Skip to content

Commit f2af200

Browse files
author
PhySimdev
committed
docs: ajusted docstrings
1 parent 5bce725 commit f2af200

File tree

1 file changed

+0
-108
lines changed

1 file changed

+0
-108
lines changed

main.py

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ def getter(self, widget):
191191
widget: A tkinter widget that will be scanned. Preferably the
192192
turtle canvas.
193193
"""
194-
195194
x = self.window.winfo_rootx() + widget.winfo_x()
196195
y = self.window.winfo_rooty() + widget.winfo_y()
197196
x1 = x + widget.winfo_width()
@@ -200,16 +199,6 @@ def getter(self, widget):
200199
image.save(f"{self.image_folder}/frame_{self.frame_count}.gif")
201200

202201
def switch_focus(self, event, direction):
203-
"""Switch of focus between bodies.
204-
205-
Tkinter event which is called by the arrow keys.
206-
207-
Args:
208-
event: Mandatory tkinter event argument.
209-
direction: A string, either left or right, wich shows wich
210-
next body is selected.
211-
"""
212-
213202
if direction == "left":
214203
self.solar_system.switch_focus("previous")
215204
elif direction == "right":
@@ -230,16 +219,6 @@ def toggle_pause(self):
230219
self.pause_button.config(text="pause")
231220

232221
def mouse_off(self, event, button):
233-
"""Event to determine mouse release of different buttons.
234-
235-
Tkinter event which is called by the arrow keys.
236-
Sets mouse_click arguments for specific buttons to False,
237-
thus ending the specific mouse button movement.
238-
239-
Args:
240-
event: Mandatory tkinter event argument.
241-
button: Strings of either b1, b2 or b3 to determine the button.
242-
"""
243222
if button == "b1":
244223
self.mouse_click1 = False
245224
elif button == "b2":
@@ -248,16 +227,6 @@ def mouse_off(self, event, button):
248227
self.mouse_click3 = False
249228

250229
def change_fov(self, event):
251-
"""Event to change the FOV.
252-
253-
Tkinter event which is called by the middle mouse button.
254-
Activates the specific mouse click initiating the mouse movement and
255-
adds mouse change of position to the FOV value.
256-
257-
Args:
258-
event: Mandatory tkinter event argument. Used to determine
259-
mouse movement.
260-
"""
261230
if not self.mouse_click2:
262231
self.old_y = event.y
263232
self.mouse_click2 = True
@@ -271,16 +240,6 @@ def change_fov(self, event):
271240
self.FOV = self.fov_range[1]
272241

273242
def rotation(self, event):
274-
"""Event to change the rotation.
275-
276-
Tkinter event which is called by the right mouse button.
277-
Activates the specific mouse click initiating the mouse movement and
278-
adds mouse change of position to the x and y rotation.
279-
280-
Args:
281-
event: Mandatory tkinter event argument. Used to determine
282-
mouse movement.
283-
"""
284243
if not self.mouse_click3:
285244
self.old_x = event.x
286245
self.old_y = event.y
@@ -297,16 +256,6 @@ def rotation(self, event):
297256
self.y_rotation = self.y_rot_range[1]
298257

299258
def offset(self, event):
300-
"""Event to change the x/y offset.
301-
302-
Tkinter event which is called by the left mouse button.
303-
Activates the specific mouse click initiating the mouse movement and
304-
adds mouse change of position to the x and y position.
305-
306-
Args:
307-
event: Mandatory tkinter event argument. Used to determine
308-
mouse movement.
309-
"""
310259
if not self.mouse_click1:
311260
self.old_x = event.x
312261
self.old_y = event.y
@@ -318,15 +267,6 @@ def offset(self, event):
318267
self.old_y = event.y
319268

320269
def mouse_scroll(self, event):
321-
"""Event to change the distance.
322-
323-
Tkinter event which is called by the scroll wheel.
324-
Determines distance and therfore size of the object on the screen.
325-
326-
Args:
327-
event: Mandatory tkinter event argument. Used to get the
328-
scroll distance to determine the change in distance.
329-
"""
330270
self.distance -= (event.delta) * self.distance / 1000
331271
if self.distance < 0:
332272
self.distance = 0
@@ -429,12 +369,6 @@ def draw_time(self, time):
429369
self.data_pointer.write(text, align="left", font=self.font)
430370

431371
def reset(self):
432-
"""Method that reset 3d view variables.
433-
434-
Resets transformation, distance and rotation variables to
435-
predetermined values. Determines distance and therfore size of
436-
the object on the screen.
437-
"""
438372
self.FOV = self.fov_range[2]
439373
self.distance = self.default_dist
440374
self.x_offset = 0
@@ -601,30 +535,11 @@ def draw_rot_cube(self):
601535
self.pointer.write(coord[i], align="center", font=self.font)
602536

603537
def draw_cm(self, cm_pos):
604-
"""Method that draws the center of mass.
605-
606-
Method that draws the center of mass of the simulation.
607-
608-
Args:
609-
cm_pos: Position of the center of mass.
610-
"""
611538
pos, f = self.get_screen_xy(*cm_pos)
612539
if pos is not None:
613540
self.draw_circle(self.pointer, pos, self.cm_rad, self.cm_color, self.cm_color)
614541

615542
def draw_circle(self, pointer, pos, rad, pencolor, fillcolor):
616-
"""Method that draws circles.
617-
618-
Method that draws a circle for the system bodies and the
619-
center of mass. It uses turtle.circle.
620-
621-
Args:
622-
pointer: Turtle pointer that draws the turtle.
623-
pos: Position of the circle.
624-
rad: Radius of the circle.
625-
pencolor: Color of the circle outline.
626-
fillcolor: Color of the circle.
627-
"""
628543
pointer.goto(pos)
629544
pointer.fd(rad)
630545
pointer.left(90)
@@ -637,18 +552,6 @@ def draw_circle(self, pointer, pos, rad, pencolor, fillcolor):
637552
pointer.up()
638553

639554
def get_size_factor(self, body_type):
640-
"""Method that gets a size factor.
641-
642-
Method that gets the size factor of simulation body. Used to
643-
scale the body and make it more visible in the simulation.
644-
645-
Args:
646-
body_type: Type of simulation body.
647-
648-
Returns:
649-
Either returns size factor of a certain body or 1 if
650-
the body is not known.
651-
"""
652555
if body_type is Sun:
653556
return self.star_size_factor
654557
elif body_type is Planet:
@@ -852,17 +755,6 @@ def update_program(self):
852755

853756

854757
def ConvertSectoDay(n):
855-
"""Method that transforms a 3d point into 2d point.
856-
857-
Method that converts an amount of seconds into a number of years,
858-
months, days, hours and seconds.
859-
860-
Args:
861-
n: Amount of seconds.
862-
863-
Returns:
864-
Tuple of years, days, hours, minutes and seconds.
865-
"""
866758
year = n // (365 * 24 * 3600)
867759
n %= (365 * 24 * 3600)
868760
day = n // (24 * 3600)

0 commit comments

Comments
 (0)