simvue-io / simvue-io/python-api

Creating new grid breaks if axes labels not provided

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

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

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

説明

Description of Bug

If I use assign_metrics_to_grid to make a new grid, and I don't provide a list of axes labels, it will crash and give a misleading error message:

  File "/home/wk9874/Documents/simvue/python-api/simvue/run.py", line 1434, in assign_metric_to_grid
    self._error(f"Grid '{grid_name}' is not defined.")
  File "/home/wk9874/Documents/simvue/python-api/simvue/run.py", line 606, in _error
    raise SimvueRunError(message)
simvue.exception.SimvueRunError: Grid 'test_metric_2d' is not defined.

I dont think axes labels should be required, it should probably default to 'x' for 2D metrics of ['x', 'y'] for 3D metrics. Although if you would prefer to be explicit and require axes labels, it should provide a more informative message

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(100))
    for i in range(10):
        run.log_metrics({"test_metric_2d": numpy.random.rand(10)}, time=i, step=i)

Expected behavior

Should create a grid and log a metric

Actual Behaviour

Error thrown

Screenshots

If applicable, add screenshots to help explain your problem.

Setup

  • OS: Ubuntu 22.04
  • Python version 3.10

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

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

はじめの一歩

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

調査の方向性

simvue/run.py の 1434 行目にある assign_metric_to_grid の周辺を調査し、その後、軸ラベルがない状態で numpy を使って再現を実行してください。意図された動作がデフォルト値でグリッドを作成することなのか、それともより明確な検証エラーを報告することなのかを確認し、結果の動作が期待されるグリッドおよびメトリクスのロギングフローと一致することを検証してください。

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

評価

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

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

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