Skip to content

Commit 02eb012

Browse files
committed
Right black version
1 parent 0e32228 commit 02eb012

25 files changed

+11
-64
lines changed

ai2thor/benchmarking.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ def __create_experiments(self):
451451
return experiment_list
452452

453453
def benchmark(self, action_map={}):
454-
455454
env, controller_params = self.__init_env()
456455
experiment_list = self.__create_experiments()
457456
hostname = ""

ai2thor/build.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def base_dir(self):
109109

110110
class Build(object):
111111
def __init__(self, platform, commit_id, include_private_scenes, releases_dir=None):
112-
113112
if type(platform) is str:
114113
if platform in STR_PLATFORM_MAP:
115114
platform = STR_PLATFORM_MAP[platform]
@@ -126,7 +125,6 @@ def __init__(self, platform, commit_id, include_private_scenes, releases_dir=Non
126125
self.tmp_dir = os.path.normpath(self.releases_dir + "/../tmp")
127126

128127
def download(self):
129-
130128
makedirs(self.releases_dir)
131129
makedirs(self.tmp_dir)
132130

ai2thor/docker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def nvidia_version():
7777

7878

7979
def generate_dockerfile(tag):
80-
8180
driver_url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/{version}/NVIDIA-Linux-x86_64-{version}.run".format(
8281
version=nvidia_version()
8382
)
@@ -127,7 +126,6 @@ def kill_container(container_id):
127126

128127

129128
def build_image():
130-
131129
version = nvidia_version()
132130
image_name = "ai2thor/ai2thor-nvidia-%s:%s" % (version, COMMIT_ID)
133131

ai2thor/downloader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
def download(url, sha256_digest, include_private_scenes=False):
12-
1312
auth = None
1413
if include_private_scenes:
1514
auth = ai2thor.build.boto_auth()

ai2thor/hooks/metadata_hook.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010

1111

1212
class MetadataHook(Protocol):
13-
def __call__(self, metadata: Dict[str, Any], controller: "Controller"): ...
13+
def __call__(self, metadata: Dict[str, Any], controller: "Controller"):
14+
...

ai2thor/interact.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def interact(
9191
color_frame=False,
9292
metadata=False,
9393
):
94-
9594
if not sys.stdout.isatty():
9695
raise RuntimeError("controller.interact() must be run from a terminal")
9796

@@ -198,7 +197,6 @@ def add_command(cc, action, **args):
198197
print(" ".join(command_info))
199198

200199
def next_interact_command(self):
201-
202200
current_buffer = ""
203201
while True:
204202
commands = self._interact_commands

ai2thor/offline_controller.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
class Controller(object):
2020
def __init__(self, base_dir, grid_size=0.25):
21-
2221
self.grid_size = grid_size
2322
self.base_dir = base_dir
2423
if grid_size < 0.25:
@@ -153,7 +152,6 @@ def inc(self):
153152

154153

155154
def write_frame(event, base_dir, scene_name, frame_name):
156-
157155
events_dir = "%s/%s/events" % (base_dir, scene_name)
158156
met_dir = "%s/%s/metadata" % (base_dir, scene_name)
159157
os.makedirs(met_dir, exist_ok=True)
@@ -167,7 +165,6 @@ def write_frame(event, base_dir, scene_name, frame_name):
167165

168166

169167
def look_up_down_write(controller, base_dir, fc, scene_name):
170-
171168
fc.inc()
172169
write_frame(controller.step(action="LookUp"), base_dir, scene_name, fc.counter)
173170
fc.inc()

ai2thor/platform.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def __init__(self, system, width, height, x_display, headless):
1616

1717

1818
class BasePlatform:
19-
2019
enabled = True
2120

2221
@classmethod
@@ -65,7 +64,6 @@ def dependency_instructions(cls, request):
6564

6665
@classmethod
6766
def _select_x_display(cls, width, height):
68-
6967
valid_displays = cls._valid_x_displays(width, height)
7068
if valid_displays:
7169
return valid_displays[0]
@@ -173,7 +171,6 @@ def executable_path(cls, base_dir, name):
173171

174172
@classmethod
175173
def parse_plist(cls, base_dir, name):
176-
177174
plist_path = os.path.join(base_dir, name + ".app", "Contents/Info.plist")
178175

179176
with open(plist_path) as f:

ai2thor/robot_controller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def reset(self, scene_name=None):
8383
return self.last_event
8484

8585
def step(self, action=None, **action_args):
86-
8786
if type(action) is dict:
8887
action = copy.deepcopy(action) # prevent changes from leaking
8988
else:

ai2thor/server.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ def default(self, obj):
2828

2929

3030
class LazyMask(Mapping):
31-
3231
def __contains__(self, key: object) -> bool:
3332
return self.mask(cast(str, key)) is not None
3433

3534
def __getitem__(self, key: str):
36-
3735
m = self.mask(key)
3836

3937
if m is None:
@@ -59,7 +57,6 @@ def __len__(self):
5957

6058

6159
class LazyInstanceSegmentationMasks(LazyMask):
62-
6360
def __init__(self, image_ids_data: bytes, metadata: dict):
6461
self._masks: Dict[str, np.ndarray] = {}
6562
self._loaded = False
@@ -213,7 +210,6 @@ def mask(self, key: str, default: Optional[np.ndarray] = None) -> Optional[np.nd
213210

214211
class LazyDetections2D(Mapping):
215212
def __init__(self, instance_masks: LazyInstanceSegmentationMasks):
216-
217213
self.instance_masks = instance_masks
218214

219215
def mask_bounding_box(self, mask: np.ndarray) -> Optional[Tuple[int, int, int, int]]:
@@ -239,7 +235,6 @@ def __eq__(self, other: object):
239235

240236

241237
class LazyInstanceDetections2D(LazyDetections2D):
242-
243238
def __init__(self, instance_masks: LazyInstanceSegmentationMasks):
244239
super().__init__(instance_masks)
245240
self._detections2d: Dict[str, Optional[Tuple[int, int, int, int]]] = {}
@@ -282,9 +277,7 @@ def __iter__(self):
282277

283278

284279
class LazyClassDetections2D(LazyDetections2D):
285-
286280
def __init__(self, instance_masks: LazyInstanceSegmentationMasks):
287-
288281
super().__init__(instance_masks)
289282
self._loaded = False
290283
self._detections2d: Dict[str, Optional[Tuple[Tuple[int, int, int, int], ...]]] = {}
@@ -533,7 +526,6 @@ def objects_by_type(self, object_type):
533526
return [obj for obj in self.metadata["objects"] if obj["objectType"] == object_type]
534527

535528
def process_colors_ids(self, image_ids_data):
536-
537529
self.instance_masks = LazyInstanceSegmentationMasks(image_ids_data, self.metadata)
538530
self.class_masks = LazyClassSegmentationMasks(self.instance_masks)
539531
self.class_detections2D = LazyClassDetections2D(self.instance_masks)

0 commit comments

Comments
 (0)