Grid.new fails if 1D array provided
還沒有人認領這個 Issue。
評估
研究方向
先從 simvue/run.py 中的 assign_metric_to_grid 呼叫和 simvue/utilities.py 中的驗證包裝器開始,然後使用提供的 NumPy 範例重現該失敗。檢查 Grid.new 如何驗證網格輸入。當包含單一標籤的 1D axes_ticks 陣列能夠成功建立網格,且不再出現回報的驗證錯誤時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Description of Bug
If trying to create a grid for a 2D metric by providing a 1D array of ticks, it fails validation.
Steps To Reproduce
Code to reproduce the behavior:
import simvue
import numpy
with simvue.Run() as run:
run.init("test")
run.assign_metric_to_grid(metric_name="test_metric_2d", axes_ticks=numpy.arange(10), axes_labels=['x'])
for i in range(10):
run.log_metrics({"test_metric_2d": numpy.random.rand(10)}, time=i, step=i)
Expected behavior
Grid added correctly
Actual Behaviour
Traceback (most recent call last):
File "/home/wk9874/Documents/simvue/python-api/test_retrieval.py", line 6, in <module>
run.assign_metric_to_grid(metric_name="test_metric_2d", axes_ticks=numpy.arange(10), axes_labels=['x'])
File "/home/wk9874/Documents/simvue/python-api/simvue/utilities.py", line 260, in wrapper
return class_func(self, *args, **kwargs)
File "/home/wk9874/Documents/simvue/python-api/simvue/run.py", line 105, in _wrapper
return _function(self, *args, **kwargs)
File "/home/wk9874/Documents/simvue/python-api/simvue/utilities.py", line 300, in wrapper
raise RuntimeError(error_str)
RuntimeError: `Grid.new` Validation:
╒═════════╤═════════════╤══════════════════╤══════════════════════════════╕
│ Input │ Location │ Type │ Message │
╞═════════╪═════════════╪══════════════════╪══════════════════════════════╡
│ 0 │ ['grid', 0] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 1 │ ['grid', 1] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 2 │ ['grid', 2] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 3 │ ['grid', 3] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 4 │ ['grid', 4] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 5 │ ['grid', 5] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 6 │ ['grid', 6] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 7 │ ['grid', 7] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 8 │ ['grid', 8] │ int != list_type │ Input should be a valid list │
├─────────┼─────────────┼──────────────────┼──────────────────────────────┤
│ 9 │ ['grid', 9] │ int != list_type │ Input should be a valid list │
╘═════════╧═════════════╧══════════════════╧══════════════════════════════╛
Screenshots
If applicable, add screenshots to help explain your problem.
Setup
- OS: [e.g. Windows 11]
- Python version [e.g. v3.13.3]
Additional context
Add any other context about the problem here.
- 主要語言
- Python
- 星號
- 4
- 分支
- 1
- 平均合併
- 22 小時 21 分鐘
- 30 天內合併 PR
- 6
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
simvue-io/python-api 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
simvue-io/python-api#994 ·
-
bug
難度 1/5 1 小時以內 新手友好度 68/100
simvue-io/python-api#538 ·
-
bug
難度 3/5 1-2 天 新手友好度 55/100
simvue-io/python-api#1015 ·
-
難度 3/5 1-2 天 新手友好度 65/100
simvue-io/python-api#1000 · 2 則留言 ·
-
bug
難度 4/5 3-5 天 新手友好度 35/100
simvue-io/python-api#987 ·
查看 simvue-io/python-api 的全部 Issue
相似的 Issue
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 78/100
-
python-version
難度 1/5 1 小時以內 新手友好度 88/100
-
bug
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
bug javascript P2-medium python release:v3.1
難度 2/5 1-3 小時 新手友好度 68/100
adrirubio/claude-deck#546 ·
維護者通常 1 天內回覆
-
area: desktop area: website priority: P2 type: feature
難度 2/5 1-3 小時 新手友好度 62/100
appandflow/stim#3411 · 1 則留言 ·
維護者通常 1 天內回覆