Skip to content

Commit

Permalink
Update pre-commit hooks to latest versions (#1197)
Browse files Browse the repository at this point in the history
* Update pre-commit hooks to latest versions

updates:
- [github.com/psf/black: 24.3.0 → 24.4.2](psf/black@24.3.0...24.4.2)
- [github.com/pre-commit/mirrors-clang-format: v18.1.2 → v18.1.4](pre-commit/mirrors-clang-format@v18.1.2...v18.1.4)
- [github.com/astral-sh/ruff-pre-commit: v0.3.4 → v0.4.3](astral-sh/ruff-pre-commit@v0.3.4...v0.4.3)
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix pre-commit changes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Cameron Brown <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and cbrxyz authored Jun 1, 2024
1 parent d7e6c1a commit 3c64f65
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ repos:
hooks:
- id: yamllint
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.2
rev: v18.1.4
hooks:
- id: clang-format
- repo: https://github.com/PyCQA/autoflake
Expand All @@ -40,7 +40,7 @@ repos:
exclude: ^docker|deprecated|NaviGator/simulation/VRX
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.3.4'
rev: 'v0.4.3'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down Expand Up @@ -73,7 +73,7 @@ repos:
- id: prettier-package-xml
- id: sort-package-xml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down
22 changes: 11 additions & 11 deletions NaviGator/utils/navigator_tools/nodes/navigator_status_tui
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ class nav_tui:
Variable value -> string literal formatting statements
"""

wrench_mode = "%s" % self.wrench
wrench_mode = str(self.wrench)

kill_name = "Alarm name: %s" % self.Alarm_name
kill_raised = "Raised: %s" % self.raised
kill_name = f"Alarm name: {self.Alarm_name}"
kill_raised = f"Raised: {self.raised}"

battery_voltage = "Voltage: %s" % self.voltage
battery_voltage = f"Voltage: {self.voltage}"

LLA_Lat = "Latitude: %s" % self.LAT
LLA_Lon = "Longitude: %s" % self.LON
LLA_Alt = "Altitude: %s" % self.ALT
LLA_Lat = f"Latitude: {self.LAT}"
LLA_Lon = f"Longitude: {self.LON}"
LLA_Alt = f"Altitude: {self.ALT}"

"""
Print(Statements for diagnostics)
Expand Down Expand Up @@ -218,7 +218,7 @@ class nav_tui:
self.window.addstr(
5 + n,
self.x / 2 - 7,
"%s" % fault,
str(fault),
curses.color_pair(1),
)

Expand All @@ -236,7 +236,7 @@ class nav_tui:
self.window.addstr(
15 + n,
self.x / 2 - 7,
"%s" % fault,
str(fault),
curses.color_pair(1),
)
n += 1
Expand All @@ -255,7 +255,7 @@ class nav_tui:
self.window.addstr(
5 + n,
self.x / 2 + 16,
"%s" % fault,
str(fault),
curses.color_pair(1),
)
n += 1
Expand All @@ -274,7 +274,7 @@ class nav_tui:
self.window.addstr(
15 + n,
self.x / 2 + 16,
"%s" % fault,
str(fault),
curses.color_pair(1),
)
n += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,12 @@ def shift(x, w):
# Evaluation

print()
print(
"Logistic regression using RBM features:\n%s\n"
% (metrics.classification_report(Y_test, classifier.predict(X_test))),
)
rep = metrics.classification_report(Y_test, logistic_classifier.predict(X_test))
print(f"Logistic regression using RBM features:\n{rep}\n")

rep = metrics.classification_report(Y_test, logistic_classifier.predict(X_test))
print(
"Logistic regression using raw pixel features:\n%s\n"
% (metrics.classification_report(Y_test, logistic_classifier.predict(X_test))),
f"Logistic regression using raw pixel features:\n{rep}\n",
)

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def ping_cb(self, msg) -> None:
vec = util.calculate_dir_pinger(deltas, self.dist_h, self.v_sound)
except Exception as e:
rospy.logwarn(
"/hydrophones/ping_locator could not calculate pinger direction %s" % e,
f"/hydrophones/ping_locator could not calculate pinger direction {e}",
)
return

Expand Down
7 changes: 3 additions & 4 deletions mil_common/drivers/mil_passive_sonar/scripts/triggering.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def hydrophones_cb(self, msg: Union[Ping, HydrophoneSamplesStamped]) -> None:
try:
freq = util.find_freq(ping_samples, self.rate)
except Exception as e:
rospy.logwarn("/hydrophone/triggering in find_freq %s" % e)
rospy.logwarn(f"/hydrophone/triggering in find_freq {e}")
freq = self.target
rospy.loginfo(f"triggered at {trigger_time:f} on {freq:f} Hz")

Expand Down Expand Up @@ -306,7 +306,7 @@ def hydrophones_cb(self, msg: Union[Ping, HydrophoneSamplesStamped]) -> None:
plot_data = data[:, 0]
titles = [
"time vs Gradient of Max convolve",
"time vs max_convolve (Window = %s sec)" % self.window_time,
f"time vs max_convolve (Window = {self.window_time} sec)",
"time vs hydrophone0 data",
]
vlines = [trigger_time, trigger_time, trigger_time_samples]
Expand All @@ -330,8 +330,7 @@ def hydrophones_cb(self, msg: Union[Ping, HydrophoneSamplesStamped]) -> None:

if spare_time < 0:
rospy.logwarn(
"Spare Time After Callback: %f, Running slower than real time"
% spare_time,
f"Spare Time After Callback: {spare_time}, Running slower than real time",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def run(
if template_pos is None:
errors.append("Failed to find template")
elif numpy.max(delta_errors) > 1e-3:
errors.append("High template match error (%s)" % str(delta_errors))
errors.append(f"High template match error ({delta_errors!s})")

return {
"errors": errors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def calculate_dir_pinger(deltas, h_dist, v_sound):
"""
if numpy.max(deltas) > h_dist / float(v_sound):
raise Exception(
"an impossible time delay was detected ( > %f)" % float(h_dist / v_sound),
f"an impossible time delay was detected ( > {float(h_dist / v_sound)})",
)
x = numpy.zeros((3,))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class PcdSubPubAlgorithm
typedef sensor_msgs::PointCloud2 PCD;

public:
PcdSubPubAlgorithm(){};
~PcdSubPubAlgorithm(){};
PcdSubPubAlgorithm() {};
~PcdSubPubAlgorithm() {};

protected:
virtual void cloud_cb(const PCD &cloud_msg) = 0; // runs algorithm pipeline when a msg is received
Expand Down

0 comments on commit 3c64f65

Please sign in to comment.