From 6637a8282f90531e547436e2da9d18118dd4aabd Mon Sep 17 00:00:00 2001 From: Joe Filippazzo Date: Mon, 9 Jul 2018 12:20:10 -0400 Subject: [PATCH 1/3] Renamed dbmonitor to monitor_mast so module has more descriptive name, matches naming convention of monitor_filesystem, and avoids confusion with the JWQL postgres database. --- jwql/__init__.py | 2 +- jwql/{dbmonitor => monitor_mast}/__init__.py | 0 jwql/{dbmonitor/dbmonitor.py => monitor_mast/monitor_mast.py} | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename jwql/{dbmonitor => monitor_mast}/__init__.py (100%) rename jwql/{dbmonitor/dbmonitor.py => monitor_mast/monitor_mast.py} (98%) diff --git a/jwql/__init__.py b/jwql/__init__.py index 6d9900a73..8ae149028 100644 --- a/jwql/__init__.py +++ b/jwql/__init__.py @@ -1 +1 @@ -from . import dbmonitor \ No newline at end of file +from . import monitor_mast \ No newline at end of file diff --git a/jwql/dbmonitor/__init__.py b/jwql/monitor_mast/__init__.py similarity index 100% rename from jwql/dbmonitor/__init__.py rename to jwql/monitor_mast/__init__.py diff --git a/jwql/dbmonitor/dbmonitor.py b/jwql/monitor_mast/monitor_mast.py similarity index 98% rename from jwql/dbmonitor/dbmonitor.py rename to jwql/monitor_mast/monitor_mast.py index fd680e1d1..d74c7ec58 100644 --- a/jwql/dbmonitor/dbmonitor.py +++ b/jwql/monitor_mast/monitor_mast.py @@ -12,8 +12,8 @@ To get an inventory of all JWST files do: :: - from jwql.dbmonitor import dbmonitor - inventory, keywords = dbmonitor.jwst_inventory() + from jwql.monitor_mast import monitor_mast + inventory, keywords = monitor_mast.jwst_inventory() """ import os From fe713b0e6650a43cf241858722f178402948bddf Mon Sep 17 00:00:00 2001 From: Joe Filippazzo Date: Mon, 9 Jul 2018 12:31:25 -0400 Subject: [PATCH 2/3] Updated test module for monitor_mast.py --- .../{test_dbmonitor.py => test_monitor_mast.py} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename jwql/tests/{test_dbmonitor.py => test_monitor_mast.py} (79%) diff --git a/jwql/tests/test_dbmonitor.py b/jwql/tests/test_monitor_mast.py similarity index 79% rename from jwql/tests/test_dbmonitor.py rename to jwql/tests/test_monitor_mast.py index 0f8ba352b..edb5664fa 100755 --- a/jwql/tests/test_dbmonitor.py +++ b/jwql/tests/test_monitor_mast.py @@ -1,6 +1,6 @@ #! /usr/bin/env python -"""Tests for the ``dbmonitor`` module. +"""Tests for the ``monitor_mast`` module. Authors ------- @@ -14,10 +14,10 @@ suppress verbose output to stdout): :: - pytest -s test_dbmonitor.py + pytest -s test_monitor_mast.py """ -from ..dbmonitor import dbmonitor as db +from ..monitor_mast import monitor_mast as mm from ..utils.utils import JWST_INSTRUMENTS @@ -26,7 +26,7 @@ def test_caom_instrument_keywords(): instruments""" kw = [] for ins in JWST_INSTRUMENTS: - kw.append(db.instrument_keywords(ins, caom=True)['keyword'].tolist()) + kw.append(mm.instrument_keywords(ins, caom=True)['keyword'].tolist()) assert kw[0] == kw[1] == kw[2] == kw[3] == kw[4] @@ -36,7 +36,7 @@ def test_filtered_instrument_keywords(): different for all instruments""" kw = [] for ins in JWST_INSTRUMENTS: - kw.append(db.instrument_keywords(ins, caom=False)['keyword'].tolist()) + kw.append(mm.instrument_keywords(ins, caom=False)['keyword'].tolist()) assert kw[0] != kw[1] != kw[2] != kw[3] != kw[4] @@ -44,7 +44,7 @@ def test_filtered_instrument_keywords(): def test_instrument_inventory_filtering(): """Test to see that the instrument inventory can be filtered""" filt = 'GR150R' - data = db.instrument_inventory('niriss', + data = mm.instrument_inventory('niriss', add_filters={'filter': filt}, return_data=True) @@ -57,7 +57,7 @@ def test_instrument_dataproduct_filtering(): """Test to see that the instrument inventory can be filtered by data product""" dp = 'spectrum' - data = db.instrument_inventory('nirspec', dataproduct=dp, caom=True, + data = mm.instrument_inventory('nirspec', dataproduct=dp, caom=True, return_data=True) dps = [row['dataproduct_type'] for row in data['data']] From 2f4128eb75601078f7baa7d1fa2151773a228494 Mon Sep 17 00:00:00 2001 From: Joe Filippazzo Date: Tue, 10 Jul 2018 11:06:58 -0400 Subject: [PATCH 3/3] Modified docs to reflect new monitor_mast module name. --- docs/source/dbmonitor.rst | 7 ------- docs/source/index.rst | 2 +- docs/source/monitor_mast.rst | 7 +++++++ docs/source/tests.rst | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 docs/source/dbmonitor.rst create mode 100644 docs/source/monitor_mast.rst diff --git a/docs/source/dbmonitor.rst b/docs/source/dbmonitor.rst deleted file mode 100644 index 9d7024c2a..000000000 --- a/docs/source/dbmonitor.rst +++ /dev/null @@ -1,7 +0,0 @@ -********* -dbmonitor -********* - -.. automodule:: jwql.dbmonitor.dbmonitor - :members: - :undoc-members: diff --git a/docs/source/index.rst b/docs/source/index.rst index 7a39bcf48..2ca24a646 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -19,7 +19,7 @@ API documentation :maxdepth: 1 :caption: Contents: - dbmonitor.rst + monitor_mast.rst permissions.rst preview_image.rst utils.rst diff --git a/docs/source/monitor_mast.rst b/docs/source/monitor_mast.rst new file mode 100644 index 000000000..5a263b0e4 --- /dev/null +++ b/docs/source/monitor_mast.rst @@ -0,0 +1,7 @@ +********* +monitor_mast +********* + +.. automodule:: jwql.monitor_mast.monitor_mast + :members: + :undoc-members: diff --git a/docs/source/tests.rst b/docs/source/tests.rst index 60bc69472..02d12f2a0 100644 --- a/docs/source/tests.rst +++ b/docs/source/tests.rst @@ -2,7 +2,7 @@ tests ***** -.. automodule:: jwql.tests.test_dbmonitor +.. automodule:: jwql.tests.test_monitor_mast :members: .. automodule:: jwql.tests.test_permissions