Skip to content

Commit

Permalink
Fix pylint errors (C0303, E0401, C0115, C0116 and R0903) in contingen…
Browse files Browse the repository at this point in the history
…cy_actions.py
  • Loading branch information
suriyaa authored Jun 20, 2024
1 parent e2ebba1 commit 598b8f2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/monitoring/contingency_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,34 @@
Copyright (c) 2024 Elara Aerospace team
"""

# pylint: disable=too-few-public-methods

from rocket_systems.actuators import ActuatorModule
from rocket_systems.communications import CommunicationsModule

class ContingencyActions:
"""
A class used to execute contingency actions based on detected anomalies.
"""

def __init__(self):
"""
Initializes the ContingencyActions with instances of ActuatorModule
and CommunicationsModule.
"""
self.actuator = ActuatorModule()
self.communications = CommunicationsModule()

def execute(self, anomalies):
"""
Executes the appropriate actions based on the detected anomalies.
"""
if 'temperature' in anomalies:
self.communications.send_data(f"High temperature detected: {anomalies['temperature']}")

if 'pressure' in anomalies:
self.communications.send_data(f"Abnormal pressure detected: {anomalies['pressure']}")

if 'altitude' in anomalies:
self.communications.send_data(f"Abnormal altitude detected: {anomalies['altitude']}")
self.actuator.activate_parachute()

0 comments on commit 598b8f2

Please sign in to comment.