Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paths and regenerate files after recent changes #127

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Run black
run: |
black . --diff --extend-exclude cmake --check
black . --diff --extend-exclude=cmake --extend-exclude=submodules --extend-exclude=astrobee/survey_manager/survey_dependencies --check
- name: Run isort
run: |
isort . --diff --extend-skip cmake --profile black --check-only
isort . --diff --extend-skip=cmake --extend-skip=submodules --extend-skip=astrobee/survey_manager/survey_dependencies --profile=black --check-only
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Skipping folders of external code we shouldn't lint.)

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ goals:
- {type: panorama, robot: honey, order: 2, location: jem_bay6}
- {type: panorama, robot: honey, order: 3, location: jem_bay5}
# This is the other objective we previously had to comment out for POPF to return a decent plan.
- {type: stereo, robot: honey, order: 4, trajectory: jem_bay4_to_bay7}
- {type: stereo, robot: honey, order: 4, trajectory: jem_bay7_to_bay4}
- {type: robot_at, robot: honey, location: berth2}

init:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
action:
type: stereo
robot: honey
fplan: jem_stereo_mapping_bay4_to_bay7.fplan
fplan: ISAAC/jem_stereo_mapping_bay7_to_bay4
base_name: jem_bay7
bound_name: jem_bay4
duration_seconds: '600.000'
Expand All @@ -206,7 +206,7 @@
action:
type: stereo
robot: bumble
fplan: jem_stereo_mapping_bay1_to_bay3.fplan
fplan: ISAAC/jem_stereo_mapping_bay1_to_bay3
base_name: jem_bay1
bound_name: jem_bay4
duration_seconds: '600.000'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; Auto-generated by problem_generator.py. Do not edit!
;; Command was: ./tools/problem_generator.py
;; Working directory was: /home/vagrant/isaac/astrobee/survey_manager/survey_planner
;; Command was: ./tools/problem_generator
;; Working directory was: /home/vagrant/isaac/src/astrobee/survey_manager/survey_planner
;; Problem template: pddl/jem_survey_template.pddl
;; Config 1: data/survey_static.yaml
;; Config 2: data/jem_survey_dynamic.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set instance o1 order
set instance o2 order
set instance o3 order
set instance o4 order
set goal (and (completed-panorama bumble o0 jem_bay4) (completed-panorama bumble o1 jem_bay3) (completed-panorama bumble o2 jem_bay2) (completed-panorama bumble o3 jem_bay1) (completed-stereo bumble o4 jem_bay1 jem_bay4) (completed-panorama honey o0 jem_bay7) (completed-panorama honey o1 jem_bay6) (completed-panorama honey o2 jem_bay5) (robot-at honey berth2))
set goal (and (completed-panorama bumble o0 jem_bay4) (completed-panorama bumble o1 jem_bay3) (completed-panorama bumble o2 jem_bay2) (completed-panorama bumble o3 jem_bay1) (completed-stereo bumble o4 jem_bay1 jem_bay4) (robot-at bumble berth1) (completed-panorama honey o1 jem_bay7) (completed-panorama honey o2 jem_bay6) (completed-panorama honey o3 jem_bay5) (completed-stereo honey o4 jem_bay7 jem_bay4) (robot-at honey berth2))
set predicate (move-connected jem_bay0 jem_bay1)
set predicate (move-connected jem_bay1 jem_bay0)
set predicate (move-connected jem_bay1 jem_bay2)
Expand Down Expand Up @@ -130,6 +130,7 @@ set predicate (location-available jem_bay6)
set predicate (location-available jem_bay7)
set predicate (location-available jem_bay8)
set predicate (need-stereo bumble o4 jem_bay1 jem_bay4)
set predicate (need-stereo honey o4 jem_bay7 jem_bay4)
set function (= (order-identity o0) 0)
set function (= (order-identity o1) 1)
set function (= (order-identity o2) 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from matplotlib import collections as mc
from matplotlib import patches as mp
from matplotlib import pyplot as plt
from problem_generator import (
from survey_planner.problem_generator import (
DATA_DIR,
get_stereo_traj,
load_yaml,
Expand Down
14 changes: 10 additions & 4 deletions scripts/git/pre-commit.linter_python
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# Copyright (c) 2021, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
Expand Down Expand Up @@ -72,12 +72,18 @@ echo " Analysing python code style with 'isort'."
# could happen for example if the .isort.cfg src_paths list gets out
# of date.

if $(isort ${py_changed} --profile black --diff --check-only --quiet >/dev/null); then
isort_args=(
"--extend-skip=cmake"
"--extend-skip=submodules"
"--extend-skip=astrobee/survey_manager/survey_dependencies"
"--profile=black"
)
if $(isort . "${isort_args[@]}" --diff --check-only --quiet >/dev/null); then
echo "Linter checks using 'isort' passed."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's important to use . here as explained in the comment above and not restrict isort to looking at changed files. The --extend-skip stuff is to avoid linting external code.

Note this is following how it's done in the astrobee repo, except in my local testing I found that you need to use multiple --extend-skip arguments instead of a single arg with a comma-separated list.

else
echo "Errors detected with 'isort'. Fixing them. Try to add and commit your files again."
isort ${py_changed} --profile black >/dev/null
failed_lint=true
isort . "${isort_args[@]}" >/dev/null
failed_lint=true
fi

# Cancel commit if linter failed
Expand Down
Loading