feat: add some func for get exp info #842
Merged
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.
这段拉取请求包括对
swanlab
包的几项更改,以增加新功能和改善代码组织。最重要的更改包括添加新函数以检索URL,重新组织导入,以及增强错误处理和测试。新功能:
swanlab/data/run/main.py
中添加了get_url()
和get_project_url()
函数,分别用于检索当前实验和项目的URL。代码重组:
swanlab/__init__.py
和swanlab/data/__init__.py
中重新组织了导入,包括config
,get_url
和get_project_url
。[1] [2]swanlab/data/run/__init__.py
中的导入语句,以包含新函数。错误处理:
swanlab/log/console.py
中增强了错误处理,以捕获在关闭的文件上尝试进行I/O操作时的ValueError
。测试:
test/unit/data/run/test_main.py
中为get_url()
和get_project_url()
函数添加了单元测试。[1] [2] [3]test/unit/data/test_sdk.py
中的测试,以断言WEB_HOST
环境变量的正确值。