Merge branch 'allegroai:master' into master

This commit is contained in:
Make42 2023-02-21 11:27:01 +01:00 committed by GitHub
commit cae0284d6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -398,11 +398,12 @@ class EventTrainsWriter(object):
with open(fd, "wb") as f: with open(fd, "wb") as f:
f.write(imdata) f.write(imdata)
return temp_file return temp_file
image = np.asarray(im)
output.close() output.close()
if height is not None and height > 0 and width is not None and width > 0: if height is not None and height > 0 and width is not None and width > 0:
val = np.array(im).reshape((height, width, -1)).astype(np.uint8) val = image.reshape((height, width, -1)).astype(np.uint8)
else: else:
val = np.array(im).astype(np.uint8) val = image.astype(np.uint8)
if val.ndim == 3 and val.shape[2] == 3: if val.ndim == 3 and val.shape[2] == 3:
if self._visualization_mode == 'BGR': if self._visualization_mode == 'BGR':
val = val[:, :, [2, 1, 0]] val = val[:, :, [2, 1, 0]]

View File

@ -1724,8 +1724,13 @@ class Task(_Task):
def close(self): def close(self):
""" """
Closes the current Task and changes its status to completed. Closes the current Task and changes its status to "Completed".
Enables you to manually shutdown the task. Enables you to manually shutdown the task.
This method does not terminate the current Python process, in contrast to :meth:`Task.mark_completed`.
After having :meth:`Task.close`d a task, the respective object cannot be used anymore and
methods like :meth:`Task.connect` or :meth:`Task.connect_configuration` will throw a `ValueError`.
In order to obtain an object representing the task again, use methods like :meth:`Task.get_task`.
.. warning:: .. warning::
Only call :meth:`Task.close` if you are certain the Task is not needed. Only call :meth:`Task.close` if you are certain the Task is not needed.