Skip to content

Commit

Permalink
only warn once
Browse files Browse the repository at this point in the history
  • Loading branch information
BradleySappington committed Dec 18, 2024
1 parent 3e13ca5 commit 3c1936b
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions webbpsf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,35 @@
import sys
import warnings

warnings.warn(
""""

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This message is for information only and WebbPSF will continue to function as normal:
_warned = False

THE WEBBPSF LIBRARY HAS BEEN MOVED
All existing WebbPSF functionality has been migrated to the newly made STPSF respository.
if not _warned:
warnings.warn(
""""
If you would like to switch to the new repository:
Please update your code to use STPSF instead of WebbPSF.
https://github.com/spacetelescope/stpsf
or
pip install stpsf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This message is for information only and WebbPSF will continue to function as normal:
STPSF Functionality is currently the same as WebbPSF, only the name is different.
WebbPSF is now an alias of STPSF and is running code from the STPSF library.
THE WEBBPSF LIBRARY HAS BEEN MOVED
All existing WebbPSF functionality has been migrated to the newly made STPSF respository.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
If you would like to switch to the new repository:
Please update your code to use STPSF instead of WebbPSF.
https://github.com/spacetelescope/stpsf
or
pip install stpsf
""",
DeprecationWarning,
stacklevel=2, # Shows the webbpsf import code
)
STPSF Functionality is currently the same as WebbPSF, only the name is different.
WebbPSF is now an alias of STPSF and is running code from the STPSF library.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
""",
DeprecationWarning,
stacklevel=2, # Shows the webbpsf import code
)
_warned = True

sys.modules["webbpsf"] = stpsf

Expand Down

0 comments on commit 3c1936b

Please sign in to comment.