Skip to content

P/init install cleanup#444

Open
peterhollender wants to merge 3 commits intomainfrom
p/init_install_cleanup
Open

P/init install cleanup#444
peterhollender wants to merge 3 commits intomainfrom
p/init_install_cleanup

Conversation

@peterhollender
Copy link
Copy Markdown
Contributor

This is a fairly major change to the project, designed to address issues #8 and #10

  • Trims unnecessary parts of the project, including
    • legacy scripts
    • the io module (now covered in openlifu-sdk)
    • unused parts of Database (gridweights)
  • Reorganizes virtual_fit module into seg
  • Eliminates "eager" imports in openlifu.__init__, to prevent the many-seconds-long importing when accessing any submodule.
  • Moves importing of heavier-weight packages (which are being made optional by this branch) into the methods that call them, so that the objects can be partially-used without having those dependencies imported.
  • Introduces sets of optional-dependencies to pyproject.toml that allow for reduced dependency installation. The openlifu-test-app project, for example, can package only the hardware-communication required dependencies by using the [io] option. The base application as used in Slicer should now be installed with the [app] option.

Code that touches openlifu.virtual_fit needs to be refactored to use openlifu.seg.virtualfit, and code that used things like openlifu.Transducer will need to be changed to use openlifu.xdc.Transducer

This introduces sets of optional-dependencies to `pyproject.toml` that allow for reduced dependency installation. The `openlifu-test-app` project, for example, can package only the hardware-communication required dependencies by using the `[io]` option. The base application as used in Slicer should now be installed with the `[app]` option.
- Trims unnecessary parts of the project, including
  - legacy scripts
  - the io module (now covered in `openlifu-sdk`)
  - unused parts of Database (gridweights)
- Reorganizes `virtual_fit` module into `seg`
- Eliminates "eager" imports in `openlifu.__init__`, to prevent the many-seconds-long importing when accessing any submodule.
- Moves importing of heavier-weight packages (which are being made optional by this branch) into the methods that call them, so that the objects can be partially-used without having those dependencies imported.

Code that touches `openlifu.virtual_fit` needs to be refactored to use `openlifu.seg.virtualfit`, and code that used things like `openlifu.Transducer` will need to be changed to use `openlifu.xdc.Transducer`

reorganize virtual fit and geo

remove gridweights

Unused enhancement

Update transducer.py

remove legacy scripts,
@peterhollender
Copy link
Copy Markdown
Contributor Author

peterhollender commented Apr 7, 2026

Interesting - the CI virtual environment isn't picking up the right dependencies (because the "no-option" version grabs a super-minimal set that won't have full functionality). Not sure how to address this? I'd really like pip install openlifu to get the primary dependencies with the [app] option, but I'm not sure how to make pyproject.toml do that

@peterhollender peterhollender force-pushed the p/init_install_cleanup branch from faba8a3 to c1e3ae3 Compare April 7, 2026 15:05
@ebrahimebrahim
Copy link
Copy Markdown
Collaborator

Interesting - the CI virtual environment isn't picking up the right dependencies (because the "no-option" version grabs a super-minimal set that won't have full functionality). Not sure how to address this? I'd really like pip install openlifu to get the primary dependencies with the [app] option, but I'm not sure how to make pyproject.toml do that

I think this is not possible, to make pip install openlifu default to pip install openlifu[app]. It will always be the minimal thing.

But that is completely fine, in my opinion. It is very reasonable to make the CI ofr example install pip install openlifu[app] or whatever we want, and to make the primary instructions be pip install openlifu[app] or wahtever. This is common and reasonable.

One way to achieve something like what you are saying is to rename this package to openlifu-core and make a new package called openlifu that thinly wraps it and that depends on openlifu-core[app]. But... eh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants