Skip to content
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

Remove deprecated code for GUIs and obssim #439

Merged
merged 2 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 0 additions & 126 deletions docs/gui.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Appendices and Reference

available_opds.rst
references.rst
gui.rst
release.rst


Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Files containing such information as the JWST pupil shape, instrument throughput

for bash. (You will probably want to add this to your ``.bashrc``.)

You should now be able to successfully ``import webbpsf`` in a Python session, or start the GUI with the command ``webbpsfgui``.
You should now be able to successfully ``import webbpsf`` in a Python session.

.. warning::

Expand Down
2 changes: 0 additions & 2 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Conceptually, this simulation code has two layers of abstraction:
* A base package for wavefront propagation through generic optical systems (provided by :py:mod:`POPPY <poppy>`)
* Models of the JWST and Roman instruments implemented on top of that base system (provided by :py:mod:`WebbPSF <webbpsf>`)

(There has formerly been a basic GUI front end, but that GUI is now deprecated and no longer recommended for use.)

.. _intro_why_webbpsf:

Why WebbPSF?
Expand Down
55 changes: 1 addition & 54 deletions webbpsf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,6 @@ class Conf(_config.ConfigNamespace):

conf = Conf()

def _save_config():
""" Save package configuration variables using the Astropy.config system

NOTE: The functionality for saving config was was deprecated as of astropy v0.4
See http://astropy.readthedocs.org/en/latest/config/config_0_4_transition.html

This code is an undocumented workaround as advised by mdboom for the specific
purpose of saving webbpsf GUI state, logging state, and related.
"""

from astropy.config import configuration
configuration._save_config("webbpsf")

# add these here so we only need to cleanup the namespace at the end
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
Expand All @@ -111,7 +98,7 @@ def _save_config():
from . import utils
from .utils import setup_logging, restart_logging, system_diagnostic, measure_strehl

from poppy import ( display_psf, display_psf_difference, display_ee, measure_ee, # current names
from poppy import ( display_psf, display_psf_difference, display_ee, measure_ee,
display_profiles, radial_profile,
measure_radial, measure_fwhm, measure_sharpness, measure_centroid,
specFromSpectralType, fwcentroid)
Expand All @@ -123,45 +110,5 @@ def _save_config():

from .roman import WFI, CGI

# Temporally make "wfirst" available
from . import roman as wfirst

from .jupyter_gui import show_notebook_interface

try:
from .wxgui import wxgui
_HAVE_WX_GUI = True
except ImportError:
_HAVE_WX_GUI = False

try:
from .tkgui import tkgui
_HAVE_TK_GUI = True
except ImportError:
_HAVE_TK_GUI = False



#if (_HAVE_WX_GUI or _HAVE_TK_GUI):

#import warnings
#warnings.warn("Warning: Neither Tk nor wx GUIs could be imported. "
# "Graphical interface disabled")
#else:
def gui(preferred='wx'):
""" Start the WebbPSF GUI with the selected interface

Parameters
-------------
preferred : string
either 'wx' or 'ttk' to indicate which GUI toolkit should be started.


"""
if preferred == 'wx' and _HAVE_WX_GUI:
wxgui()
pass
elif preferred=='ttk' or _HAVE_TK_GUI:
tkgui()
else:
raise NotImplementedError("Neither TK nor WX GUI libraries are available. Cannot start GUI.")
Loading