Skip to content

Raise ImportError for missing 'hstcal' binaries#168

Draft
sean-lockwood wants to merge 2 commits into
masterfrom
sl_check-hstcal
Draft

Raise ImportError for missing 'hstcal' binaries#168
sean-lockwood wants to merge 2 commits into
masterfrom
sl_check-hstcal

Conversation

@sean-lockwood

@sean-lockwood sean-lockwood commented Dec 4, 2024

Copy link
Copy Markdown
Member

Check the $PATH for hstcal binaries (cs0.e) when importing stistools. Raise an ImportError if this is not found. Skips this check on RTD.

… Raise an ImportError if this is not found. This should hopefully eliminate half of our help calls.
@sean-lockwood

Copy link
Copy Markdown
Member Author

@stscirij -
Any problem raising an error on import like this?

@stscirij

stscirij commented Dec 4, 2024

Copy link
Copy Markdown
Contributor

I think this seems reasonable, although it probably won't work under Windows :)

@sean-lockwood

Copy link
Copy Markdown
Member Author

Looks like hstcal doesn't support Windows anyway:

image

@sean-lockwood

Copy link
Copy Markdown
Member Author

Some of the stistools routines don't require an hstcal binary. Perhaps we should more precisely where to put this check?

@sean-lockwood

Copy link
Copy Markdown
Member Author

Less invasive alternatives:

  1. Issue a warning instead
  2. Move check into relevant functions:
basic2d.basic2d
calstis.calstis
ocrreject.ocrreject
wavecal.wavecal
wavecal.runBasic2d
wavecal.runCs11
wavecal.runWavecal
wavecal.runX2d
wavecal.runCs12
x1d.x1d
x2d.x2d

(`*.main` functions are not used, so probably don't need to be updated.)

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