From bad04d82da4346106c0b43099aef0519e979159b Mon Sep 17 00:00:00 2001 From: felipecode Date: Wed, 17 Jan 2018 14:06:29 +0100 Subject: [PATCH] Fixing some format issues --- PythonClient/carla/benchmarks/benchmark.py | 9 ++++----- PythonClient/carla/benchmarks/experiment.py | 3 +-- PythonClient/carla/planner/planner.py | 6 +++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/PythonClient/carla/benchmarks/benchmark.py b/PythonClient/carla/benchmarks/benchmark.py index b62dd2114..6696bcc62 100644 --- a/PythonClient/carla/benchmarks/benchmark.py +++ b/PythonClient/carla/benchmarks/benchmark.py @@ -7,7 +7,7 @@ # For a copy, see . -from builtins import input +from builtins import input_data import csv import datetime @@ -269,12 +269,11 @@ class Benchmark(object): # Make a date file: to show when this was modified, # the number of times the experiments were run now = datetime.datetime.now() - with open(os.path.join(full_name, - now.strftime("%Y%m%d%H%M")), 'w') as f: - pass + open(os.path.join(full_name, now.strftime("%Y%m%d%H%M"))).close() return suffix_name, full_name + def _continue_experiment(self, continue_experiment): if self._experiment_exist(): @@ -284,7 +283,7 @@ class Benchmark(object): else: # Ask question, to avoid mistaken override situations - answer = input("The experiment was already found in the files" + answer = input_data("The experiment was already found in the files" + ", Do you want to continue (y/n)? \n" ) if answer == 'Yes' or answer == 'y': diff --git a/PythonClient/carla/benchmarks/experiment.py b/PythonClient/carla/benchmarks/experiment.py index 4340d5599..8626dd797 100644 --- a/PythonClient/carla/benchmarks/experiment.py +++ b/PythonClient/carla/benchmarks/experiment.py @@ -1,11 +1,10 @@ from carla.settings import CarlaSettings -from carla.sensor import Camera class Experiment(object): - def __init__(self, **kwargs): + def __init__(self): self.Id = '' self.Conditions = CarlaSettings() self.Poses = [[]] diff --git a/PythonClient/carla/planner/planner.py b/PythonClient/carla/planner/planner.py index 45949503b..20f84f981 100644 --- a/PythonClient/carla/planner/planner.py +++ b/PythonClient/carla/planner/planner.py @@ -10,9 +10,9 @@ def compare(x, y): return collections.Counter(x) == collections.Counter(y) -""" -Constants Used for the high level commands -""" + +# Constants Used for the high level commands + REACH_GOAL = 0.0 GO_STRAIGHT = 5.0