Skip to main content

Migrating to HV SDK v1

HV SDK v1 changes the Python package name and some type names to make the API more consistent, refer to the HV SDK API docs for the complete migration guide.

This page only keeps a few tutorial-specific notes that came up while updating the HV SDK examples. For most users, downloading or copying the current examples is the simplest migration path.

Tutorial Notes

The examples now import the v1 package as hs:

import qtec_hv_sdk as hs

To print the installed SDK package version, use package metadata rather than a module-level __version__ attribute:

from importlib.metadata import version

print(version("qtec-hv-sdk"))

For direct camera streams, cam.stream(n_frames=...) creates a bounded stream. When frames are requested manually with stream.get_frame(), v1 returns None after that bounded stream is exhausted.

A simulated camera can be created by passing an SDK image to the camera constructor. In v1, BSQ source cubes are converted to a line-first stream layout. This conversion is specific to BSQ: the simulated camera assumes push-broom streaming, where lines must be the first dimension. BIL and BIP are already line-first for this purpose.

src = hs.open("cube.hdr")
cam = hs.control.Camera(src)