mirror of
https://github.com/pim-n/pg-rad
synced 2026-03-11 19:58:11 +01:00
Improve PEP8 adherance using flake8 linter
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import math
|
||||
from typing import Self
|
||||
|
||||
|
||||
class BaseObject:
|
||||
def __init__(
|
||||
self,
|
||||
@ -16,18 +17,20 @@ class BaseObject:
|
||||
x (float): X coordinate.
|
||||
y (float): Y coordinate.
|
||||
z (float): Z coordinate.
|
||||
name (str, optional): Name for the object. Defaults to "Unnamed object".
|
||||
color (str, optional): Matplotlib compatible color string. Defaults to "red".
|
||||
name (str, optional): Name for the object.
|
||||
Defaults to "Unnamed object".
|
||||
color (str, optional): Matplotlib compatible color string.
|
||||
Defaults to "red".
|
||||
"""
|
||||
|
||||
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.z = z
|
||||
self.name = name
|
||||
self.color = color
|
||||
|
||||
|
||||
def distance_to(self, other: Self) -> float:
|
||||
return math.dist(
|
||||
(self.x, self.y, self.z),
|
||||
(other.x, other.y, other.z),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user