Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions notebooks/test_watertank.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes to test_watertank.py don't seem related to #305. Can you remove them from this PR?

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
zInput = 50

frequency = 405e3
voltage = 50.0
voltage = 25.0
duration = 2e-4

json_trigger_data = {
Expand Down Expand Up @@ -82,11 +82,8 @@ def log_temperature():
filename = f"{timestamp}_temp.csv"
with open(filename, "w") as logfile:
while not stop_logging:
print("Retrieving Console temperature...")
con_temp = interface.hvcontroller.get_temperature1()
print("Retrieving TX temperature...")
tx_temp = interface.txdevice.get_temperature()
print("Retrieving TX Amb temperature...")
amb_temp = interface.txdevice.get_ambient_temperature()
current_time = time.strftime("%Y-%m-%d %H:%M:%S")
log_line = f"{current_time},{frequency},{duration},{voltage},{con_temp},{tx_temp},{amb_temp}\n"
Expand Down
9 changes: 9 additions & 0 deletions src/openlifu/io/LIFUInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,12 @@ def __exit__(self, exc_type, exc_value, traceback):
self.txdevice.disconnect()
if self.hvcontroller:
self.hvcontroller.disconnect()

@staticmethod
def get_sdk_version() -> str:
"""Get the SDK version from openlifu.__version__ or fallback."""
try:
import openlifu as m
return getattr(m, "__version__", "0.3.2")
except ImportError:
return "0.3.2"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these fallbacks necessary? Is there an expected case where openlifu doesn't import or doesn't have a __version__?

Loading