update sdk interface to include get version#379
Conversation
| import numpy as np | ||
| import pandas as pd | ||
|
|
||
| import openlifu as m |
There was a problem hiding this comment.
| import openlifu as m | |
| import openlifu |
| @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 |
There was a problem hiding this comment.
Why not return openlifu.__version__ directly? It is already X.Y.Z format.
There was a problem hiding this comment.
it comes back like this 0.11.1.dev1+gf4ecadaaf and needs to be parsed
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
changed it to display the dev version.
There was a problem hiding this comment.
nice, merging shortly!
da6ee13 to
1b0b437
Compare
Added get_sdk_version from the interface.