Skip to content

Commit

Permalink
🔧 ci(pre-commit): autoupdated pre-commit configs and applied formatti…
Browse files Browse the repository at this point in the history
…ng changes (#505)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.8.0](astral-sh/ruff-pre-commit@v0.7.4...v0.8.0)
- [github.com/pre-commit/mirrors-clang-format: v19.1.3 → v19.1.4](pre-commit/mirrors-clang-format@v19.1.3...v19.1.4)

* 🔥 ci(pre-commit): removed old workflows

* ♻️ refactor(auv_gui): applied pydocstyle and update type annotations

* ♻️ ci(workflows): replaced source build with industrial ci

* 🔧 ci(pre-commit): set autoupdate_schedule to quarterly

* ♻️ ci(workflows): updated workflow name for indusrial-ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Kluge Svendsrud <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and kluge7 authored Nov 26, 2024
1 parent a67773e commit 41ab2df
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 56 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/ci-pre-commit.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/industrial-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Industrial CI

on:
push:
workflow_dispatch:
schedule:
- cron: '0 1 * * *' # Runs daily to check for dependency issues or flaking tests
jobs:
call_reusable_workflow:
uses: vortexntnu/vortex-ci/.github/workflows/reusable-industrial-ci.yml@main
with:
upstream_workspace: './ros2.repos'
16 changes: 0 additions & 16 deletions .github/workflows/source-build.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/update-pre-commit.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
- id: requirements-txt-fixer
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.0
hooks:
- id: ruff-format
- id: ruff
Expand Down Expand Up @@ -70,7 +70,7 @@ repos:
pass_filenames: true
# C++ hooks
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.3
rev: v19.1.4
hooks:
- id: clang-format
args: [--style=file]
Expand All @@ -80,3 +80,6 @@ repos:
hooks:
- id: codespell
args: ['--write-changes', '--ignore-words-list=theses']

ci:
autoupdate_schedule: quarterly
28 changes: 14 additions & 14 deletions mission/gui_auv/auv_gui/auv_gui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import sys
from threading import Thread
from typing import List, Optional
from typing import Optional

import matplotlib.pyplot as plt
import numpy as np
Expand All @@ -25,7 +25,7 @@
# --- Quaternion to Euler angles ---


def quaternion_to_euler(x: float, y: float, z: float, w: float) -> List[float]:
def quaternion_to_euler(x: float, y: float, z: float, w: float) -> list[float]:
"""Convert a quaternion to Euler angles (roll, pitch, yaw).
Args:
Expand Down Expand Up @@ -92,14 +92,14 @@ def __init__(self) -> None:
)

# Variables to store odometry data
self.xpos_data: List[float] = [] # x position
self.ypos_data: List[float] = [] # y position
self.zpos_data: List[float] = [] # z position
self.xpos_data: list[float] = [] # x position
self.ypos_data: list[float] = [] # y position
self.zpos_data: list[float] = [] # z position

self.w_data: List[float] = [] # w component of the quaternion
self.x_data: List[float] = [] # x component of the quaternion
self.y_data: List[float] = [] # y component of the quaternion
self.z_data: List[float] = [] # z component of the quaternion
self.w_data: list[float] = [] # w component of the quaternion
self.x_data: list[float] = [] # x component of the quaternion
self.y_data: list[float] = [] # y component of the quaternion
self.z_data: list[float] = [] # z component of the quaternion

self.roll: Optional[float] = None
self.pitch: Optional[float] = None
Expand Down Expand Up @@ -196,13 +196,13 @@ def __init__(self, gui_node: GuiNode, parent: Optional[QWidget] = None) -> None:
self.ax.set_title("Position")

# Initialize data lists for 3D plot
self.x_data: List[float] = []
self.y_data: List[float] = []
self.z_data: List[float] = []
self.x_data: list[float] = []
self.y_data: list[float] = []
self.z_data: list[float] = []
(self.line,) = self.ax.plot([], [], [], 'b-')

def update_plot(
self, x_data: List[float], y_data: List[float], z_data: List[float]
self, x_data: list[float], y_data: list[float], z_data: list[float]
) -> None:
"""Update the 3D plot with the latest odometry data."""
# Convert lists to numpy arrays to ensure compatibility with the plot functions
Expand Down Expand Up @@ -238,7 +238,7 @@ def run_ros_node(ros_node: GuiNode, executor: MultiThreadedExecutor) -> None:
rclpy.spin(ros_node, executor)


def main(args: Optional[List[str]] = None) -> None:
def main(args: Optional[list[str]] = None) -> None:
"""The main function to initialize ROS2 and the GUI application."""
rclpy.init(args=args)
ros_node = GuiNode()
Expand Down

0 comments on commit 41ab2df

Please sign in to comment.