simvue-io / simvue-io/python-api

Grid.new fails if 1D array provided

オープン
#883 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug wontfix
主要言語
Python
スター
4
フォーク
1
平均マージ
5日 8時間
マージ済み PR(30日)
4

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

simvue/run.py の assign_metric_to_grid 呼び出しと simvue/utilities.py の検証ラッパーから始め、提供された NumPy の例を使って失敗を再現します。Grid.new がグリッド入力をどのように検証しているかを確認します。単一のラベルを持つ 1D の axes_ticks 配列で、報告された検証エラーなしにグリッドが正常に作成されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
numpy, python
領域
api
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。