simvue-io / simvue-io/python-api

Creating new grid breaks if axes labels not provided

Open
#882 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
4
Forks
1
Avg merge
5d 8h
Merged PRs (30d)
4

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect simvue/run.py around assign_metric_to_grid at line 1434, then run the reproduction using numpy and missing axes labels. Confirm whether the intended behavior is to create the grid with defaults or report a clearer validation error, and verify that the resulting behavior matches the expected grid and metric logging flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
api, data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.