Skip to content

Commit

Permalink
not showing animation when generating a video with the simulator, upd…
Browse files Browse the repository at this point in the history
…ate leaderboard script parameters
  • Loading branch information
fwiebe committed Jan 11, 2024
1 parent a2127f4 commit 8a4b7b6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
Empty file removed leaderboard/data/.gitkeep
Empty file.
18 changes: 14 additions & 4 deletions leaderboard/robustness/compute_leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@
default="data",
required=False,
)
parser.add_argument(
"--save_to",
dest="save_to",
help="Path for saving the leaderbaord csv file.",
default="leaderboard.csv",
required=False,
)
parser.add_argument(
"--force-recompute",
dest="recompute",
help="Whether to force the recomputation of the leaderboard even without new data.",
default=False,
required=False,
type=bool,
type=int,
)

parser.add_argument(
"--link-base",
dest="link",
Expand All @@ -34,9 +40,13 @@
)

data_dir = parser.parse_args().data_dir
recompute_leaderboard = parser.parse_args().recompute
save_to = parser.parse_args().save_to
recompute_leaderboard = bool(parser.parse_args().recompute)
link_base = parser.parse_args().link

if not os.path.exists(save_to):
recompute_leaderboard = True

if not os.path.exists(data_dir):
os.makedirs(data_dir)

Expand All @@ -56,7 +66,7 @@

if recompute_leaderboard:
src_dir = "."
save_to = os.path.join(data_dir, "leaderboard.csv")
# save_to = os.path.join(data_dir, "leaderboard.csv")

leaderboard_data = []

Expand Down
18 changes: 14 additions & 4 deletions leaderboard/simulation/compute_leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@
default="data",
required=False,
)
parser.add_argument(
"--save_to",
dest="save_to",
help="Path for saving the leaderbaord csv file.",
default="leaderboard.csv",
required=False,
)
parser.add_argument(
"--force-recompute",
dest="recompute",
help="Whether to force the recomputation of the leaderboard even without new data.",
default=False,
required=False,
type=bool,
type=int,
)
parser.add_argument(
"--link-base",
Expand All @@ -33,9 +40,13 @@
)

data_dir = parser.parse_args().data_dir
recompute_leaderboard = parser.parse_args().recompute
save_to = parser.parse_args().save_to
recompute_leaderboard = bool(parser.parse_args().recompute)
link_base = parser.parse_args().link

if not os.path.exists(save_to):
recompute_leaderboard = True

data_paths = {}

for f in os.listdir("."):
Expand All @@ -59,8 +70,7 @@
)
data_paths[mod.leaderboard_config["name"]] = conf


save_to = f"{data_dir}/leaderboard.csv"
# save_to = f"{data_dir}/leaderboard.csv"

if recompute_leaderboard:
leaderboard_scores(
Expand Down
3 changes: 2 additions & 1 deletion software/python/simple_pendulum/simulation/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ def simulate_and_animate(
writer = Writer(fps=60, bitrate=18000)
self.animation.save(video_name, writer=writer)
print("Saving video done.")
plt.show()
else:
plt.show()

# self.data_dict = cut_trajectory(self.data_dict, "meas_time")

Expand Down

0 comments on commit 8a4b7b6

Please sign in to comment.