Skip to content

Commit 37db7da

Browse files
committed
small improvs
1 parent fcb8e46 commit 37db7da

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

proj/environment/environment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ def plan(self, curr_x, g_traj, itern):
101101

102102
end = min_idx + n_ahead + pred_len
103103

104-
if (min_idx + n_ahead + pred_len) > len(g_traj):
105-
end = len(g_traj)
104+
if start + pred_len > len(g_traj):
105+
end = len(g_traj) - 2
106106

107-
if abs(start - end) != pred_len:
108-
return np.tile(g_traj[-1], (pred_len, 1))
107+
# if abs(start - end) != pred_len:
108+
# return np.tile(g_traj[-1], (pred_len, 1))
109109

110110
return g_traj[start:end]
111111

proj/run/runner.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,26 @@
66
)
77
import numpy as np
88
from rich import print
9+
from rich.text import Text
910
import logging
1011

11-
# define progress bar
12+
13+
class SpeedColumn(TextColumn):
14+
_renderable_cache = {}
15+
16+
def __init__(self, *args):
17+
pass
18+
19+
def render(self, task):
20+
if task.speed is None:
21+
return Text("no speed")
22+
else:
23+
return Text(f"{task.speed:.3f} steps/s")
24+
25+
1226
progress = Progress(
13-
TextColumn(
14-
"[bold magenta]Step {task.completed}/{task.total} - {task.speed} steps/s"
15-
),
27+
TextColumn("[bold magenta]Step {task.completed}/{task.total}"),
28+
SpeedColumn(),
1629
# "[progress.description]{task.description}",
1730
BarColumn(bar_width=None),
1831
"•",

run_allocentric.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
# from proj.plotting.trajectories import plot_trajectory
1111

12-
# TODO get trials from M4 catwalk and M6 catwalk only.
13-
# TODO trajectory: get moved awaay from start location as start frame
14-
# TODO find metrics to say if it was good/bad?
1512

1613
# model = ModelPolar()
1714
model = Model()

0 commit comments

Comments
 (0)