Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused modules #1611

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jwql/edb/engineering_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
data that include the datapoint preceding the requested start time
and the datapoint that follows the requested end time.
"""
import calendar
# import calendar
from collections import OrderedDict
from datetime import datetime, timedelta
from numbers import Number
Expand Down
26 changes: 13 additions & 13 deletions jwql/instrument_monitors/common_monitors/cosmic_ray_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,31 @@
import numpy as np
import os
import re
import shutil
# import shutil

# Third-Party Imports
from astropy.io import fits
from astropy.time import Time
from jwst.datamodels import dqflags
import numpy as np
from pysiaf import Siaf
# from pysiaf import Siaf
from sqlalchemy import func
from sqlalchemy.exc import StatementError, DataError, DatabaseError, InvalidRequestError, OperationalError
from sqlalchemy.sql.expression import and_

# Local imports
from jwql.database.database_interface import MIRICosmicRayQueryHistory
from jwql.database.database_interface import MIRICosmicRayStats
from jwql.database.database_interface import NIRCamCosmicRayQueryHistory
from jwql.database.database_interface import NIRCamCosmicRayStats
from jwql.database.database_interface import NIRISSCosmicRayQueryHistory
from jwql.database.database_interface import NIRISSCosmicRayStats
from jwql.database.database_interface import NIRSpecCosmicRayQueryHistory
from jwql.database.database_interface import NIRSpecCosmicRayStats
from jwql.database.database_interface import FGSCosmicRayQueryHistory
from jwql.database.database_interface import FGSCosmicRayStats
# from jwql.database.database_interface import MIRICosmicRayQueryHistory
# from jwql.database.database_interface import MIRICosmicRayStats
# from jwql.database.database_interface import NIRCamCosmicRayQueryHistory
# from jwql.database.database_interface import NIRCamCosmicRayStats
# from jwql.database.database_interface import NIRISSCosmicRayQueryHistory
# from jwql.database.database_interface import NIRISSCosmicRayStats
# from jwql.database.database_interface import NIRSpecCosmicRayQueryHistory
# from jwql.database.database_interface import NIRSpecCosmicRayStats
# from jwql.database.database_interface import FGSCosmicRayQueryHistory
# from jwql.database.database_interface import FGSCosmicRayStats
from jwql.database.database_interface import session, engine
from jwql.shared_tasks.shared_tasks import only_one, run_pipeline, run_parallel_pipeline
from jwql.shared_tasks.shared_tasks import only_one, run_parallel_pipeline #, run_pipeline
from jwql.utils import mast_utils
from jwql.utils.constants import JWST_INSTRUMENT_NAMES, JWST_INSTRUMENT_NAMES_MIXEDCASE, JWST_DATAPRODUCTS
from jwql.utils.logging_functions import configure_logging
Expand Down
14 changes: 7 additions & 7 deletions jwql/instrument_monitors/common_monitors/dark_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
from astropy.modeling import models
from astropy.stats import sigma_clipped_stats
from astropy.time import Time
from bokeh.models import ColorBar, ColumnDataSource, HoverTool, Legend
from bokeh.models import ColorBar, ColumnDataSource, Legend #, HoverTool
from bokeh.models import LinearColorMapper
from bokeh.plotting import figure
import numpy as np
Expand All @@ -93,14 +93,14 @@
from sqlalchemy.sql.expression import and_

from jwql.database.database_interface import session, engine
from jwql.database.database_interface import NIRCamDarkQueryHistory, NIRCamDarkPixelStats, NIRCamDarkDarkCurrent
from jwql.database.database_interface import NIRISSDarkQueryHistory, NIRISSDarkPixelStats, NIRISSDarkDarkCurrent
from jwql.database.database_interface import MIRIDarkQueryHistory, MIRIDarkPixelStats, MIRIDarkDarkCurrent
from jwql.database.database_interface import NIRSpecDarkQueryHistory, NIRSpecDarkPixelStats, NIRSpecDarkDarkCurrent
from jwql.database.database_interface import FGSDarkQueryHistory, FGSDarkPixelStats, FGSDarkDarkCurrent
# from jwql.database.database_interface import NIRCamDarkQueryHistory, NIRCamDarkPixelStats, NIRCamDarkDarkCurrent
# from jwql.database.database_interface import NIRISSDarkQueryHistory, NIRISSDarkPixelStats, NIRISSDarkDarkCurrent
# from jwql.database.database_interface import MIRIDarkQueryHistory, MIRIDarkPixelStats, MIRIDarkDarkCurrent
# from jwql.database.database_interface import NIRSpecDarkQueryHistory, NIRSpecDarkPixelStats, NIRSpecDarkDarkCurrent
# from jwql.database.database_interface import FGSDarkQueryHistory, FGSDarkPixelStats, FGSDarkDarkCurrent
from jwql.instrument_monitors import pipeline_tools
from jwql.shared_tasks.shared_tasks import only_one, run_pipeline, run_parallel_pipeline
from jwql.utils import calculations, instrument_properties, mast_utils, monitor_utils
from jwql.utils import calculations, instrument_properties, monitor_utils #, mast_utils
from jwql.utils.constants import ASIC_TEMPLATES, DARK_MONITOR_BETWEEN_EPOCH_THRESHOLD_TIME, DARK_MONITOR_MAX_BADPOINTS_TO_PLOT
from jwql.utils.constants import JWST_INSTRUMENT_NAMES, FULL_FRAME_APERTURES, JWST_INSTRUMENT_NAMES_MIXEDCASE
from jwql.utils.constants import JWST_DATAPRODUCTS, MINIMUM_DARK_CURRENT_GROUPS, RAPID_READPATTERNS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,21 +376,22 @@

from astropy.stats import sigma_clipped_stats
from astropy.table import Table
from astropy.time import Time, TimeDelta
# from astropy.time import Time, TimeDelta
import astropy.units as u
from bokeh.embed import components, json_item
from bokeh.layouts import gridplot
from bokeh.models import BoxAnnotation, ColumnDataSource, DatetimeTickFormatter, HoverTool, Range1d
from bokeh.models import ColumnDataSource, DatetimeTickFormatter, HoverTool, Range1d
from bokeh.models.layouts import Tabs
from bokeh.plotting import figure, output_file, save, show
from bokeh.palettes import Turbo256
from jwql.database import database_interface
from jwql.database.database_interface import NIRCamEDBDailyStats, NIRCamEDBBlockStats, \
NIRCamEDBTimeIntervalStats, NIRCamEDBEveryChangeStats, NIRISSEDBDailyStats, NIRISSEDBBlockStats, \
NIRISSEDBTimeIntervalStats, NIRISSEDBEveryChangeStats, MIRIEDBDailyStats, MIRIEDBBlockStats, \
MIRIEDBTimeIntervalStats, MIRIEDBEveryChangeStats, FGSEDBDailyStats, FGSEDBBlockStats, \
FGSEDBTimeIntervalStats, FGSEDBEveryChangeStats, NIRSpecEDBDailyStats, NIRSpecEDBBlockStats, \
NIRSpecEDBTimeIntervalStats, NIRSpecEDBEveryChangeStats, session, engine
# from jwql.database.database_interface import NIRCamEDBDailyStats, NIRCamEDBBlockStats, \
# NIRCamEDBTimeIntervalStats, NIRCamEDBEveryChangeStats, NIRISSEDBDailyStats, NIRISSEDBBlockStats, \
# NIRISSEDBTimeIntervalStats, NIRISSEDBEveryChangeStats, MIRIEDBDailyStats, MIRIEDBBlockStats, \
# MIRIEDBTimeIntervalStats, MIRIEDBEveryChangeStats, FGSEDBDailyStats, FGSEDBBlockStats, \
# FGSEDBTimeIntervalStats, FGSEDBEveryChangeStats, NIRSpecEDBDailyStats, NIRSpecEDBBlockStats, \
# NIRSpecEDBTimeIntervalStats, NIRSpecEDBEveryChangeStats, session, engine
from jwql.database.database_interface import session, engine
from jwql.edb import engineering_database as ed
from jwql.instrument_monitors.common_monitors.edb_telemetry_monitor_utils import condition
from jwql.instrument_monitors.common_monitors.edb_telemetry_monitor_utils import utils
Expand Down
4 changes: 2 additions & 2 deletions jwql/instrument_monitors/common_monitors/readnoise_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
import numpy as np # noqa: E402 (module level import not at top of file)
from pysiaf import Siaf # noqa: E402 (module level import not at top of file)

from jwql.shared_tasks.shared_tasks import only_one, run_pipeline, run_parallel_pipeline # noqa: E402 (module level import not at top of file)
from jwql.shared_tasks.shared_tasks import only_one, run_parallel_pipeline # noqa: E402 (module level import not at top of file)
from jwql.instrument_monitors import pipeline_tools # noqa: E402 (module level import not at top of file)
from jwql.utils import instrument_properties, monitor_utils # noqa: E402 (module level import not at top of file)
from jwql.utils.constants import JWST_INSTRUMENT_NAMES, JWST_INSTRUMENT_NAMES_MIXEDCASE # noqa: E402 (module level import not at top of file)
from jwql.utils.constants import ON_GITHUB_ACTIONS, ON_READTHEDOCS # noqa: E402 (module level import not at top of file)
from jwql.utils.logging_functions import log_info, log_fail # noqa: E402 (module level import not at top of file)
from jwql.utils.monitor_utils import update_monitor_table # noqa: E402 (module level import not at top of file)
# from jwql.utils.monitor_utils import update_monitor_table # noqa: E402 (module level import not at top of file)
from jwql.utils.permissions import set_permissions # noqa: E402 (module level import not at top of file)
from jwql.utils.utils import ensure_dir_exists, filesystem_path, get_config, copy_files # noqa: E402 (module level import not at top of file)

Expand Down
14 changes: 7 additions & 7 deletions jwql/jwql_monitors/monitor_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
placed in the ``jwql`` directory.
"""

from collections import defaultdict
# from collections import defaultdict
import datetime
import itertools
# import itertools
import logging
import os
import subprocess

from astroquery.mast import Mast, Observations
from bokeh.embed import components
from bokeh.layouts import gridplot
from bokeh.palettes import Category20_20 as palette
from bokeh.plotting import figure, output_file, save
# from bokeh.embed import components
# from bokeh.layouts import gridplot
# from bokeh.palettes import Category20_20 as palette
# from bokeh.plotting import figure, output_file, save
import numpy as np
from sqlalchemy.exc import DataError

Expand All @@ -57,7 +57,7 @@
from jwql.database.database_interface import CentralStore
from jwql.utils.logging_functions import log_info, log_fail
from jwql.utils.permissions import set_permissions
from jwql.utils.constants import FILESYSTEM_MONITOR_SUBDIRS, FILE_SUFFIX_TYPES, FILTERS_PER_INSTRUMENT, INSTRUMENT_SERVICE_MATCH
from jwql.utils.constants import FILESYSTEM_MONITOR_SUBDIRS, FILTERS_PER_INSTRUMENT, INSTRUMENT_SERVICE_MATCH
from jwql.utils.constants import JWST_INSTRUMENT_NAMES, JWST_INSTRUMENT_NAMES_MIXEDCASE, JWST_INSTRUMENT_NAMES_MIXEDCASE
from jwql.utils.utils import filename_parser
from jwql.utils.utils import get_config
Expand Down
54 changes: 27 additions & 27 deletions jwql/shared_tasks/shared_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,38 +70,38 @@ def some_function(some_arguments):
synchronously, run a group of tasks with a final callback function, etc. These are best
explained by the celery documentation itself.
"""
from astropy.io import fits
from collections import OrderedDict
from copy import deepcopy
# from astropy.io import fits
# from collections import OrderedDict
# from copy import deepcopy
import gc
from glob import glob
import json
# import json
import logging
from logging import FileHandler, StreamHandler
from logging import FileHandler #, StreamHandler
import os
import redis
import shutil
# import shutil
from subprocess import Popen, PIPE, run, STDOUT
import sys

from astropy.io import fits

from jwst import datamodels
from jwst.dq_init import DQInitStep
from jwst.dark_current import DarkCurrentStep
from jwst.firstframe import FirstFrameStep
from jwst.group_scale import GroupScaleStep
from jwst.ipc import IPCStep
from jwst.jump import JumpStep
from jwst.lastframe import LastFrameStep
from jwst.linearity import LinearityStep
from jwst.persistence import PersistenceStep
from jwst.pipeline.calwebb_detector1 import Detector1Pipeline
from jwst.ramp_fitting import RampFitStep
from jwst.refpix import RefPixStep
from jwst.rscd import RscdStep
from jwst.saturation import SaturationStep
from jwst.superbias import SuperBiasStep
# import sys

# from astropy.io import fits

# from jwst import datamodels
# from jwst.dq_init import DQInitStep
# from jwst.dark_current import DarkCurrentStep
# from jwst.firstframe import FirstFrameStep
# from jwst.group_scale import GroupScaleStep
# from jwst.ipc import IPCStep
# from jwst.jump import JumpStep
# from jwst.lastframe import LastFrameStep
# from jwst.linearity import LinearityStep
# from jwst.persistence import PersistenceStep
# from jwst.pipeline.calwebb_detector1 import Detector1Pipeline
# from jwst.ramp_fitting import RampFitStep
# from jwst.refpix import RefPixStep
# from jwst.rscd import RscdStep
# from jwst.saturation import SaturationStep
# from jwst.superbias import SuperBiasStep

from jwql.instrument_monitors.pipeline_tools import PIPELINE_STEP_MAPPING, get_pipeline_steps
from jwql.utils.logging_functions import configure_logging
Expand All @@ -111,7 +111,7 @@ def some_function(some_arguments):
from celery import Celery
from celery.app.log import TaskFormatter
from celery.signals import after_setup_logger, after_setup_task_logger, task_postrun
from celery.utils.log import get_task_logger
# from celery.utils.log import get_task_logger

try:
REDIS_HOST = get_config()["redis_host"]
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import http
import json
import os
# import os
from urllib import request, error

import pytest
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_bias_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from astropy.io import fits
import numpy as np

from jwql.database.database_interface import NIRCamBiasQueryHistory, NIRCamBiasStats, session
from jwql.database.database_interface import session
from jwql.instrument_monitors.common_monitors import bias_monitor
from jwql.tests.resources import has_test_db
from jwql.utils.utils import get_config
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_dark_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from jwql.instrument_monitors.common_monitors import dark_monitor
from jwql.tests.resources import has_test_db
from jwql.utils.monitor_utils import mast_query_darks
from jwql.utils.constants import DARK_MONITOR_BETWEEN_EPOCH_THRESHOLD_TIME
# from jwql.utils.constants import DARK_MONITOR_BETWEEN_EPOCH_THRESHOLD_TIME
from jwql.utils.utils import get_config
from jwql.utils.constants import ON_GITHUB_ACTIONS

Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
pytest -s test_edb.py
"""
from datetime import datetime
import os
# import os

from astropy.table import Table
from astropy.time import Time
Expand Down
4 changes: 2 additions & 2 deletions jwql/tests/test_edb_telemetry_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"""
from collections import defaultdict
from copy import deepcopy
import os
# import os
import pytest
from types import SimpleNamespace

from astropy.stats import sigma_clipped_stats
from astropy.table import Table
from astropy.table.column import Column
from astropy.time import Time, TimeDelta
from astropy.time import Time #, TimeDelta
import astropy.units as u
import datetime
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_loading_times.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
pytest -s test_loading_times.py
"""

import os
# import os
import pytest
import time
import urllib.request
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_mast_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
pytest -s test_mast_utils.py
"""

import os
# import os

from astroquery.mast import Mast

Expand Down
4 changes: 2 additions & 2 deletions jwql/tests/test_msata_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import warnings

import pandas as pd
import numpy as np
# import numpy as np
import pytest
from random import randint
from datetime import datetime
# from datetime import datetime
from bokeh.embed import components
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_preview_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import numpy as np
import os
import pytest
import shutil
# import shutil

from astropy.io import fits
from jwst.datamodels import dqflags
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_readnoise_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import numpy as np
import pytest

from jwql.database.database_interface import NIRCamReadnoiseQueryHistory, NIRCamReadnoiseStats, session
from jwql.database.database_interface import session
from jwql.instrument_monitors.common_monitors import readnoise_monitor
from jwql.tests.resources import has_test_db
from jwql.utils.constants import ON_GITHUB_ACTIONS
Expand Down
28 changes: 14 additions & 14 deletions jwql/tests/test_redis_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@
python test_redis_celery.py
"""

from astropy.io import ascii, fits
from collections import defaultdict
from collections import OrderedDict
# from astropy.io import ascii, fits
# from collections import defaultdict
# from collections import OrderedDict
from copy import deepcopy
import datetime
import logging
import numpy as np
# import datetime
# import logging
# import numpy as np
import os
from pathlib import Path
from pysiaf import Siaf
import pytest
# import pytest
from tempfile import TemporaryDirectory

from jwql.instrument_monitors import pipeline_tools
# from jwql.instrument_monitors import pipeline_tools
from jwql.shared_tasks.shared_tasks import only_one, run_pipeline, run_parallel_pipeline
from jwql.utils import crds_tools, instrument_properties, monitor_utils
from jwql.utils.constants import JWST_INSTRUMENT_NAMES, JWST_INSTRUMENT_NAMES_MIXEDCASE
from jwql.utils.constants import FLAT_EXP_TYPES, DARK_EXP_TYPES
from jwql.utils.logging_functions import log_info, log_fail
from jwql.utils.permissions import set_permissions
from jwql.utils.utils import copy_files, ensure_dir_exists, get_config, filesystem_path
# from jwql.utils import crds_tools, instrument_properties, monitor_utils
# from jwql.utils.constants import JWST_INSTRUMENT_NAMES, JWST_INSTRUMENT_NAMES_MIXEDCASE
# from jwql.utils.constants import FLAT_EXP_TYPES, DARK_EXP_TYPES
# from jwql.utils.logging_functions import log_info, log_fail
# from jwql.utils.permissions import set_permissions
from jwql.utils.utils import copy_files, get_config


def get_instrument(file_name):
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_wata_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import pandas as pd
import numpy as np
import pytest
from datetime import datetime
# from datetime import datetime
from bokeh.embed import components
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
Expand Down
Loading