Skip to content

Added logging of units for metrics#946

Merged
kzscisoft merged 1 commit intodevfrom
feature/units
Apr 21, 2026
Merged

Added logging of units for metrics#946
kzscisoft merged 1 commit intodevfrom
feature/units

Conversation

@kzscisoft
Copy link
Copy Markdown
Collaborator

Add Metric Units to Metadata

Issue: N/A

Python Version(s) Tested: 3.14.3

Operating System(s): Ubuntu 25.10

Documentation PR: Issue on Docs repo.

📝 Summary

Adds the ability to log metadata defining the units for metrics with automatic of recognition of unit in relation to MKS units.

🔄 Changes

Added set_metric_units method to simvue.Run class:

import simvue

with simvue.Run() as run:
    run.init(
        name="units_demo", folder="/simvue_unit_testing", tags=["testing", "units"]
    )
    run.set_metric_units("x", units="ft")
    run.set_metric_units("y", units="m")
    run.set_metric_units("z", units="Foobars", mks_conversion=3.542, mks_unit="m")
    run.log_metrics({"x": 10, "y": 3, "z": 22})

✔️ Checklist

  • Unit and integration tests passing.
  • Pre-commit hooks passing.
  • Quality checks passing.
  • Updated the documentation.

@kzscisoft kzscisoft requested a review from alahiff April 21, 2026 12:03
@kzscisoft kzscisoft added enhancement New feature or request python Pull requests that update python code labels Apr 21, 2026
@kzscisoft kzscisoft added this to the Simvue Python API v2.4 milestone Apr 21, 2026
Copy link
Copy Markdown
Collaborator

@alahiff alahiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@kzscisoft kzscisoft merged commit 635ccfc into dev Apr 21, 2026
21 of 22 checks passed
@kzscisoft kzscisoft deleted the feature/units branch April 21, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants