Skip to content

update sdk interface to include get version#379

Merged
ebrahimebrahim merged 3 commits into
mainfrom
feature/add_sdk_version
Oct 15, 2025
Merged

update sdk interface to include get version#379
ebrahimebrahim merged 3 commits into
mainfrom
feature/add_sdk_version

Conversation

@georgevigelette
Copy link
Copy Markdown
Contributor

Added get_sdk_version from the interface.

Comment thread src/openlifu/io/LIFUInterface.py Outdated
import numpy as np
import pandas as pd

import openlifu as m
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
import openlifu as m
import openlifu

Comment thread src/openlifu/io/LIFUInterface.py Outdated
Comment on lines +401 to +406
@staticmethod
def get_sdk_version() -> str:
version = m.__version__
# Match the version pattern X.Y.Z
match = re.match(r'\d+\.\d+\.\d+', version)
return match.group(0) if match else version
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not return openlifu.__version__ directly? It is already X.Y.Z format.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it comes back like this 0.11.1.dev1+gf4ecadaaf and needs to be parsed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It comes back like that when you are on a dev version (as opposed to a release). In that case the commit hash is being given to you after the "dev1+g", and this is typically important information to understand the state of the code that you've got.

If you are using a released version with no modifications it comes back as X.Y.Z.

Typically you'd want to know if you are on a released version or some intermediate version -- in this case is there some reason you strictly need X.Y.Z format even for dev versions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed it to display the dev version.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice, merging shortly!

@ebrahimebrahim ebrahimebrahim force-pushed the feature/add_sdk_version branch from da6ee13 to 1b0b437 Compare October 15, 2025 17:12
@ebrahimebrahim ebrahimebrahim enabled auto-merge (squash) October 15, 2025 17:15
@ebrahimebrahim ebrahimebrahim merged commit aa77bb4 into main Oct 15, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants