Skip to content

Commit

Permalink
Merge pull request #138 from bourque/reorganize-repository
Browse files Browse the repository at this point in the history
Reorganize repository
  • Loading branch information
bourque authored Sep 11, 2018
2 parents a159c66 + 56c61ae commit 2eb383c
Show file tree
Hide file tree
Showing 34 changed files with 59 additions and 75 deletions.
7 changes: 1 addition & 6 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions docs/source/jwql_monitors.rst
Original file line number Diff line number Diff line change
@@ -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:
7 changes: 0 additions & 7 deletions docs/source/logging.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/monitor_filesystem.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/monitor_mast.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/permissions.rst

This file was deleted.

15 changes: 0 additions & 15 deletions docs/source/preview_image.rst

This file was deleted.

8 changes: 6 additions & 2 deletions docs/source/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
13 changes: 13 additions & 0 deletions docs/source/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
1 change: 0 additions & 1 deletion jwql/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from . import monitor_mast
2 changes: 1 addition & 1 deletion jwql/database/database_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file added jwql/jwql_monitors/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions jwql/tests/test_monitor_mast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion jwql/tests/test_preview_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@

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')

# 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions jwql/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)))

Expand All @@ -52,7 +52,6 @@
NIRCAM_LONGWAVE_DETECTORS = ['NRCA5', 'NRCB5']



def ensure_dir_exists(fullpath):
"""Creates dirs from ``fullpath`` if they do not already exist.
"""
Expand Down
3 changes: 2 additions & 1 deletion jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
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__)))
FILESYSTEM_DIR = os.path.join(get_config()['jwql_dir'], 'filesystem')
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.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2eb383c

Please sign in to comment.