From 425bf31382e9dc2415facf1fdf696a2375a7397a Mon Sep 17 00:00:00 2001
From: Abhishek Kadian <abhishekkadiyan@gmail.com>
Date: Sun, 8 Sep 2019 14:28:45 -0700
Subject: [PATCH] black lint

---
 habitat/sims/pyrobot/__init__.py      |  2 +-
 habitat/sims/pyrobot/pyrobot.py       | 50 ++++++++++++++++++---------
 habitat/tasks/nav/nav_task.py         |  4 ++-
 habitat/utils/visualizations/maps.py  |  3 +-
 habitat/utils/visualizations/utils.py |  3 +-
 5 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/habitat/sims/pyrobot/__init__.py b/habitat/sims/pyrobot/__init__.py
index 91bfd32df..0ee95858f 100644
--- a/habitat/sims/pyrobot/__init__.py
+++ b/habitat/sims/pyrobot/__init__.py
@@ -1,2 +1,2 @@
 # TODO(akadian): come up with better module structure
-from habitat.sims.pyrobot.pyrobot import PyRobot
\ No newline at end of file
+from habitat.sims.pyrobot.pyrobot import PyRobot
diff --git a/habitat/sims/pyrobot/pyrobot.py b/habitat/sims/pyrobot/pyrobot.py
index ca1d48058..a4b2389a7 100644
--- a/habitat/sims/pyrobot/pyrobot.py
+++ b/habitat/sims/pyrobot/pyrobot.py
@@ -20,7 +20,8 @@ import numpy as np
 
 # TODO(akadian): remove the below pyrobot hack
 import sys
-ros_path = '/opt/ros/kinetic/lib/python2.7/dist-packages'
+
+ros_path = "/opt/ros/kinetic/lib/python2.7/dist-packages"
 if ros_path in sys.path:
     sys.path.remove(ros_path)
     import cv2
@@ -41,12 +42,20 @@ class PyRobotRGBSensor(RGBSensor):
         )
 
     def get_observation(self, robot_obs):
-        obs = robot_obs.get(self.uuid, None) 
+        obs = robot_obs.get(self.uuid, None)
 
-        assert obs is not None, "Invalid observation for {} sensor".format(self.uuid)
+        assert obs is not None, "Invalid observation for {} sensor".format(
+            self.uuid
+        )
 
         if obs.shape != self.observation_space.shape:
-            obs = cv2.resize(obs, (self.observation_space.shape[1], self.observation_space.shape[0]))
+            obs = cv2.resize(
+                obs,
+                (
+                    self.observation_space.shape[1],
+                    self.observation_space.shape[0],
+                ),
+            )
 
         return obs
 
@@ -74,10 +83,18 @@ class PyRobotDepthSensor(DepthSensor):
     def get_observation(self, robot_obs):
         obs = robot_obs.get(self.uuid, None)
 
-        assert obs is not None, "Invalid observation for {} sensor".format(self.uuid)
+        assert obs is not None, "Invalid observation for {} sensor".format(
+            self.uuid
+        )
 
         if obs.shape != self.observation_space.shape:
-            obs = cv2.resize(obs, (self.observation_space.shape[1], self.observation_space.shape[0]))
+            obs = cv2.resize(
+                obs,
+                (
+                    self.observation_space.shape[1],
+                    self.observation_space.shape[0],
+                ),
+            )
 
         obs = np.clip(obs, self.config.MIN_DEPTH, self.config.MAX_DEPTH)
         if self.config.NORMALIZE_DEPTH:
@@ -93,11 +110,11 @@ class PyRobotDepthSensor(DepthSensor):
 class PyRobot(Simulator):
     def __init__(self, config: Config) -> None:
         self._config = config
-        
+
         robot_sensors = []
         for sensor_name in self._config.SENSORS:
             sensor_cfg = getattr(self._config, sensor_name)
-            sensor_type = registry.get_sensor(sensor_cfg.TYPE)     
+            sensor_type = registry.get_sensor(sensor_cfg.TYPE)
 
             assert sensor_type is not None, "invalid sensor type {}".format(
                 sensor_cfg.TYPE
@@ -105,17 +122,16 @@ class PyRobot(Simulator):
             robot_sensors.append(sensor_type(sensor_cfg))
         self._sensor_suite = SensorSuite(robot_sensors)
 
-        config_pyrobot = {
-            "base_controller": self._config.BASE_CONTROLLER
-        }
+        config_pyrobot = {"base_controller": self._config.BASE_CONTROLLER}
 
-        assert self._config.ROBOT in self._config.ROBOTS, "Invalid robot type {}".format(self._config.ROBOT)
-        self._robot_config = getattr(
-            self._config, 
-            self._config.ROBOT.upper()
-        )
+        assert (
+            self._config.ROBOT in self._config.ROBOTS
+        ), "Invalid robot type {}".format(self._config.ROBOT)
+        self._robot_config = getattr(self._config, self._config.ROBOT.upper())
 
-        self._robot = pyrobot.Robot(self._config.ROBOT, base_config=config_pyrobot)
+        self._robot = pyrobot.Robot(
+            self._config.ROBOT, base_config=config_pyrobot
+        )
 
     def _degree_to_radian(self, degrees):
         return (degrees / 180) * np.pi
diff --git a/habitat/tasks/nav/nav_task.py b/habitat/tasks/nav/nav_task.py
index 0c67b8c7a..f0bce6488 100644
--- a/habitat/tasks/nav/nav_task.py
+++ b/habitat/tasks/nav/nav_task.py
@@ -7,9 +7,11 @@
 from typing import Any, List, Optional, Type
 
 import attr
+
 # TODO(akadian): remove the below pyrobot hack
 import sys
-ros_path = '/opt/ros/kinetic/lib/python2.7/dist-packages'
+
+ros_path = "/opt/ros/kinetic/lib/python2.7/dist-packages"
 if ros_path in sys.path:
     sys.path.remove(ros_path)
     import cv2
diff --git a/habitat/utils/visualizations/maps.py b/habitat/utils/visualizations/maps.py
index a46f4e695..fc87e26ec 100644
--- a/habitat/utils/visualizations/maps.py
+++ b/habitat/utils/visualizations/maps.py
@@ -9,7 +9,8 @@ from typing import List, Optional, Tuple
 
 # TODO(akadian): remove the below pyrobot hack
 import sys
-ros_path = '/opt/ros/kinetic/lib/python2.7/dist-packages'
+
+ros_path = "/opt/ros/kinetic/lib/python2.7/dist-packages"
 if ros_path in sys.path:
     sys.path.remove(ros_path)
     import cv2
diff --git a/habitat/utils/visualizations/utils.py b/habitat/utils/visualizations/utils.py
index 687558a1f..d42491dea 100644
--- a/habitat/utils/visualizations/utils.py
+++ b/habitat/utils/visualizations/utils.py
@@ -9,7 +9,8 @@ from typing import Dict, List, Optional, Tuple
 
 # TODO(akadian): remove the below pyrobot hack
 import sys
-ros_path = '/opt/ros/kinetic/lib/python2.7/dist-packages'
+
+ros_path = "/opt/ros/kinetic/lib/python2.7/dist-packages"
 if ros_path in sys.path:
     sys.path.remove(ros_path)
     import cv2
-- 
GitLab