From 3a5a761fd6a2a4a88a3bb40149334ec0a3b751c7 Mon Sep 17 00:00:00 2001 From: Matthew Bourque Date: Mon, 27 Aug 2018 15:27:49 -0400 Subject: [PATCH 1/7] Initial moves to restructure the repository. Also created instrument_monitors subpackage. --- jwql/{logging => instrument_monitors}/__init__.py | 0 .../fgs_monitors}/__init__.py | 0 .../miri_monitors}/__init__.py | 0 .../nircam_monitors}/__init__.py | 0 .../niriss_monitors}/__init__.py | 0 jwql/instrument_monitors/nirspec_monitors/__init__.py | 0 jwql/jwql_monitors/__init__.py | 0 jwql/{preview_image => jwql_monitors}/generate_preview_images.py | 0 jwql/{monitor_filesystem => jwql_monitors}/monitor_filesystem.py | 0 jwql/{monitor_mast => jwql_monitors}/monitor_mast.py | 0 jwql/{logging => utils}/logging_functions.py | 0 jwql/{permissions => utils}/permissions.py | 0 jwql/{preview_image => utils}/preview_image.py | 0 {typing_demo => style_guide/typing_demo}/typing_demo_1.py | 0 {typing_demo => style_guide/typing_demo}/typing_demo_2.py | 0 {typing_demo => style_guide/typing_demo}/typing_demo_3.py | 0 {typing_demo => style_guide/typing_demo}/typing_demo_4.py | 0 17 files changed, 0 insertions(+), 0 deletions(-) rename jwql/{logging => instrument_monitors}/__init__.py (100%) rename jwql/{monitor_filesystem => instrument_monitors/fgs_monitors}/__init__.py (100%) mode change 100755 => 100644 rename jwql/{monitor_mast => instrument_monitors/miri_monitors}/__init__.py (100%) rename jwql/{permissions => instrument_monitors/nircam_monitors}/__init__.py (100%) rename jwql/{preview_image => instrument_monitors/niriss_monitors}/__init__.py (100%) mode change 100755 => 100644 create mode 100644 jwql/instrument_monitors/nirspec_monitors/__init__.py create mode 100644 jwql/jwql_monitors/__init__.py rename jwql/{preview_image => jwql_monitors}/generate_preview_images.py (100%) rename jwql/{monitor_filesystem => jwql_monitors}/monitor_filesystem.py (100%) rename jwql/{monitor_mast => jwql_monitors}/monitor_mast.py (100%) rename jwql/{logging => utils}/logging_functions.py (100%) rename jwql/{permissions => utils}/permissions.py (100%) rename jwql/{preview_image => utils}/preview_image.py (100%) rename {typing_demo => style_guide/typing_demo}/typing_demo_1.py (100%) rename {typing_demo => style_guide/typing_demo}/typing_demo_2.py (100%) rename {typing_demo => style_guide/typing_demo}/typing_demo_3.py (100%) rename {typing_demo => style_guide/typing_demo}/typing_demo_4.py (100%) diff --git a/jwql/logging/__init__.py b/jwql/instrument_monitors/__init__.py similarity index 100% rename from jwql/logging/__init__.py rename to jwql/instrument_monitors/__init__.py diff --git a/jwql/monitor_filesystem/__init__.py b/jwql/instrument_monitors/fgs_monitors/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from jwql/monitor_filesystem/__init__.py rename to jwql/instrument_monitors/fgs_monitors/__init__.py diff --git a/jwql/monitor_mast/__init__.py b/jwql/instrument_monitors/miri_monitors/__init__.py similarity index 100% rename from jwql/monitor_mast/__init__.py rename to jwql/instrument_monitors/miri_monitors/__init__.py diff --git a/jwql/permissions/__init__.py b/jwql/instrument_monitors/nircam_monitors/__init__.py similarity index 100% rename from jwql/permissions/__init__.py rename to jwql/instrument_monitors/nircam_monitors/__init__.py diff --git a/jwql/preview_image/__init__.py b/jwql/instrument_monitors/niriss_monitors/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from jwql/preview_image/__init__.py rename to jwql/instrument_monitors/niriss_monitors/__init__.py diff --git a/jwql/instrument_monitors/nirspec_monitors/__init__.py b/jwql/instrument_monitors/nirspec_monitors/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/jwql/jwql_monitors/__init__.py b/jwql/jwql_monitors/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/jwql/preview_image/generate_preview_images.py b/jwql/jwql_monitors/generate_preview_images.py similarity index 100% rename from jwql/preview_image/generate_preview_images.py rename to jwql/jwql_monitors/generate_preview_images.py diff --git a/jwql/monitor_filesystem/monitor_filesystem.py b/jwql/jwql_monitors/monitor_filesystem.py similarity index 100% rename from jwql/monitor_filesystem/monitor_filesystem.py rename to jwql/jwql_monitors/monitor_filesystem.py diff --git a/jwql/monitor_mast/monitor_mast.py b/jwql/jwql_monitors/monitor_mast.py similarity index 100% rename from jwql/monitor_mast/monitor_mast.py rename to jwql/jwql_monitors/monitor_mast.py diff --git a/jwql/logging/logging_functions.py b/jwql/utils/logging_functions.py similarity index 100% rename from jwql/logging/logging_functions.py rename to jwql/utils/logging_functions.py diff --git a/jwql/permissions/permissions.py b/jwql/utils/permissions.py similarity index 100% rename from jwql/permissions/permissions.py rename to jwql/utils/permissions.py diff --git a/jwql/preview_image/preview_image.py b/jwql/utils/preview_image.py similarity index 100% rename from jwql/preview_image/preview_image.py rename to jwql/utils/preview_image.py diff --git a/typing_demo/typing_demo_1.py b/style_guide/typing_demo/typing_demo_1.py similarity index 100% rename from typing_demo/typing_demo_1.py rename to style_guide/typing_demo/typing_demo_1.py diff --git a/typing_demo/typing_demo_2.py b/style_guide/typing_demo/typing_demo_2.py similarity index 100% rename from typing_demo/typing_demo_2.py rename to style_guide/typing_demo/typing_demo_2.py diff --git a/typing_demo/typing_demo_3.py b/style_guide/typing_demo/typing_demo_3.py similarity index 100% rename from typing_demo/typing_demo_3.py rename to style_guide/typing_demo/typing_demo_3.py diff --git a/typing_demo/typing_demo_4.py b/style_guide/typing_demo/typing_demo_4.py similarity index 100% rename from typing_demo/typing_demo_4.py rename to style_guide/typing_demo/typing_demo_4.py From 9a0111cc80fc12287989ecbf6111f62b8f4369b6 Mon Sep 17 00:00:00 2001 From: Matthew Bourque Date: Tue, 28 Aug 2018 14:53:33 -0400 Subject: [PATCH 2/7] Updated sphinx docs to reflect new repo organization --- docs/source/jwql_monitors.rst | 15 +++++++++++++++ docs/source/logging.rst | 7 ------- docs/source/monitor_filesystem.rst | 7 ------- docs/source/monitor_mast.rst | 7 ------- docs/source/permissions.rst | 7 ------- docs/source/preview_image.rst | 15 --------------- docs/source/tests.rst | 8 ++++++-- docs/source/utils.rst | 13 +++++++++++++ 8 files changed, 34 insertions(+), 45 deletions(-) create mode 100644 docs/source/jwql_monitors.rst delete mode 100644 docs/source/logging.rst delete mode 100755 docs/source/monitor_filesystem.rst delete mode 100644 docs/source/monitor_mast.rst delete mode 100644 docs/source/permissions.rst delete mode 100644 docs/source/preview_image.rst diff --git a/docs/source/jwql_monitors.rst b/docs/source/jwql_monitors.rst new file mode 100644 index 000000000..cb7d9fd8f --- /dev/null +++ b/docs/source/jwql_monitors.rst @@ -0,0 +1,15 @@ +************* +jwql_monitors +************* + +.. automodule:: jwql.jwql_monitors.monitor_filesystem + :members: + :undoc-members: + +.. automodule:: jwql.jwql_monitors.generate_preview_images + :members: + :undoc-members: + +.. automodule:: jwql.jwql_monitors.monitor_mast + :members: + :undoc-members: \ No newline at end of file diff --git a/docs/source/logging.rst b/docs/source/logging.rst deleted file mode 100644 index f2b6fa513..000000000 --- a/docs/source/logging.rst +++ /dev/null @@ -1,7 +0,0 @@ -******* -logging -******* - -.. automodule:: jwql.logging.logging_functions - :members: - :undoc-members: \ No newline at end of file diff --git a/docs/source/monitor_filesystem.rst b/docs/source/monitor_filesystem.rst deleted file mode 100755 index 017ddaef0..000000000 --- a/docs/source/monitor_filesystem.rst +++ /dev/null @@ -1,7 +0,0 @@ -****************** -monitor_filesystem -****************** - -.. automodule:: jwql.monitor_filesystem.monitor_filesystem - :members: - :undoc-members: \ No newline at end of file diff --git a/docs/source/monitor_mast.rst b/docs/source/monitor_mast.rst deleted file mode 100644 index f4e3a9775..000000000 --- a/docs/source/monitor_mast.rst +++ /dev/null @@ -1,7 +0,0 @@ -************ -monitor_mast -************ - -.. automodule:: jwql.monitor_mast.monitor_mast - :members: - :undoc-members: diff --git a/docs/source/permissions.rst b/docs/source/permissions.rst deleted file mode 100644 index 08bddb3e6..000000000 --- a/docs/source/permissions.rst +++ /dev/null @@ -1,7 +0,0 @@ -*********** -permissions -*********** - -.. automodule:: jwql.permissions.permissions - :members: - :undoc-members: diff --git a/docs/source/preview_image.rst b/docs/source/preview_image.rst deleted file mode 100644 index c0d3f9119..000000000 --- a/docs/source/preview_image.rst +++ /dev/null @@ -1,15 +0,0 @@ -************* -preview_image -************* - -.. automodule:: jwql.preview_image.preview_image - :members: - :undoc-members: - -*********************** -generate_preview_images -*********************** - -.. automodule:: jwql.preview_image.generate_preview_images - :members: - :undoc-members: diff --git a/docs/source/tests.rst b/docs/source/tests.rst index 02d12f2a0..31a1a798b 100644 --- a/docs/source/tests.rst +++ b/docs/source/tests.rst @@ -4,12 +4,16 @@ tests .. automodule:: jwql.tests.test_monitor_mast :members: + :undoc-members: .. automodule:: jwql.tests.test_permissions :members: + :undoc-members: -.. automodule:: jwql.tests.test_utils +.. automodule:: jwql.tests.test_preview_image :members: + :undoc-members: -.. automodule:: jwql.tests.test_preview_image +.. automodule:: jwql.tests.test_utils :members: + :undoc-members: \ No newline at end of file diff --git a/docs/source/utils.rst b/docs/source/utils.rst index 2abe92d9c..26b7eabe0 100644 --- a/docs/source/utils.rst +++ b/docs/source/utils.rst @@ -2,5 +2,18 @@ utils ***** +.. automodule:: jwql.utils.logging_functions + :members: + :undoc-members: + +.. automodule:: jwql.utils.permissions + :members: + :undoc-members: + +.. automodule:: jwql.utils.preview_image + :members: + :undoc-members: + .. automodule:: jwql.utils.utils :members: + :undoc-members: \ No newline at end of file From c6a014f7c036bc9766af935ed5233370dd8f3cfa Mon Sep 17 00:00:00 2001 From: Matthew Bourque Date: Tue, 28 Aug 2018 15:28:07 -0400 Subject: [PATCH 3/7] Added new jwql_monitors rst file to index --- docs/source/index.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 5e7a85965..b67f14199 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -20,14 +20,9 @@ API documentation :caption: Contents: database.rst - logging.rst - monitor_filesystem.rst - monitor_mast.rst - permissions.rst - preview_image.rst + jwql_monitors.rst utils.rst tests.rst - monitor_filesystem.rst Indices and tables From 6ba7a96935d0026ce83579c9159f3e38bfc40b7a Mon Sep 17 00:00:00 2001 From: Matthew Bourque Date: Tue, 28 Aug 2018 15:28:58 -0400 Subject: [PATCH 4/7] Updated imports to reflect new repo organization. Switched to using relative imports. --- jwql/__init__.py | 1 - jwql/jwql_monitors/generate_preview_images.py | 26 +++++++++---------- jwql/jwql_monitors/monitor_filesystem.py | 8 +++--- jwql/jwql_monitors/monitor_mast.py | 6 ++--- jwql/tests/test_monitor_mast.py | 2 +- jwql/tests/test_permissions.py | 2 +- jwql/tests/test_preview_image.py | 2 +- jwql/tests/test_utils.py | 2 +- jwql/utils/logging_functions.py | 4 +-- jwql/utils/preview_image.py | 2 +- jwql/utils/utils.py | 2 +- 11 files changed, 28 insertions(+), 29 deletions(-) diff --git a/jwql/__init__.py b/jwql/__init__.py index 8ae149028..e69de29bb 100644 --- a/jwql/__init__.py +++ b/jwql/__init__.py @@ -1 +0,0 @@ -from . import monitor_mast \ No newline at end of file diff --git a/jwql/jwql_monitors/generate_preview_images.py b/jwql/jwql_monitors/generate_preview_images.py index fd3e16c2a..09c8e911a 100755 --- a/jwql/jwql_monitors/generate_preview_images.py +++ b/jwql/jwql_monitors/generate_preview_images.py @@ -33,15 +33,15 @@ import numpy as np -from jwql.logging.logging_functions import configure_logging -from jwql.logging.logging_functions import log_info -from jwql.logging.logging_functions import log_fail -from jwql.permissions import permissions -from jwql.preview_image.preview_image import PreviewImage -from jwql.utils.utils import get_config -from jwql.utils.utils import filename_parser -from jwql.utils.utils import NIRCAM_LONGWAVE_DETECTORS -from jwql.utils.utils import NIRCAM_SHORTWAVE_DETECTORS +from ..utils import permissions +from ..utils.logging_functions import configure_logging +from ..utils.logging_functions import log_info +from ..utils.logging_functions import log_fail +from ..utils.preview_image import PreviewImage +from ..utils.utils import get_config +from ..utils.utils import filename_parser +from ..utils.utils import NIRCAM_LONGWAVE_DETECTORS +from ..utils.utils import NIRCAM_SHORTWAVE_DETECTORS # Size of NIRCam inter- and intra-module chip gaps SW_MOD_GAP = 1387 # pixels = int(43 arcsec / 0.031 arcsec/pixel) @@ -60,10 +60,10 @@ def array_coordinates(channelmod, detector_list, lowerleft_list): channelmod : str Indicator of the NIRCam channel/module of the data. Options are: - ``LW`` - for longwave channel data - ``SWA`` - for shortwave A module only (4 detectors) data - ``SWB`` - for shortwave B module only (4 detectors) data - ``SW`` - for shortwave both module data (8 detectors) + ``LW`` - for longwave channel data + ``SWA`` - for shortwave A module only (4 detectors) data + ``SWB`` - for shortwave B module only (4 detectors) data + ``SW`` - for shortwave both module data (8 detectors) detector_list : list List of detectors used in data to be simulated diff --git a/jwql/jwql_monitors/monitor_filesystem.py b/jwql/jwql_monitors/monitor_filesystem.py index f798dc552..998f0ac94 100755 --- a/jwql/jwql_monitors/monitor_filesystem.py +++ b/jwql/jwql_monitors/monitor_filesystem.py @@ -70,10 +70,10 @@ from bokeh.layouts import gridplot from bokeh.plotting import figure, output_file, save -from jwql.logging.logging_functions import configure_logging, log_info, log_fail -from jwql.permissions.permissions import set_permissions -from jwql.utils.utils import filename_parser -from jwql.utils.utils import get_config +from ..utils.logging_functions import configure_logging, log_info, log_fail +from ..utils.permissions import set_permissions +from ..utils.utils import filename_parser +from ..utils.utils import get_config @log_fail diff --git a/jwql/jwql_monitors/monitor_mast.py b/jwql/jwql_monitors/monitor_mast.py index 043b7f8c9..c5d7c7520 100644 --- a/jwql/jwql_monitors/monitor_mast.py +++ b/jwql/jwql_monitors/monitor_mast.py @@ -24,9 +24,9 @@ from bokeh.embed import components import pandas as pd -from jwql.logging.logging_functions import configure_logging, log_info, log_fail -from jwql.permissions.permissions import set_permissions -from jwql.utils.utils import get_config, JWST_DATAPRODUCTS, JWST_INSTRUMENTS +from ..utils.logging_functions import configure_logging, log_info, log_fail +from ..utils.permissions import set_permissions +from ..utils.utils import get_config, JWST_DATAPRODUCTS, JWST_INSTRUMENTS def instrument_inventory(instrument, dataproduct=JWST_DATAPRODUCTS, diff --git a/jwql/tests/test_monitor_mast.py b/jwql/tests/test_monitor_mast.py index edb5664fa..d6ec98e89 100755 --- a/jwql/tests/test_monitor_mast.py +++ b/jwql/tests/test_monitor_mast.py @@ -17,7 +17,7 @@ pytest -s test_monitor_mast.py """ -from ..monitor_mast import monitor_mast as mm +from ..jwql_monitors import monitor_mast as mm from ..utils.utils import JWST_INSTRUMENTS diff --git a/jwql/tests/test_permissions.py b/jwql/tests/test_permissions.py index bcb455c6e..a211d8d0b 100755 --- a/jwql/tests/test_permissions.py +++ b/jwql/tests/test_permissions.py @@ -23,7 +23,7 @@ import os import pytest -from jwql.permissions.permissions import set_permissions, has_permissions, \ +from ..utils.permissions import set_permissions, has_permissions, \ get_owner_string, get_group_string # directory to be created and populated during tests running diff --git a/jwql/tests/test_preview_image.py b/jwql/tests/test_preview_image.py index 568624b8b..c16ce6dd9 100644 --- a/jwql/tests/test_preview_image.py +++ b/jwql/tests/test_preview_image.py @@ -25,7 +25,7 @@ from astropy.io import fits -from jwql.preview_image.preview_image import PreviewImage +from ..utils.preview_image import PreviewImage # directory to be created and populated during tests running TEST_DIRECTORY = os.path.join(os.environ['HOME'], 'preview_image_test') diff --git a/jwql/tests/test_utils.py b/jwql/tests/test_utils.py index 9a72a5baa..f0f1767ad 100644 --- a/jwql/tests/test_utils.py +++ b/jwql/tests/test_utils.py @@ -19,7 +19,7 @@ import pytest -from jwql.utils.utils import get_config, filename_parser +from ..utils.utils import get_config, filename_parser @pytest.mark.xfail def test_get_config(): diff --git a/jwql/utils/logging_functions.py b/jwql/utils/logging_functions.py index c5f0e6d71..60d200bb2 100644 --- a/jwql/utils/logging_functions.py +++ b/jwql/utils/logging_functions.py @@ -65,8 +65,8 @@ def my_main_function(): from functools import wraps -from jwql.permissions.permissions import set_permissions -from jwql.utils.utils import get_config, ensure_dir_exists +from ..utils.permissions import set_permissions +from ..utils.utils import get_config, ensure_dir_exists LOG_FILE_LOC = '' PRODUCTION_BOOL = '' diff --git a/jwql/utils/preview_image.py b/jwql/utils/preview_image.py index 44dd7c516..47df53dec 100755 --- a/jwql/utils/preview_image.py +++ b/jwql/utils/preview_image.py @@ -41,7 +41,7 @@ from jwst.datamodels import dqflags import numpy as np -from jwql.permissions import permissions +from ..utils import permissions # Use the 'Agg' backend to avoid invoking $DISPLAY import matplotlib diff --git a/jwql/utils/utils.py b/jwql/utils/utils.py index f6ddf89bd..82d9345ad 100644 --- a/jwql/utils/utils.py +++ b/jwql/utils/utils.py @@ -25,7 +25,7 @@ import os import re -from ..permissions import permissions +from . import permissions __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) From dbbea89363abb527e119fe3050ac400d0e68b8b2 Mon Sep 17 00:00:00 2001 From: Matthew Bourque Date: Tue, 11 Sep 2018 11:03:21 -0400 Subject: [PATCH 5/7] Switching back to absolute imports. --- jwql/database/database_interface.py | 2 +- jwql/jwql_monitors/generate_preview_images.py | 18 +++++++++--------- jwql/jwql_monitors/monitor_filesystem.py | 8 ++++---- jwql/jwql_monitors/monitor_mast.py | 6 +++--- jwql/tests/test_monitor_mast.py | 4 ++-- jwql/tests/test_permissions.py | 2 +- jwql/tests/test_preview_image.py | 2 +- jwql/tests/test_utils.py | 2 +- jwql/utils/logging_functions.py | 4 ++-- jwql/utils/preview_image.py | 2 +- jwql/utils/utils.py | 2 +- jwql/website/apps/jwql/data_containers.py | 2 +- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/jwql/database/database_interface.py b/jwql/database/database_interface.py index 591d00906..dc80873ed 100644 --- a/jwql/database/database_interface.py +++ b/jwql/database/database_interface.py @@ -38,7 +38,7 @@ from sqlalchemy.orm import sessionmaker from sqlalchemy.orm.query import Query -from ..utils import utils +from jwql.utils import utils SETTINGS = utils.get_config() diff --git a/jwql/jwql_monitors/generate_preview_images.py b/jwql/jwql_monitors/generate_preview_images.py index 09c8e911a..be78072fa 100755 --- a/jwql/jwql_monitors/generate_preview_images.py +++ b/jwql/jwql_monitors/generate_preview_images.py @@ -33,15 +33,15 @@ import numpy as np -from ..utils import permissions -from ..utils.logging_functions import configure_logging -from ..utils.logging_functions import log_info -from ..utils.logging_functions import log_fail -from ..utils.preview_image import PreviewImage -from ..utils.utils import get_config -from ..utils.utils import filename_parser -from ..utils.utils import NIRCAM_LONGWAVE_DETECTORS -from ..utils.utils import NIRCAM_SHORTWAVE_DETECTORS +from jwql.utils import permissions +from jwql.utils.logging_functions import configure_logging +from jwql.utils.logging_functions import log_info +from jwql.utils.logging_functions import log_fail +from jwql.utils.preview_image import PreviewImage +from jwql.utils.utils import get_config +from jwql.utils.utils import filename_parser +from jwql.utils.utils import NIRCAM_LONGWAVE_DETECTORS +from jwql.utils.utils import NIRCAM_SHORTWAVE_DETECTORS # Size of NIRCam inter- and intra-module chip gaps SW_MOD_GAP = 1387 # pixels = int(43 arcsec / 0.031 arcsec/pixel) diff --git a/jwql/jwql_monitors/monitor_filesystem.py b/jwql/jwql_monitors/monitor_filesystem.py index 998f0ac94..9198b103e 100755 --- a/jwql/jwql_monitors/monitor_filesystem.py +++ b/jwql/jwql_monitors/monitor_filesystem.py @@ -70,10 +70,10 @@ from bokeh.layouts import gridplot from bokeh.plotting import figure, output_file, save -from ..utils.logging_functions import configure_logging, log_info, log_fail -from ..utils.permissions import set_permissions -from ..utils.utils import filename_parser -from ..utils.utils import get_config +from jwql.utils.logging_functions import configure_logging, log_info, log_fail +from jwql.utils.permissions import set_permissions +from jwql.utils.utils import filename_parser +from jwql.utils.utils import get_config @log_fail diff --git a/jwql/jwql_monitors/monitor_mast.py b/jwql/jwql_monitors/monitor_mast.py index c5d7c7520..61daf726a 100644 --- a/jwql/jwql_monitors/monitor_mast.py +++ b/jwql/jwql_monitors/monitor_mast.py @@ -24,9 +24,9 @@ from bokeh.embed import components import pandas as pd -from ..utils.logging_functions import configure_logging, log_info, log_fail -from ..utils.permissions import set_permissions -from ..utils.utils import get_config, JWST_DATAPRODUCTS, JWST_INSTRUMENTS +from jwql.utils.logging_functions import configure_logging, log_info, log_fail +from jwql.utils.permissions import set_permissions +from jwql.utils.utils import get_config, JWST_DATAPRODUCTS, JWST_INSTRUMENTS def instrument_inventory(instrument, dataproduct=JWST_DATAPRODUCTS, diff --git a/jwql/tests/test_monitor_mast.py b/jwql/tests/test_monitor_mast.py index d6ec98e89..062740070 100755 --- a/jwql/tests/test_monitor_mast.py +++ b/jwql/tests/test_monitor_mast.py @@ -17,8 +17,8 @@ pytest -s test_monitor_mast.py """ -from ..jwql_monitors import monitor_mast as mm -from ..utils.utils import JWST_INSTRUMENTS +from jwql.jwql_monitors import monitor_mast as mm +from jwql.utils.utils import JWST_INSTRUMENTS def test_caom_instrument_keywords(): diff --git a/jwql/tests/test_permissions.py b/jwql/tests/test_permissions.py index a211d8d0b..83a94aa7f 100755 --- a/jwql/tests/test_permissions.py +++ b/jwql/tests/test_permissions.py @@ -23,7 +23,7 @@ import os import pytest -from ..utils.permissions import set_permissions, has_permissions, \ +from jwql.utils.permissions import set_permissions, has_permissions, \ get_owner_string, get_group_string # directory to be created and populated during tests running diff --git a/jwql/tests/test_preview_image.py b/jwql/tests/test_preview_image.py index c16ce6dd9..4f2faa658 100644 --- a/jwql/tests/test_preview_image.py +++ b/jwql/tests/test_preview_image.py @@ -25,7 +25,7 @@ from astropy.io import fits -from ..utils.preview_image import PreviewImage +from jwql.utils.preview_image import PreviewImage # directory to be created and populated during tests running TEST_DIRECTORY = os.path.join(os.environ['HOME'], 'preview_image_test') diff --git a/jwql/tests/test_utils.py b/jwql/tests/test_utils.py index f0f1767ad..9a72a5baa 100644 --- a/jwql/tests/test_utils.py +++ b/jwql/tests/test_utils.py @@ -19,7 +19,7 @@ import pytest -from ..utils.utils import get_config, filename_parser +from jwql.utils.utils import get_config, filename_parser @pytest.mark.xfail def test_get_config(): diff --git a/jwql/utils/logging_functions.py b/jwql/utils/logging_functions.py index 60d200bb2..8a9277485 100644 --- a/jwql/utils/logging_functions.py +++ b/jwql/utils/logging_functions.py @@ -65,8 +65,8 @@ def my_main_function(): from functools import wraps -from ..utils.permissions import set_permissions -from ..utils.utils import get_config, ensure_dir_exists +from jwql.utils.permissions import set_permissions +from jwql.utils.utils import get_config, ensure_dir_exists LOG_FILE_LOC = '' PRODUCTION_BOOL = '' diff --git a/jwql/utils/preview_image.py b/jwql/utils/preview_image.py index 47df53dec..f51a5bc8e 100755 --- a/jwql/utils/preview_image.py +++ b/jwql/utils/preview_image.py @@ -41,7 +41,7 @@ from jwst.datamodels import dqflags import numpy as np -from ..utils import permissions +from jwql.utils import permissions # Use the 'Agg' backend to avoid invoking $DISPLAY import matplotlib diff --git a/jwql/utils/utils.py b/jwql/utils/utils.py index 82d9345ad..77df21a9e 100644 --- a/jwql/utils/utils.py +++ b/jwql/utils/utils.py @@ -25,7 +25,7 @@ import os import re -from . import permissions +from jwql.utils import permissions __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) diff --git a/jwql/website/apps/jwql/data_containers.py b/jwql/website/apps/jwql/data_containers.py index b3b8fb9f8..b83717e0f 100644 --- a/jwql/website/apps/jwql/data_containers.py +++ b/jwql/website/apps/jwql/data_containers.py @@ -27,7 +27,7 @@ from astropy.io import fits import numpy as np -from jwql.preview_image.preview_image import PreviewImage +from jwql.utils.preview_image import PreviewImage from jwql.utils.utils import get_config, filename_parser, MONITORS __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) From 2d93e593926e9bfdad29df3cbb6590b18a5a1465 Mon Sep 17 00:00:00 2001 From: Matthew Bourque Date: Tue, 11 Sep 2018 11:08:40 -0400 Subject: [PATCH 6/7] Fixed some small pep8 issues. --- jwql/tests/test_preview_image.py | 1 + jwql/utils/utils.py | 1 - jwql/website/apps/jwql/data_containers.py | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jwql/tests/test_preview_image.py b/jwql/tests/test_preview_image.py index 4f2faa658..789d887ee 100644 --- a/jwql/tests/test_preview_image.py +++ b/jwql/tests/test_preview_image.py @@ -33,6 +33,7 @@ # directory that contains sample images TEST_DATA_DIRECTORY = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'test_data') + @pytest.fixture(scope="module") def test_directory(test_dir=TEST_DIRECTORY): """Create a test directory for preview image. diff --git a/jwql/utils/utils.py b/jwql/utils/utils.py index 77df21a9e..cf0162e92 100644 --- a/jwql/utils/utils.py +++ b/jwql/utils/utils.py @@ -52,7 +52,6 @@ NIRCAM_LONGWAVE_DETECTORS = ['NRCA5', 'NRCB5'] - def ensure_dir_exists(fullpath): """Creates dirs from ``fullpath`` if they do not already exist. """ diff --git a/jwql/website/apps/jwql/data_containers.py b/jwql/website/apps/jwql/data_containers.py index b83717e0f..cbf3ef661 100644 --- a/jwql/website/apps/jwql/data_containers.py +++ b/jwql/website/apps/jwql/data_containers.py @@ -35,6 +35,7 @@ PACKAGE_DIR = os.path.dirname(__location__.split('website')[0]) REPO_DIR = os.path.split(PACKAGE_DIR)[0] + def get_acknowledgements(): """Returns a list of individuals who are acknowledged on the ``about`` page. From 8c7b1d1a1b02537ea654b870ac56f93abbb70601 Mon Sep 17 00:00:00 2001 From: Matthew Bourque Date: Tue, 11 Sep 2018 15:51:48 -0400 Subject: [PATCH 7/7] Added subdirectory for cross-instrument monitors --- jwql/instrument_monitors/common_monitors/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 jwql/instrument_monitors/common_monitors/__init__.py diff --git a/jwql/instrument_monitors/common_monitors/__init__.py b/jwql/instrument_monitors/common_monitors/__init__.py new file mode 100644 index 000000000..e69de29bb