Skip to content

Conversation

SAKURA-CAT
Copy link
Member

修复 sync 一个 resume 的 folder 会出现的列类型错误

现在的设计是 resume 时硬件监控不会开启,但是考虑到后续的更新,在backup file文件夹依旧保存了硬件监控相关的列信息
当 sync resume 的文件夹时就出现了列的类型错误,导致显示问题

Moved and modified the test case for resuming a non-existent experiment to use the 'reinit=True' parameter and ensure a RuntimeError is raised as expected.
@SAKURA-CAT SAKURA-CAT requested review from Zeyi-Lin and Copilot July 27, 2025 08:14
@SAKURA-CAT SAKURA-CAT self-assigned this Jul 27, 2025
@SAKURA-CAT SAKURA-CAT added the 🐛 bug Something isn't working label Jul 27, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a column type error that occurs when syncing a resume folder. The issue was that hardware monitoring column information was saved in backup files even when hardware monitoring was disabled during resume, causing display problems when syncing the resumed folder.

  • Adds logic to properly map column_class to section_type based on system vs custom classification
  • Updates test file to improve test organization by moving exception test to the end
  • Introduces comprehensive test coverage for column class and type mappings

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
swanlab/data/run/key.py Implements proper section_type mapping based on column_class and chart type
test/unit/data/run/test_key.py Adds parametrized tests for column_class and column_type section_type mapping
test/resume/must.py Reorganizes test structure by moving exception test after successful operations
Comments suppressed due to low confidence (1)

test/unit/data/run/test_key.py:53

  • The test only covers ECHARTS mapping to CUSTOM section_type, but the production code logic suggests other chart types should map to PUBLIC. Consider adding test cases for other chart types to ensure complete coverage of the section_type mapping logic.
            ["ECHARTS", "CUSTOM"],

Replaced value-based comparison with identity comparison for ChartType.ECHARTS to ensure correct section type assignment.
@SAKURA-CAT SAKURA-CAT merged commit 3b88c4f into main Jul 27, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the fix/resume branch July 27, 2025 08:39
@Zeyi-Lin Zeyi-Lin restored the fix/resume branch July 27, 2025 13:31
@Zeyi-Lin Zeyi-Lin deleted the fix/resume branch July 27, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants