suppress pyrefly errors in mujoco

Startblock:
  * // Put other blockers before this line to avoid churning.
  * has lgtm
  * is approved
  * and then
  * all comments are resolved
  * and then
PiperOrigin-RevId: 961854282
Change-Id: I9d323a8ef9f36ffe69cc62d449849eac82dc6858
This commit is contained in:
Hana Joo
2026-08-09 15:44:49 -07:00
committed by Copybara-Service
parent d6dc966c04
commit 0aad65868d
10 changed files with 61 additions and 61 deletions
@@ -117,7 +117,7 @@ class GhostRenderer:
self._viewer.extra_geoms.clear()
if self._last_time is None or data.time < self._last_time:
self._history.clear()
if not self._history or data.time > self._last_time:
if not self._history or data.time > self._last_time: # pyrefly: ignore[unsupported-operation]
self._history.append((
data.time,
data.geom_xpos.copy(),
@@ -129,7 +129,7 @@ class GhostRenderer:
while len(self._history) > 1 and self._history[1][0] <= target_time:
self._history.popleft()
_, xpos, xmat = self._history[0]
_, xpos, xmat = self._history[0] # pyrefly: ignore[bad-assignment]
if len(xpos) != model.ngeom or len(xmat) != model.ngeom:
return
@@ -70,7 +70,7 @@ def main(argv: list[str]) -> None:
print(f'Error saving image to `{_OUTPUT.value}`: {ex}')
sys.exit(-3)
return 0
return 0 # pyrefly: ignore[bad-return]
if __name__ == '__main__':
+1 -1
View File
@@ -59,7 +59,7 @@ def main(argv: list[str]) -> None:
) as handle:
# Send the model to the viewer, if we have a model.
if model is not None:
handle.send_to_viewer(messages.ModelEvent(model=model, path=model_path))
handle.send_to_viewer(messages.ModelEvent(model=model, path=model_path)) # pyrefly: ignore[bad-argument-type]
# Run the simulation.
step_control = sim.StepControl()
@@ -792,7 +792,7 @@ def _run_server(
try:
# Handshake: browser CmdVersion -> client; client CmdVersion -> browser.
browser_version = await ws.recv()
my_writer.write(browser_version)
my_writer.write(browser_version) # pyrefly: ignore[bad-argument-type]
await my_writer.drain()
server_version = await my_reader.readexactly(_NETIMGUI_CMD_VERSION_SIZE)
await ws.send(server_version)
@@ -869,10 +869,10 @@ def _run_server(
gen_before = generation.value
if gen_before & 1:
continue
(used,) = struct.unpack("<I", bytes(shm_array[:4]))
(used,) = struct.unpack("<I", bytes(shm_array[:4])) # pyrefly: ignore[unsupported-operation]
if used == 0 or used > shm_capacity:
return None
data = bytes(shm_array[4 : 4 + used])
data = bytes(shm_array[4 : 4 + used]) # pyrefly: ignore[unsupported-operation]
if generation.value == gen_before:
return gen_before, data
return None
+2 -2
View File
@@ -31,7 +31,7 @@ def generate_usd_trajectory(local_args):
# create an instance of the USDExporter
exp = exporter.USDExporter(
model=m,
output_directory_name=pathlib.Path(local_args.model_path).stem,
output_directory_name=pathlib.Path(local_args.model_path).stem, # pyrefly: ignore[unexpected-keyword]
output_directory_root=local_args.output_directory_root,
camera_names=local_args.camera_names,
)
@@ -42,7 +42,7 @@ def generate_usd_trajectory(local_args):
if exp.frame_count < d.time * local_args.framerate:
exp.update_scene(data=d)
exp.add_light(pos=(0, 0, 0),
exp.add_light(pos=(0, 0, 0), # pyrefly: ignore[bad-argument-type]
intensity=2000,
light_type='dome')