用法:
recreate_error_locally(future)
對於失敗的計算,在本地執行被指責的任務以進行調試。
如果堆棧跟蹤信息不足以診斷問題,則應在未來(
gather
,compute
等的結果)返回狀態為 “error” 後執行此操作。負責錯誤的特定任務(指向未來的圖的一部分)將從調度程序中獲取,以及它的輸入值。然後將執行該函數,以便可以使用pdb
進行調試。- future:未來或失敗的集合
與
gather
相同的內容,但返回異常/stack-trace。也可以是包含任何錯誤期貨的(持久的)dask 集合。
- 沒有;該函數運行並應引發異常,允許
- 要運行的調試器。
參數:
返回:
例子:
>>> future = c.submit(div, 1, 0) >>> future.status 'error' >>> c.recreate_error_locally(future) ZeroDivisionError: division by zero
如果你使用 IPython,你可能會借此機會使用 pdb
>>> %pdb Automatic pdb calling has been turned ON
>>> c.recreate_error_locally(future) ZeroDivisionError: division by zero 1 def div(x, y): ----> 2 return x / y ipdb>
相關用法
- Python distributed.recreate_tasks.ReplayTaskClient.recreate_task_locally用法及代碼示例
- Python distributed.protocol.serialize.register_generic用法及代碼示例
- Python distributed.Client.gather用法及代碼示例
- Python distributed.diagnostics.plugin.SchedulerPlugin用法及代碼示例
- Python distributed.Client.ncores用法及代碼示例
- Python distributed.Client.retire_workers用法及代碼示例
- Python distributed.Client.unregister_worker_plugin用法及代碼示例
- Python distributed.fire_and_forget用法及代碼示例
- Python distributed.Client.set_metadata用法及代碼示例
- Python distributed.Client.scheduler_info用法及代碼示例
- Python distributed.Client.submit用法及代碼示例
- Python distributed.Client.compute用法及代碼示例
- Python distributed.SpecCluster.scale用法及代碼示例
- Python distributed.get_worker用法及代碼示例
- Python distributed.SpecCluster.scale_up用法及代碼示例
- Python distributed.Client.nthreads用法及代碼示例
- Python distributed.comm.resolve_address用法及代碼示例
- Python distributed.Client.unpublish_dataset用法及代碼示例
- Python distributed.get_task_stream用法及代碼示例
- Python distributed.Client.start_ipython_scheduler用法及代碼示例
注:本文由純淨天空篩選整理自dask.org大神的英文原創作品 distributed.recreate_tasks.ReplayTaskClient.recreate_error_locally。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。