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 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 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/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/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/common_monitors/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from jwql/monitor_filesystem/__init__.py rename to jwql/instrument_monitors/common_monitors/__init__.py diff --git a/jwql/monitor_mast/__init__.py b/jwql/instrument_monitors/fgs_monitors/__init__.py similarity index 100% rename from jwql/monitor_mast/__init__.py rename to jwql/instrument_monitors/fgs_monitors/__init__.py diff --git a/jwql/permissions/__init__.py b/jwql/instrument_monitors/miri_monitors/__init__.py similarity index 100% rename from jwql/permissions/__init__.py rename to jwql/instrument_monitors/miri_monitors/__init__.py diff --git a/jwql/preview_image/__init__.py b/jwql/instrument_monitors/nircam_monitors/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from jwql/preview_image/__init__.py rename to jwql/instrument_monitors/nircam_monitors/__init__.py diff --git a/jwql/instrument_monitors/niriss_monitors/__init__.py b/jwql/instrument_monitors/niriss_monitors/__init__.py new file mode 100644 index 000000000..e69de29bb 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 97% rename from jwql/preview_image/generate_preview_images.py rename to jwql/jwql_monitors/generate_preview_images.py index fd3e16c2a..be78072fa 100755 --- a/jwql/preview_image/generate_preview_images.py +++ b/jwql/jwql_monitors/generate_preview_images.py @@ -33,11 +33,11 @@ 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 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 @@ -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/monitor_filesystem/monitor_filesystem.py b/jwql/jwql_monitors/monitor_filesystem.py similarity index 99% rename from jwql/monitor_filesystem/monitor_filesystem.py rename to jwql/jwql_monitors/monitor_filesystem.py index f798dc552..9198b103e 100755 --- a/jwql/monitor_filesystem/monitor_filesystem.py +++ b/jwql/jwql_monitors/monitor_filesystem.py @@ -70,8 +70,8 @@ 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.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 diff --git a/jwql/monitor_mast/monitor_mast.py b/jwql/jwql_monitors/monitor_mast.py similarity index 98% rename from jwql/monitor_mast/monitor_mast.py rename to jwql/jwql_monitors/monitor_mast.py index 043b7f8c9..61daf726a 100644 --- a/jwql/monitor_mast/monitor_mast.py +++ b/jwql/jwql_monitors/monitor_mast.py @@ -24,8 +24,8 @@ 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.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 diff --git a/jwql/tests/test_monitor_mast.py b/jwql/tests/test_monitor_mast.py index edb5664fa..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 ..monitor_mast 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 bcb455c6e..83a94aa7f 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 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 568624b8b..789d887ee 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 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') @@ -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/logging/logging_functions.py b/jwql/utils/logging_functions.py similarity index 99% rename from jwql/logging/logging_functions.py rename to jwql/utils/logging_functions.py index c5f0e6d71..8a9277485 100644 --- a/jwql/logging/logging_functions.py +++ b/jwql/utils/logging_functions.py @@ -65,7 +65,7 @@ def my_main_function(): from functools import wraps -from jwql.permissions.permissions import set_permissions +from jwql.utils.permissions import set_permissions from jwql.utils.utils import get_config, ensure_dir_exists LOG_FILE_LOC = '' 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 99% rename from jwql/preview_image/preview_image.py rename to jwql/utils/preview_image.py index 44dd7c516..f51a5bc8e 100755 --- a/jwql/preview_image/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 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 f6ddf89bd..cf0162e92 100644 --- a/jwql/utils/utils.py +++ b/jwql/utils/utils.py @@ -25,7 +25,7 @@ import os import re -from ..permissions import permissions +from jwql.utils import permissions __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) @@ -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 b3b8fb9f8..cbf3ef661 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__))) @@ -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. 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