Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
新增api
swanlab.get_run
通过此方法可以获取当前的运行实例
run.finish
标记实验状态为成功。在设计上手动执行finish说明是成功的实验,在执行此方法后会返回当前SwanLabRun实例,但是在此方法以后swanlab.get_run的返回值将为None
当然也可以设置参数state为
SwanLabRunState.CRASHED,此时必须输入第二个参数error,表示当前的错误,用于记录。如果是云端版本,此实验将会关闭云端上传线程池,并完成上传收尾工作。因此此方法在云端版本下会有一定耗时。
可选择是否开启动画,默认为开启。
run.state
此为属性,代表当前实验的状态,返回枚举
SwanLabRunState中的一个,可能是运行、崩溃、成功等于此同时添加了is_running、is_crashed等接口,用于便捷获取状态
SwanLabRun.get_state
此为方法,返回当前实验的状态,为枚举
SwanLabRunState中的一个,可能是未开始、运行、崩溃、成功等新增类
新增枚举类
SwanLabRunState,用于状态标记,具体内容可看源码