如果我需要提前完成代码,Papermill 会抛出异常。例如使用 quit():
nbclient.exceptions.DeadKernelError: Kernel died
我想知道是否有一种方法可以指示代码退出而不会引发异常。
例子:
# check conditions if all met then run full notebook
# if not, then just finish
condition1=True
if condition1:
quit() # if condition is not met then finish here
print('continue the logic')