simvue-io / simvue-io/python-api

Requesting multiple metrics sometimes give different results to requesting them individually

Open
#924 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description of Bug

Sometimes, when a single metric is requested with get_metric_values, it returns a value for a particular time. But if both that metric and another are requested simultaneously, even if they both have a value at the same time, the value returned for the first metric is None.

Steps To Reproduce

Run this, noting that the run is on trial3. then comment out line 7, uncomment line 8, and run it again:

import simvue

run_id = "AZPKJLrtwr3ZerLi4QNnu8"

client = simvue.Client()

metric_names = ["soot_visibility.z.7_0.avg", "soot_visibility.z.37_0.avg"]
#metric_names = ["soot_visibility.z.7_0.avg"]

all_metric_values = client.get_metric_values(metric_names, 'time', run_ids=[run_id])

for (metric_name, single_metric_values) in all_metric_values.items():
    print(f"{metric_name}: {list(single_metric_values.items())[-1]}")

Output:

soot_visibility.z.37_0.avg: ((1731.6583251953125, 'AZPKJLrtwr3ZerLi4QNnu8'), 29.584584259066062)
soot_visibility.z.7_0.avg: ((1731.6583251953125, 'AZPKJLrtwr3ZerLi4QNnu8'), None)

Output with line 8 instead of 7:

soot_visibility.z.7_0.avg: ((1731.6583251953125, 'AZPKJLrtwr3ZerLi4QNnu8'), 19.169060055914873)

Setup

  • OS: Ubuntu
  • python-api version v2.3.5

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

Start with the get_metric_values call and run the provided reproduction against trial3 using both metric_names configurations. Compare the returned values for the shared timestamp; done means requesting multiple metrics preserves the same value returned when the affected metric is requested individually.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.