-
Notifications
You must be signed in to change notification settings - Fork 10
Description
In our group we have a large fleet of MFLIs/UHFLIs and other ZI isntruments, and we use information provided by the .IDN()
parameter (qcodes drivers for all the instruments implement it in some way) to track which instruments are used, what FW versions are, and so on.
We found ourselves missing information on the version of LabOne that's used. So generally the question of this issue is: could you add this to the implementation of the .IDN()
parameter?
Going into more details, my colleague @jakuesel found the following way of retrieving the full version of LabOne, note that we need to do extra work in order to retreive the patch version:
import zhinst.core
def get_labone_version():
# Connect to the Data Server
daq = zhinst.core.ziDAQServer('localhost', 8004, 6)
# Get the LabOne version
version = daq.getString('/zi/about/version')
revision_dict = daq.get('/zi/about/revision')
revision_value = revision_dict['zi']['about']['revision']['value'][0]
# the revision is the full version as an integer where as the version is just the major and minor
# using both to determine the full version.
revision_str = str(revision_value)
major, minor = version.split(".")
patch_start = len(major) + len(minor)
patch_str = revision_str[patch_start:]
version_full = version + "." + patch_str
return version_full
version = get_labone_version()
print(f"LabOne Version: {version}")
Is this the correct approach? Or is there perhaps an API entry that we missed? In general, it'd be great to have a dedicated API to get the full version of LabOne.
We are happy to contribute this as a pull-request, after receiving the guidance from you on what the best way to implement this is.
Thank you in advance!