Skip to content

Commit b4ee1e0

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent acb852e commit b4ee1e0

File tree

19 files changed

+9
-24
lines changed

19 files changed

+9
-24
lines changed

neodroid/entry_points/cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def run(self, env_name: str) -> None:
6262
@staticmethod
6363
def fetch(env_name: str) -> Path:
6464
"""
65-
Fetches a remotely stored environment with the specified name to local storage"""
65+
Fetches a remotely stored environment with the specified name to local storage
66+
"""
6667
exe_path = download_environment(
6768
env_name, path_to_executables_directory=DEFAULT_ENVIRONMENTS_PATH
6869
)
@@ -71,7 +72,8 @@ def fetch(env_name: str) -> Path:
7172

7273
def install(self, env_name: str) -> Path:
7374
"""
74-
Fetches a remotely stored environment with the specified name to local storage"""
75+
Fetches a remotely stored environment with the specified name to local storage
76+
"""
7577
return self.fetch(env_name)
7678

7779
@staticmethod
@@ -85,7 +87,8 @@ def remove(env_name: str) -> None:
8587

8688
def update(self, env_name: str) -> None:
8789
"""
88-
Updates, fetches environment with the specified name again and replaces the previous version if present"""
90+
Updates, fetches environment with the specified name again and replaces the previous version if present
91+
"""
8992
if os.path.exists(DEFAULT_ENVIRONMENTS_PATH):
9093
self.remove(env_name)
9194
exe_path = self.fetch(env_name)

neodroid/environments/droid_environment/unity/deprecated/batched_unity_environments.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def _reset(self, resets=None, **kwargs):
2424
return self._resets
2525

2626
def _react(self, reactions=None, **kwargs):
27-
2827
if self._resets and len(self._resets) > 0:
2928
i = 0
3029
for reset in self._resets:

neodroid/environments/droid_environment/unity/dict_unity_environment.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def __init__(
7070
if self._simulation_instance:
7171
logging.debug(f"successfully started environment {environment_name}")
7272
else:
73-
7473
logging.debug(f"could not start environment {environment_name}")
7574

7675
self._setup_connection()

neodroid/environments/gym_environment/vector_gym_environment.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def __init__(
5151
num_env: int = cpu_count(),
5252
auto_reset_on_terminal_state=False,
5353
):
54-
5554
self._env = SubProcessEnvironments(
5655
[make_gym_env(environment_name) for _ in range(num_env)],
5756
auto_reset_on_terminal_state=auto_reset_on_terminal_state,
@@ -84,7 +83,6 @@ def observation_space(self) -> VectorObservationSpace:
8483
:return:"""
8584
ospc = self._env.observation_space
8685
if len(ospc.shape) >= 1:
87-
8886
space = ObservationSpace(
8987
[
9088
Dimension(decimal_granularity=6, min_value=mn, max_value=mx)
@@ -111,7 +109,6 @@ def action_space(self) -> VectorActionSpace:
111109
:return:"""
112110
aspc = self._env.action_space
113111
if len(self.aspc.shape) >= 1:
114-
115112
space = ActionSpace(
116113
[
117114
Dimension(

neodroid/environments/python_environment/non_neodroidian_environments/contextual_bandit_environment.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class ContextualBanditEnvironment(object):
99
""""""
1010

1111
def __init__(self, seed=0):
12-
1312
self.np_random = numpy.random.RandomState()
1413
self.np_random.seed(seed)
1514

neodroid/messaging/message_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def __init__(
2727
single_threaded: bool = False,
2828
writer: callable = logging.info,
2929
):
30-
3130
self._tcp_address = tcp_address
3231
self._tcp_port = tcp_port
3332

neodroid/utilities/snapshot_extraction/camera_extraction.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def extract_camera_observation(state, key):
107107

108108

109109
if __name__ == "__main__":
110-
111110
environments = neodroid.connect()
112111
environments.reset()
113112

neodroid/utilities/specifications/unity_specifications/motion.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def __init__(self, actor_name: str, actuator_name: str, strength: float):
1515
1616
:param actor_name:
1717
:param actuator_name:
18-
:param strength: Strength has a possible direction given by the sign of the float"""
18+
:param strength: Strength has a possible direction given by the sign of the float
19+
"""
1920
self._actor_name = actor_name
2021
self._actuator_name = actuator_name
2122
self._strength = strength

neodroid/utilities/transformations/quaternion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def _axis_angle_to_q(self, theta, v):
7676
self.components = numpy.array([w, x, y, z])
7777

7878
def __mul__(self, b):
79-
8079
if isinstance(b, Quaternion):
8180
return self._multiply_with_quaternion(b)
8281
elif isinstance(b, (list, tuple, numpy.ndarray)):

samples/experimental/observation_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def main():
2121
connect_to_running=True
2222
) as env:
2323
with tqdm(env, leave=False) as observation_session:
24-
for (observation, reward, terminated, info) in observation_session:
24+
for observation, reward, terminated, info in observation_session:
2525
frame_i += 1
2626

2727
if not diverged and frame_i != info.frame_number:

samples/external_agents/mario_rl_tutorial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ def asidjas(
278278
num_skips=4,
279279
device=global_torch_device(),
280280
):
281-
282281
######################################################################
283282
# Preprocess Environment
284283
# ------------------------

samples/generation/dataset/collect_data.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
if __name__ == "__main__":
1111

1212
def main(generate_num=10):
13-
1413
if generate_num > 0:
1514
with connect_dict() as env:
1615
for i, state in enumerate(env):

samples/generation/dataset/tf_record_generator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def write_tf_record_file(data_tuples, file_name="neodroid_bb_images.tfr"):
7979

8080

8181
if __name__ == "__main__":
82-
8382
generate_num = 10
8483
output_file_name = PROJECT_APP_PATH.user_data / "neodroid_bb_images.tfr"
8584

samples/generation/web_app/app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def assess_input():
6868
@app.route("/assessment", methods=["GET", "POST"])
6969
def upload_and_classify():
7070
if request.method == "POST":
71-
7271
# check if the post request has the file part
7372
if "file" not in request.files:
7473
flash("No file part")

samples/gui_client/gui_components/environment_state_box.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def __init__(self, **kwargs):
3636
self.assemble_components()
3737

3838
def assemble_components(self):
39-
4039
self.image_row_layout.add_widget(self.rgb_image)
4140
self.image_row_layout.add_widget(self.segmentation_image)
4241
self.image_row_layout.add_widget(self.instance_segmentation_image)
@@ -89,7 +88,6 @@ def update_segmentation_image(self, segmentation_image_data):
8988

9089
def update_instance_segmentation_image(self, instance_segmentation_image_data):
9190
try:
92-
9391
instance_segmentation_image = CoreImage(
9492
instance_segmentation_image_data, ext="png"
9593
)

samples/gui_client/gui_components/status_bar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def __init__(self, on_connect_callback, **kwargs):
2424
self.assemble_components()
2525

2626
def assemble_components(self):
27-
2827
self.connect_button.bind(on_release=self.on_connect_button)
2928
self.launch_check_box.bind(active=self.on_launch_button)
3029

samples/gui_client/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def update_environment_widgets(state):
8989
print("Failed at updating rest of GUI")
9090

9191
try:
92-
9392
GUI.update_normal_image(state.sensor("NormalCamera").value)
9493
GUI.update_motion_image(state.sensor("FlowCamera").value)
9594
GUI.update_depth_image(state.sensor("DepthCamera").value)

samples/visualisation/histogram.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
if __name__ == "__main__":
1414

1515
def main(generate_num=10):
16-
1716
if generate_num > 0:
1817
with connect() as env:
1918
for i, state in enumerate(env):

samples/visualisation/timeseries.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
if __name__ == "__main__":
1313

1414
def main(generate_num=10):
15-
1615
if generate_num > 0:
1716
with connect() as env:
1817
for i, state in enumerate(env):

0 commit comments

Comments
 (0)