Skip to content

refactor import visit strategy, use separate visit_launcher module (try 2) #20494

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
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

cyrush
Copy link
Member

@cyrush cyrush commented Jul 18, 2025

Description

New branch and PR that supersedes: #20487

Resolves #18039 and #18884

Since Python3 we have had challenges with importing visit into a stand alone python interpreter due to module scoping and name spacing. In the past we provided an all in one module with a small front end that located a selected visit install, and then from there did a dynamic import. The delayed import caused issues with things like visit_utils, where were imported before visit was fully ready.

To resolve this, and avoid things like

import visit
visit.Launch()
import visit

The frontend logic is now in a separate module named visit_launcher

import visit_launcher
visit_launcher.Launch()
import visit

We will lose some functionally - visit_launcher.Launch() may only be able to launch for 3.5.0 or newer installs.

I still have a few things to iron out, but with the current implementation we can run the following:

import visit_launcher
visit_launcher.Launch(vdir="/Users/harrison37/Work/github/visit-dav/visit/build_dev/")

import visit
print(dir(visit))
from visit import *

import visit_utils
visit_utils.engine.open(vdir="/Users/harrison37/Work/github/visit-dav/visit/build_dev/")
OpenDatabase("/Users/harrison37/Desktop/visit_tutorial/current/data/rect3d.silo")
AddPlot("Pseudocolor","d")
DrawPlots()
SaveWindow()

Which we could not run before .

Type of change

  • Bug fix~~
  • New feature~~
  • Documentation update~~
  • Other~~

How Has This Been Tested?

Tested on macOS

Reminders:

  • Please follow the style guidelines of this project.
  • Please perform a self-review of your code before submitting a PR and asking others to review it.
  • Please assign reviewers (see VisIt's PR procedures for more information).

Checklist:

  • I have commented my code where applicable.~~
  • I have updated the release notes.~~
  • I have made corresponding changes to the documentation.~~
    - [ ] I have added debugging support to my changes.
    - [ ] I have added tests that prove my fix is effective or that my feature works.
    - [ ] I have confirmed new and existing unit tests pass locally with my changes.
    - [ ] I have added new baselines for any new tests to the repo.
    - [ ] I have NOT made any changes to protocol or public interfaces in an RC branch.

@cyrush cyrush requested a review from biagas July 18, 2025 20:29
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.

visit_launcher python module?
2 participants