Skip to content

Commit

Permalink
Mahony: Increase indentation of __init__ parameters, and add types of…
Browse files Browse the repository at this point in the history
… return values of private methods.
  • Loading branch information
Mayitzin committed Jan 23, 2025
1 parent c31268d commit fdc5575
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ahrs/filters/mahony.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,15 @@ class Mahony:
"""
def __init__(self,
gyr: np.ndarray = None,
acc: np.ndarray = None,
mag: np.ndarray = None,
frequency: float = 100.0,
k_P: float = 1.0,
k_I: float = 0.3,
q0: np.ndarray = None,
b0: np.ndarray = None,
**kwargs):
gyr: np.ndarray = None,
acc: np.ndarray = None,
mag: np.ndarray = None,
frequency: float = 100.0,
k_P: float = 1.0,
k_I: float = 0.3,
q0: np.ndarray = None,
b0: np.ndarray = None,
**kwargs) -> None:
self.gyr: np.ndarray = gyr
self.acc: np.ndarray = acc
self.mag: np.ndarray = mag
Expand All @@ -403,7 +403,7 @@ def __init__(self,
if self.gyr is not None and self.acc is not None:
self.Q = self._compute_all()

def _assert_validity_of_inputs(self):
def _assert_validity_of_inputs(self) -> None:
"""Asserts the validity of the inputs."""
for item in ["frequency", "Dt", "k_P", "k_I"]:
if isinstance(self.__getattribute__(item), bool):
Expand All @@ -430,7 +430,7 @@ def _assert_validity_of_inputs(self):
if self.b.shape != (3,):
raise ValueError("Parameter 'b' must be an array with 3 elements.")

def _compute_all(self):
def _compute_all(self) -> np.ndarray:
"""
Estimate the quaternions given all data
Expand Down

0 comments on commit fdc5575

Please sign in to comment.