Skip to content

Commit

Permalink
Fix paths and regenerate files after recent changes (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
trey0 authored Jan 26, 2024
1 parent 8b42ef1 commit 7d7852b
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 15 deletions.
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
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# folder, you can auto-update it by running
# scripts/git/configure_isort_paths.sh.

src_paths = analyst/workspace/scripts,anomaly/gmm-change-detection,anomaly/gmm-change-detection/scripts/gmm,anomaly/image/scripts,astrobee/behaviors/inspection/scripts,astrobee/simulation/acoustics_cam/src,astrobee/survey_manager/survey_planner/tools,dense_map/geometry_mapper/tools,dense_map/volumetric_mapper/scripts,pano/pano_stitch/scripts,pano/pano_view/scripts,scripts/git
src_paths = analyst/workspace/scripts,anomaly/gmm-change-detection,anomaly/gmm-change-detection/scripts/gmm,anomaly/image/scripts,astrobee/behaviors/inspection/scripts,astrobee/simulation/acoustics_cam/src,astrobee/survey_manager/survey_planner,astrobee/survey_manager/survey_planner/scripts,astrobee/survey_manager/survey_planner/src/survey_planner,astrobee/survey_manager/survey_planner/tools/bak,communications/isaac_msgs/isaac_msgs/test,dense_map/geometry_mapper/tools,dense_map/volumetric_mapper/scripts,pano/pano_stitch/scripts,pano/pano_view/scripts,scripts/git
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,8 @@
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import pyparsing as pp
import yaml

from survey_planner.problem_generator import PDDL_DIR

LocationName = str # Names PDDL object of type location
Expand Down
10 changes: 9 additions & 1 deletion scripts/git/configure_isort_paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ srcdir=$(cd $thisdir/../.. && pwd)
cd $srcdir

# Generate a comma-separated list of folders containing *.py files
pydirs=$(find . -name "*.py" -print0 | xargs -0 dirname | cut -c3- | sort | uniq | paste -sd "," -)
pydirs=$( \
find . -name "*.py" -print0 \
| xargs -0 dirname \
| cut -c3- \
| grep -Pv "^cmake|^submodules|^astrobee/survey_manager/survey_dependencies|^scripts/setup/dependencies" \
| sort \
| uniq \
| paste -sd "," - \
)

# Overwrite the src_paths line in the config file to use the list
perl -i -ple "if (/^src_paths = /) { \$_ = 'src_paths = $pydirs'; }" .isort.cfg
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."
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

0 comments on commit 7d7852b

Please sign in to comment.