Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
Created using spr 1.3.5
  • Loading branch information
mtrofin committed Feb 13, 2025
1 parent 454b79c commit 8b021d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
16 changes: 5 additions & 11 deletions compiler_opt/rl/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,11 @@ def _replacement(*args, **kwargs):

return _replacement

# pylint: disable=protected-access
obj._orig_read = obj.read
obj._orig_readline = obj.readline
obj._orig_readinto = obj.readinto
obj._orig_readall = obj.readall

obj.read = _get_polling_wrapper(obj._orig_read)
obj.readline = _get_polling_wrapper(obj._orig_readline)
obj.readinto = _get_polling_wrapper(obj._orig_readinto)
obj.readall = _get_polling_wrapper(obj._orig_readall)
# pylint: enable=protected-access
obj.read = _get_polling_wrapper(obj.read)
obj.readline = _get_polling_wrapper(obj.readline)
obj.readinto = _get_polling_wrapper(obj.readinto)
obj.readall = _get_polling_wrapper(obj.readall)

return obj

opened = threading.Event()
Expand Down
8 changes: 4 additions & 4 deletions compiler_opt/rl/env_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def _the_process():
'type': 'float',
}
})
w.write_nl()
w.write_newline()
w.write_context_marker('hello')
w.write_observation_marker(0)
w.write_buff([1], ctypes.c_int16)
Expand Down Expand Up @@ -402,14 +402,14 @@ def _the_process():
'type': 'float',
}
})
w.write_nl()
w.write_newline()
w.write_context_marker('hello')
w.write_observation_marker(0)
w.write_buff([1], ctypes.c_int64)
w.write_nl()
w.write_newline()
w.write_outcome_marker(0)
w.write_buff([3.14], ctypes.c_float)
w.write_nl()
w.write_newline()
out.flush()
wrote_event.set()
time.sleep(3600)
Expand Down

0 comments on commit 8b021d4

Please sign in to comment.