Skip to content

Commit 4d3484c

Browse files
committed
bump
1 parent 1d79c36 commit 4d3484c

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

proj/environment/environment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def reset(self):
6868
self.model.reset()
6969

7070
# make goal trajetory
71-
trajectory, goal_duration = self.make_trajectory()
71+
(trajectory, goal_duration), trial = self.make_trajectory()
72+
self.trial = trial
7273

7374
self.goal_duration = goal_duration # how long it should take
7475

proj/environment/manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,14 @@ def _upload_to_dropbox(self):
149149

150150
upload_folder(dbx, self.datafolder, dpx_path)
151151

152+
def _save_trial(self):
153+
if self.trial is not None:
154+
self.trial.to_hdf(str(self.datafolder / "trial.h5"), key="hdf5")
155+
152156
def conclude(self):
153157
self._log_conf()
154158
self._save_results()
159+
self._save_trial()
155160

156161
if self.model.LIVE_PLOT:
157162
self._save_video()

proj/environment/trajectories.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def complete_given_xy(x, y, params, planning_params):
3131
ang_speed = np.ones_like(speed) # it will be ignored
3232

3333
trajectory = np.vstack([x, y, angle, speed, ang_speed]).T
34-
return compute_trajectory_stats(
35-
trajectory, len(trajectory), planning_params
34+
return (
35+
compute_trajectory_stats(trajectory, len(trajectory), planning_params),
36+
None,
3637
)
3738

3839

@@ -238,6 +239,9 @@ def from_tracking(n_steps, params, planning_params, cache_fld, *args):
238239
# stack
239240
trajectory = np.vstack(vars.values()).T
240241

241-
return compute_trajectory_stats(
242-
trajectory, len(x[start:]) / fps, planning_params
242+
return (
243+
compute_trajectory_stats(
244+
trajectory, len(x[start:]) / fps, planning_params
245+
),
246+
trials,
243247
)

proj/run/runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ def __init__(self, *args):
1818

1919
def render(self, task):
2020
if task.speed is None:
21-
return Text("no speed")
21+
return Text(" ")
2222
else:
2323
return Text(f"{task.speed:.3f} steps/s")
2424

2525

2626
progress = Progress(
2727
TextColumn("[bold magenta]Step {task.completed}/{task.total}"),
28+
"•",
2829
SpeedColumn(),
2930
# "[progress.description]{task.description}",
3031
BarColumn(bar_width=None),
@@ -36,7 +37,7 @@ def render(self, task):
3637

3738
# run
3839
def run_experiment(
39-
environment, controller, model, n_secs=30, frames_folder=None,
40+
environment, controller, model, n_secs=10, frames_folder=None,
4041
):
4142
"""
4243
Runs an experiment

0 commit comments

Comments
 (0)