Skip to content

Commit

Permalink
"Resolve unsoundness caught by pytype --strict-none-binding.
Browse files Browse the repository at this point in the history
See go/pytype-releases#strict-none-binding and go/pytype-smarter-optional. In
short, pytype was previously more permissive when variables were initialized to
None but may have been re-assigned later. This change improves pytype's ability
to catch unsoundness in the affected files.

PiperOrigin-RevId: 567951095
  • Loading branch information
DeepMind authored and copybara-github committed Sep 24, 2023
1 parent 49fd98e commit 1513d96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion android_env/components/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(
self._tmp_dir = tmp_dir or tempfile.gettempdir()
self._orientation = np.zeros(4, dtype=np.uint8)
self._interaction_rate_sec = interaction_rate_sec
self._interaction_thread = None
self._interaction_thread: InteractionThread | None = None

# The size of the device screen in pixels (H x W).
self._screen_size = np.array([0, 0], dtype=np.int32)
Expand Down Expand Up @@ -362,6 +362,7 @@ def _gather_simulator_signals(self) -> dict[str, np.ndarray]:

# Grab pixels.
if self._interaction_rate_sec > 0:
assert self._interaction_thread is not None
pixels = self._interaction_thread.screenshot() # Async mode.
else:
pixels = self._simulator.get_screenshot() # Sync mode.
Expand Down

0 comments on commit 1513d96

Please sign in to comment.