Skip to content

Commit

Permalink
Fix output formatting regression caused by dataclass, minor type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
trey0 committed Jan 17, 2024
1 parent 034846a commit 8b89fa3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions astrobee/survey_manager/survey_planner/tools/survey_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ def get_dump_dict(self) -> Dict[str, Any]:
return {"pos": self.pos, "action": repr(self.action), "reserved": self.reserved}


class PriorityQueue(Generic[T], Iterable[T]):
class PriorityQueue(Generic[T]):
"Priority queue implemented as a list that maintains the heap invariant."

def __init__(self, seq: Iterable[T] = None):
def __init__(self, seq: Optional[Iterable[T]] = None):
":param seq: Initial contents of the queue (need not be ordered)."
if seq is None:
self._q: List[T] = []
Expand All @@ -256,7 +256,7 @@ def __init__(self, seq: Iterable[T] = None):
heapq.heapify(self._q)

def __iter__(self) -> Iterator[T]:
"Iterate through the queue in order non-destructively. (Not very efficient.)"
"Iterate through the queue in order non-destructively. (Not optimized, for debugging.)"
return iter(sorted(self._q))

def __bool__(self) -> bool:
Expand Down Expand Up @@ -316,7 +316,7 @@ def warp(self) -> None:
event_func(self)


@dataclass
@dataclass(repr=False)
class MarkCompleteAction(Action):
"""
Represents an action that explicitly marks itself complete when it finishes executing.
Expand Down Expand Up @@ -373,7 +373,7 @@ def get_collision_reason(
return "" # ok


@dataclass
@dataclass(repr=False)
class AbstractMoveAction(Action):
"Represents a single-step move action."

Expand Down Expand Up @@ -478,7 +478,7 @@ def invalid_reason(self, sim_state: SimState) -> str:
return "" # ok


@dataclass
@dataclass(repr=False)
class PanoramaAction(MarkCompleteAction):
"Represents a panorama action."

Expand All @@ -495,7 +495,7 @@ def invalid_reason(self, sim_state: SimState) -> str:
return "" # ok


@dataclass
@dataclass(repr=False)
class StereoAction(MarkCompleteAction):
"Represents a stereo survey action."

Expand Down

0 comments on commit 8b89fa3

Please sign in to comment.