Skip to content

Commit

Permalink
PEP8 modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
saleml committed Oct 17, 2018
1 parent dfa9cd7 commit 8cd3e46
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions babyai/levels/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def dot_product(v1, v2):
Compute the dot product of the vectors v1 and v2.
"""

return sum([i*j for i, j in zip(v1, v2)])
return sum([i * j for i, j in zip(v1, v2)])


def pos_next_to(pos_a, pos_b):
Expand Down Expand Up @@ -142,7 +142,7 @@ def find_matching_objs(self, env, use_location=True):
continue

# Direction from the agent to the object
v = (i-env.start_pos[0], j-env.start_pos[1])
v = (i - env.start_pos[0], j - env.start_pos[1])

# (d1, d2) is an oriented orthonormal basis
d1 = DIR_TO_VEC[env.start_dir]
Expand All @@ -156,7 +156,7 @@ def find_matching_objs(self, env, use_location=True):
"behind": dot_product(v, d1) < 0
}

if not(pos_matches[self.loc]):
if not (pos_matches[self.loc]):
continue

if use_location:
Expand Down Expand Up @@ -207,7 +207,6 @@ def update_objs_poss(self):
getattr(self, attr).find_matching_objs(self.env, use_location=False)



class ActionInstr(Instr):
"""
Base class for all action instructions (clauses)
Expand Down

0 comments on commit 8cd3e46

Please sign in to comment.