From 197a1a7d90db72c2fb6bd24f86b878e6c71b294e Mon Sep 17 00:00:00 2001
From: Pey Lian Lim <2090236+pllim@users.noreply.github.com>
Date: Tue, 20 Feb 2018 14:20:57 -0500
Subject: [PATCH] Move out stale plugins. Update Travis. Misc minor cleanups.
---
.travis.yml | 20 ++---
MANIFEST.in | 1 +
astropy_helpers | 2 +-
docs/stginga/install.rst | 6 +-
docs/stginga/plugins_manual/index.rst | 19 +++--
docs/stginga/plugins_manual/mipick.rst | 2 +
docs/stginga/plugins_manual/multiimage.rst | 2 +
docs/stginga/plugins_manual/smoothing.rst | 2 +
experimental/README.rst | 7 ++
.../configs/plugin_Smoothing.cfg | 0
experimental/ginga_config.py | 80 +++++++++++++++++++
{stginga => experimental}/plugins/MIPick.py | 0
.../plugins/MultiImage.py | 0
.../plugins/Smoothing.py | 0
setup.cfg | 4 +-
stginga/gingawrapper.py | 73 -----------------
stginga/plugin_info.py | 14 ++--
stginga/tests/setup_package.py | 2 +-
18 files changed, 130 insertions(+), 104 deletions(-)
create mode 100644 experimental/README.rst
rename {stginga/examples => experimental}/configs/plugin_Smoothing.cfg (100%)
create mode 100644 experimental/ginga_config.py
rename {stginga => experimental}/plugins/MIPick.py (100%)
rename {stginga => experimental}/plugins/MultiImage.py (100%)
rename {stginga => experimental}/plugins/Smoothing.py (100%)
diff --git a/.travis.yml b/.travis.yml
index 64c3494..ca93cef 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,7 @@
language: python
python:
- - 2.7
- - 3.5
+ - 3.6
# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false
@@ -42,21 +41,22 @@ env:
matrix:
# Make sure that egg_info works without dependencies
- SETUP_CMD='egg_info'
- # DISABLED UNTIL WE HAVE REAL TESTS
- # Try all python versions with the latest numpy
- #- SETUP_CMD='test'
matrix:
include:
+ # Test in Python 2.
+ - python: 2.7
+ env: ASTROPY_VERSION=lts
+
# DISABLED FOR NOW
# Do a coverage test in Python 3.
- #- python: 3.5
+ #- python: 3.6
# env: SETUP_CMD='test --coverage'
# Check for sphinx doc build warnings - we do this first because it
# may run for a long time
- - python: 3.5
+ - python: 3.6
env: SETUP_CMD='build_docs -w'
PIP_DEPENDENCIES='ginga pandoc nbconvert tornado scipy'
@@ -65,9 +65,9 @@ matrix:
#- python: 3.6
# env: ASTROPY_VERSION=development
- # Do a PEP8 test with pycodestyle
- - python: 3.5
- env: MAIN_CMD='pycodestyle stginga --count' SETUP_CMD=''
+ # Do a PEP8 test with flake8
+ - python: 3.6
+ env: MAIN_CMD='flake8 stginga --count' SETUP_CMD=''
install:
diff --git a/MANIFEST.in b/MANIFEST.in
index 104ba14..1e317d6 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -11,6 +11,7 @@ recursive-include docs *
recursive-include licenses *
recursive-include cextern *
recursive-include scripts *
+recursive-include experimental *
prune build
prune docs/_build
diff --git a/astropy_helpers b/astropy_helpers
index d23a53f..41a6072 160000
--- a/astropy_helpers
+++ b/astropy_helpers
@@ -1 +1 @@
-Subproject commit d23a53f46dd1c3703e5eee63dca3f53bd18a4e8b
+Subproject commit 41a607235bdc335c9c125f828bdd35502a09aff9
diff --git a/docs/stginga/install.rst b/docs/stginga/install.rst
index ede9ef5..812bdfa 100644
--- a/docs/stginga/install.rst
+++ b/docs/stginga/install.rst
@@ -5,9 +5,9 @@ Installation
``stginga`` requires:
-* Astropy 1.1 or later.
-* SciPy 0.16 or later.
-* Ginga 2.6 or later, available from
+* Astropy 2.0 or later.
+* SciPy 0.18 or later.
+* Ginga 2.7 or later, available from
`Ginga's GitHub page `_.
* The latest version of ``stginga`` available from
`stginga's GitHub page `_.
diff --git a/docs/stginga/plugins_manual/index.rst b/docs/stginga/plugins_manual/index.rst
index c0f5085..51633a2 100644
--- a/docs/stginga/plugins_manual/index.rst
+++ b/docs/stginga/plugins_manual/index.rst
@@ -8,19 +8,12 @@ available, in addition to the ones that already come with Ginga. Some are
customizable via plugin configuration files, which are available in the
`stginga/examples/configs `_ directory.
+
.. _stginga-local-plugins:
Local Plugins
-------------
-These plugins work together to display the same object across multiple images:
-
-.. toctree::
- :maxdepth: 2
-
- multiimage
- mipick
-
These plugins behave like a regular Ginga plugin:
.. toctree::
@@ -40,6 +33,16 @@ one way is to use the ``--plugins`` option along with ``stginga`` command
:maxdepth: 2
mosaicauto
+
+These plugins are not actively maintained. If you really, really want to use
+them, see instructions at
+`experimental/README.rst `_:
+
+.. toctree::
+ :maxdepth: 2
+
+ mipick
+ multiimage
smoothing
diff --git a/docs/stginga/plugins_manual/mipick.rst b/docs/stginga/plugins_manual/mipick.rst
index f6dcfcd..56c058d 100644
--- a/docs/stginga/plugins_manual/mipick.rst
+++ b/docs/stginga/plugins_manual/mipick.rst
@@ -3,6 +3,8 @@
MIPick
======
+.. warning:: This is experimental; not actively maintain and might not work.
+
.. image:: images/mipick_screenshot.png
:width: 800px
:alt: MIPick plugin
diff --git a/docs/stginga/plugins_manual/multiimage.rst b/docs/stginga/plugins_manual/multiimage.rst
index 90ed88e..3eef4ff 100644
--- a/docs/stginga/plugins_manual/multiimage.rst
+++ b/docs/stginga/plugins_manual/multiimage.rst
@@ -3,6 +3,8 @@
MultiImage
==========
+.. warning:: This is experimental; not actively maintain and might not work.
+
.. image:: images/multiimage_screenshot.png
:width: 800px
:alt: MultiImage plugin
diff --git a/docs/stginga/plugins_manual/smoothing.rst b/docs/stginga/plugins_manual/smoothing.rst
index b382f6c..d7801de 100644
--- a/docs/stginga/plugins_manual/smoothing.rst
+++ b/docs/stginga/plugins_manual/smoothing.rst
@@ -3,6 +3,8 @@
Smoothing
---------
+.. warning:: This is experimental; not actively maintain and might not work.
+
.. image:: images/smoothing_before.png
:width: 800px
:alt: Smoothing plugin, before
diff --git a/experimental/README.rst b/experimental/README.rst
new file mode 100644
index 0000000..37755e6
--- /dev/null
+++ b/experimental/README.rst
@@ -0,0 +1,7 @@
+The plugins in this folder were developed during JWST DADF sprints and
+are not actively maintained. There is no guarantee that they still work.
+
+To use them anyway, copy them to ``~/.ginga/plugins`` and then use the
+``--plugins`` option when starting Ginga or ``stginga`` from the command line.
+For ``MultiImage`` and ``MIPick``, you also need to copy the
+``ginga_config.py`` file here to your ``~/.ginga`` directory.
diff --git a/stginga/examples/configs/plugin_Smoothing.cfg b/experimental/configs/plugin_Smoothing.cfg
similarity index 100%
rename from stginga/examples/configs/plugin_Smoothing.cfg
rename to experimental/configs/plugin_Smoothing.cfg
diff --git a/experimental/ginga_config.py b/experimental/ginga_config.py
new file mode 100644
index 0000000..686130d
--- /dev/null
+++ b/experimental/ginga_config.py
@@ -0,0 +1,80 @@
+multiimage_layout = ['seq', {}, [
+ 'vbox', {'name': 'top', 'width': 1520, 'height': 900},
+ {'row': ['hbox', {'name': 'menu'}], 'stretch': 0},
+ {'row': [
+ 'vpanel', {}, [
+ 'vbox', {},
+ {'row': [
+ 'hpanel', {'name': 'hpnl'}, [
+ 'ws', {'name': 'left', 'width': 300, 'group': 2}, [
+ ('Info', [
+ 'vpanel', {}, [
+ 'ws', {'name': 'uleft', 'height': 300,
+ 'show_tabs': False, 'group': 3}
+ ],
+ [
+ 'ws', {'name': 'lleft', 'height': 430,
+ 'show_tabs': True, 'group': 3}
+ ]
+ ])
+ ]
+ ],
+ [
+ 'vbox', {'name': 'main', 'width': 700},
+ {'row': [
+ 'ws', {'wstype': 'tabs', 'name': 'channels',
+ 'group': 1, 'use_toolbar': True}
+ ],
+ 'stretch': 1
+ },
+ {'row': [
+ 'ws', {'wstype': 'stack', 'name': 'cbar',
+ 'group': 99}
+ ],
+ 'stretch': 0
+ },
+ {'row': [
+ 'ws', {'wstype': 'stack', 'name': 'readout',
+ 'group': 99}
+ ],
+ 'stretch': 0
+ },
+ {'row': [
+ 'ws', {'wstype': 'stack', 'name': 'operations',
+ 'group': 99}
+ ],
+ 'stretch': 0
+ }
+ ],
+ [
+ 'ws', {'name': 'right', 'width': 430, 'group': 2}, [
+ ('Dialogs', [
+ 'ws', {'name': 'dialogs', 'group': 2}
+ ])
+ ]
+ ]
+ ],
+ 'stretch': 1}, [
+ 'ws', {'name': 'toolbar', 'height': 40,
+ 'show_tabs': False, 'group': 2}
+ ]
+ ],
+ [
+ 'hbox', {'name': 'pstamps'}
+ ],
+ ]},
+ {'row': [
+ 'hbox', {'name': 'status'}
+ ],
+ 'stretch': 0
+ }
+]]
+
+
+def pre_gui_config(ginga):
+ # This is needed for MultiImage and MIPick
+ ginga.set_layout(multiimage_layout)
+
+
+def post_gui_config(ginga):
+ pass
diff --git a/stginga/plugins/MIPick.py b/experimental/plugins/MIPick.py
similarity index 100%
rename from stginga/plugins/MIPick.py
rename to experimental/plugins/MIPick.py
diff --git a/stginga/plugins/MultiImage.py b/experimental/plugins/MultiImage.py
similarity index 100%
rename from stginga/plugins/MultiImage.py
rename to experimental/plugins/MultiImage.py
diff --git a/stginga/plugins/Smoothing.py b/experimental/plugins/Smoothing.py
similarity index 100%
rename from stginga/plugins/Smoothing.py
rename to experimental/plugins/Smoothing.py
diff --git a/setup.cfg b/setup.cfg
index da28563..8af3aa3 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -14,8 +14,8 @@ norecursedirs = build docs/_build
[ah_bootstrap]
auto_use = True
-[pycodestyle]
-exclude = extern,sphinx
+[flake8]
+exclude = conf.py,conftest.py,__init__.py,_astropy_init.py
[metadata]
package_name = stginga
diff --git a/stginga/gingawrapper.py b/stginga/gingawrapper.py
index 4d05eb5..4221d4c 100644
--- a/stginga/gingawrapper.py
+++ b/stginga/gingawrapper.py
@@ -13,79 +13,6 @@
__all__ = ['run_stginga']
-# Manage the default layout. Yes, OMG, hacky hacky
-gmain.default_layout = ['seq', {}, [
- 'vbox', {'name': 'top', 'width': 1520, 'height': 900},
- {'row': ['hbox', {'name': 'menu'}], 'stretch': 0},
- {'row': [
- 'vpanel', {}, [
- 'vbox', {},
- {'row': [
- 'hpanel', {'name': 'hpnl'}, [
- 'ws', {'name': 'left', 'width': 300, 'group': 2}, [
- ('Info', [
- 'vpanel', {}, [
- 'ws', {'name': 'uleft', 'height': 300,
- 'show_tabs': False, 'group': 3}
- ],
- [
- 'ws', {'name': 'lleft', 'height': 430,
- 'show_tabs': True, 'group': 3}
- ]
- ])
- ]
- ],
- [
- 'vbox', {'name': 'main', 'width': 700},
- {'row': [
- 'ws', {'wstype': 'tabs', 'name': 'channels',
- 'group': 1, 'use_toolbar': True}
- ],
- 'stretch': 1
- },
- {'row': [
- 'ws', {'wstype': 'stack', 'name': 'cbar',
- 'group': 99}
- ],
- 'stretch': 0
- },
- {'row': [
- 'ws', {'wstype': 'stack', 'name': 'readout',
- 'group': 99}
- ],
- 'stretch': 0
- },
- {'row': [
- 'ws', {'wstype': 'stack', 'name': 'operations',
- 'group': 99}
- ],
- 'stretch': 0
- }
- ],
- [
- 'ws', {'name': 'right', 'width': 430, 'group': 2}, [
- ('Dialogs', [
- 'ws', {'name': 'dialogs', 'group': 2}
- ])
- ]
- ]
- ],
- 'stretch': 1}, [
- 'ws', {'name': 'toolbar', 'height': 40,
- 'show_tabs': False, 'group': 2}
- ]
- ],
- [
- 'hbox', {'name': 'pstamps'}
- ],
- ]},
- {'row': [
- 'hbox', {'name': 'status'}
- ],
- 'stretch': 0
- }
-]]
-
def run_stginga(sys_argv):
"""Run this from command line.
diff --git a/stginga/plugin_info.py b/stginga/plugin_info.py
index 14fa307..ea74bf9 100644
--- a/stginga/plugin_info.py
+++ b/stginga/plugin_info.py
@@ -44,12 +44,14 @@ def _get_stginga_plugins():
global_plugins = []
local_plugins = [
- Bunch(module='MultiImage', ws='dialogs', pfx=gpfx),
- Bunch(module='MIPick', ws='dialogs', pfx=gpfx),
- Bunch(module='BackgroundSub', ws='dialogs', pfx=gpfx),
- Bunch(module='BadPixCorr', ws='dialogs', pfx=gpfx),
- Bunch(module='DQInspect', ws='dialogs', pfx=gpfx),
- Bunch(module='SNRCalc', ws='dialogs', pfx=gpfx),
+ Bunch(module='BackgroundSub', workspace='dialogs', pfx=gpfx,
+ category='stginga', ptype='local'),
+ Bunch(module='BadPixCorr', workspace='dialogs', pfx=gpfx,
+ category='stginga', ptype='local'),
+ Bunch(module='DQInspect', workspace='dialogs', pfx=gpfx,
+ category='stginga', ptype='local'),
+ Bunch(module='SNRCalc', workspace='dialogs', pfx=gpfx,
+ category='stginga', ptype='local'),
]
return global_plugins, local_plugins
diff --git a/stginga/tests/setup_package.py b/stginga/tests/setup_package.py
index f2fd9ed..63d7195 100644
--- a/stginga/tests/setup_package.py
+++ b/stginga/tests/setup_package.py
@@ -1,3 +1,3 @@
def get_package_data():
return {
- _ASTROPY_PACKAGE_NAME_ + '.tests': ['coveragerc']}
+ 'stginga.tests': ['coveragerc']}