-
Notifications
You must be signed in to change notification settings - Fork 16
V2 refactor #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
peterhollender
wants to merge
20
commits into
main
Choose a base branch
from
v2_refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
V2 refactor #478
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
e2e4f2f
Load transducer arrays from connected module configurations (#440)
peterhollender c464746
Add rich representations for transducer models (#481)
peterhollender 06bac4d
Normalize transducer standoff transforms (#440)
peterhollender 6c2f85e
Honor device-stored transducer array configurations (#440)
peterhollender 3dff914
Add connected-module version inspection script (#74)
peterhollender 9535956
Warn when connected arrays differ from database definitions (#440)
peterhollender c530c10
Select cloud endpoints by environment (#482)
posnova d51294f
Stop synchronizing obsolete Systems resources (#425)
peterhollender 4106b0d
Add display metadata and model summaries (#481)
peterhollender 9611d43
Sanitize stale photoscan references when loading sessions (#467)
peterhollender de4b680
Derive solution analysis regions from beam geometry (#468)
peterhollender 0e10d82
Report thermal model validity at debug level (#422)
peterhollender ab78a92
Persist solution analyses and session solution references (#484)
peterhollender e80b046
Separate photoscan registrations from tracking results (#483)
peterhollender de765ee
Declare minimum dependency versions (#337)
peterhollender baadec4
Allow NumPy 2 and newer ONNX Runtime releases (#438)
peterhollender a0f9636
Fix style for linter (#337)
ebrahimebrahim 35d0fe5
update ISPTA for multiple foci
peterhollender d8b285e
Add Session.solutions list of SolutionInfo provenance records (https:…
peterhollender 02f7785
Further update ISPTA for rastering
peterhollender File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import logging | ||
| import os | ||
| import sys | ||
| import time | ||
|
|
||
| if os.name == 'nt': | ||
| pass | ||
| else: | ||
| pass | ||
|
|
||
|
|
||
| from openlifu.io.LIFUInterface import LIFUInterface | ||
|
|
||
| # set PYTHONPATH=%cd%\src;%PYTHONPATH% | ||
| # python notebooks/test_watertank.py | ||
|
|
||
| """ | ||
| Test script to automate: | ||
| 1. Connect to the device. | ||
| 2. Test HVController: Turn HV on/off and check voltage. | ||
| 3. Test Device functionality. | ||
| """ | ||
|
|
||
| # TO BE USED TO MONITOR TEMPERATURE CURVE TO SEE HOW LONG IT TAKES TO COOL DOWN | ||
|
|
||
| # Configure logging | ||
| logger = logging.getLogger(__name__) | ||
| logger.setLevel(logging.INFO) | ||
|
|
||
| # Prevent duplicate handlers and cluttered terminal output | ||
| if not logger.hasHandlers(): | ||
| handler = logging.StreamHandler() | ||
| handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")) | ||
| logger.addHandler(handler) | ||
| logger.propagate = False | ||
|
|
||
| log_interval = 1 # seconds; you can adjust this variable as needed | ||
| num_modules = 2 # Number of modules in the system | ||
|
|
||
| use_external_power_supply = False # Select whether to use console or power supply | ||
|
|
||
| logger.info("Starting LIFU Test Script...") | ||
| interface = LIFUInterface(ext_power_supply=use_external_power_supply) | ||
| tx_connected, hv_connected = interface.is_device_connected() | ||
|
|
||
| if not use_external_power_supply and not tx_connected: | ||
| logger.warning("TX device not connected. Attempting to turn on 12V...") | ||
| interface.hvcontroller.turn_12v_on() | ||
|
|
||
| # Give time for the TX device to power up and enumerate over USB | ||
| time.sleep(2) | ||
|
|
||
| # Cleanup and recreate interface to reinitialize USB devices | ||
| interface.stop_monitoring() | ||
| del interface | ||
| time.sleep(1) # Short delay before recreating | ||
|
|
||
| logger.info("Reinitializing LIFU interface after powering 12V...") | ||
| interface = LIFUInterface(ext_power_supply=use_external_power_supply) | ||
|
|
||
| # Re-check connection | ||
| tx_connected, hv_connected = interface.is_device_connected() | ||
|
|
||
| if not use_external_power_supply: | ||
| if hv_connected: | ||
| logger.info(f" HV Connected: {hv_connected}") | ||
| else: | ||
| logger.error("❌ HV NOT fully connected.") | ||
| sys.exit(1) | ||
| else: | ||
| logger.info(" Using external power supply") | ||
|
|
||
| if tx_connected: | ||
| logger.info(f" TX Connected: {tx_connected}") | ||
| logger.info("✅ LIFU Device fully connected.") | ||
| else: | ||
| logger.error("❌ TX NOT fully connected.") | ||
| sys.exit(1) | ||
|
|
||
| # Verify communication with the devices | ||
| if not interface.txdevice.ping(): | ||
| logger.error("Failed to ping the transmitter device.") | ||
| sys.exit(1) | ||
|
|
||
| if not use_external_power_supply and not interface.hvcontroller.ping(): | ||
| logger.error("Failed to ping the console device.") | ||
| sys.exit(1) | ||
|
|
||
| print(f"console version: {interface.hvcontroller.get_version()}") | ||
|
|
||
| logger.info("Enumerate TX7332 chips") | ||
| # num_tx_devices = interface.txdevice.get_tx_module_count() | ||
| num_tx_devices = 10 | ||
|
|
||
| for module in range(num_tx_devices+1): | ||
| try: | ||
| tx_firmware_version = interface.txdevice.get_version(module=module) | ||
| logger.info(f"TX Firmware Version: {tx_firmware_version}") | ||
| except Exception as e: | ||
| logger.error(f"Error querying TX firmware version: {e}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,74 +29,72 @@ classifiers = [ | |
| ] | ||
| dynamic = ["version"] | ||
| dependencies = [ | ||
| "xarray[io]", | ||
| "numpy<2", | ||
| "pandas", | ||
| "scipy", | ||
| "requests", | ||
| "xarray[io]>=2026.2.0", | ||
| "numpy>=2.0.0", | ||
| "pandas>=3.0.2", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @peterhollender quick question as I am starting to look over this: do you need all these version pins? do you need this new of a pandas? this would force us to drop Python 3.10 |
||
| "scipy>=1.14.1", | ||
| "requests>=2.33.1", | ||
| ] | ||
|
|
||
| [project.optional-dependencies] | ||
| jupyter = [ | ||
| "ipykernel", | ||
| "matplotlib", | ||
| "ipykernel>=7.2.0", | ||
| "matplotlib>=3.10.0", | ||
| ] | ||
| mesh = [ | ||
| "embreex; platform_machine=='x86_64' or platform_machine=='AMD64'", | ||
| "trimesh", | ||
| "scikit-image", | ||
| "vtk", | ||
| "Pillow", | ||
| "OpenEXR" | ||
| "embreex>=2.17.7.post7; platform_machine=='x86_64' or platform_machine=='AMD64'", | ||
| "trimesh>=4.11.5", | ||
| "scikit-image>=0.26.0", | ||
| "vtk>=9.6.1", | ||
| "Pillow>=12.2.0", | ||
| "OpenEXR>=3.4.9" | ||
| ] | ||
| db = [ | ||
| "nibabel", | ||
| "pydicom" | ||
| "nibabel>=5.4.2", | ||
| "pydicom>=3.0.2" | ||
| ] | ||
| io = [ | ||
| "base58", | ||
| "crc", | ||
| "crcmod", | ||
| "pyserial", | ||
| "openlifu-sdk>=2.0.12" | ||
| "crc>=7.1.0", | ||
| "crcmod>=1.7", | ||
| "openlifu-sdk>=2.0.14" | ||
| ] | ||
| sim = [ | ||
| "k-wave-python==0.4.0", | ||
| "nvidia-ml-py" | ||
| "nvidia-ml-py>=13.595.45" | ||
| ] | ||
| cloud = [ | ||
| "watchdog", | ||
| "python-socketio[client]" | ||
| "watchdog>=6.0.0", | ||
| "python-socketio[client]>=5.16.1" | ||
| ] | ||
| photogrammetry = [ | ||
| "embreex; platform_machine=='x86_64' or platform_machine=='AMD64'", | ||
| "opencv-contrib-python", | ||
| "onnxruntime==1.18.0", | ||
| "trimesh", | ||
| "scikit-image", | ||
| "vtk", | ||
| "Pillow", | ||
| "OpenEXR" | ||
| "embreex>=2.17.7.post7; platform_machine=='x86_64' or platform_machine=='AMD64'", | ||
| "opencv-contrib-python>=4.11.0.86", | ||
| "onnxruntime>=1.20.0", | ||
| "trimesh>=4.11.5", | ||
| "scikit-image>=0.26.0", | ||
| "vtk>=9.6.1", | ||
| "Pillow>=12.2.0", | ||
| "OpenEXR>=3.4.9" | ||
| ] | ||
| dev = [ | ||
| "pytest >=6", | ||
| "pytest-cov >=3", | ||
| "pytest-mock", | ||
| "dvc[gdrive]", | ||
| "pytest-mock>=3.15.1", | ||
| "dvc[gdrive]>=3.67.1", | ||
| ] | ||
| docs = [ | ||
| "openlifu[mesh, db, cloud]", | ||
| "sphinx>=7.0", | ||
| "myst_parser>=0.13", | ||
| "sphinx_copybutton", | ||
| "sphinx_autodoc_typehints", | ||
| "sphinx_copybutton>=0.5.2", | ||
| "sphinx_autodoc_typehints>=3.9.11", | ||
| "furo>=2023.08.17", | ||
| ] | ||
| test = [ | ||
| "openlifu[mesh, db, io, sim, cloud, photogrammetry]", | ||
| "pytest >=6", | ||
| "pytest-cov >=3", | ||
| "pytest-mock", | ||
| "pytest-mock>=3.15.1", | ||
| ] | ||
| all = [ | ||
| "openlifu[jupyter, mesh, db, io, sim, cloud, photogrammetry, test, dev, docs]", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file meant to be included in this PR? If so maybe it belongs elsewhere like examples/tools