Skip to content

Commit 563ae11

Browse files
adjust imports
1 parent b3231f5 commit 563ae11

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/wfi_reference_pipeline/database/db_entry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from datetime import datetime
22

33
import romancal
4+
from rtb_db.constants.rfp_reef import DB_QC_INCOMPLETE
5+
from rtb_db.table_defs.wfi_rfp.log import RFPLogProTable
46

57
from wfi_reference_pipeline import __version__ as rfp_version
68

@@ -31,8 +33,6 @@ def init_rfp_log_pro(self, ref_type, wfi_mode, reef_monitor):
3133
reef_monitor : bool
3234
Expecting external monitoring for this run.
3335
"""
34-
from rtb_db.constants.rfp_reef import DB_QC_INCOMPLETE
35-
from rtb_db.table_defs.wfi_rfp.log import RFPLogProTable
3636
start_time = self.get_date_time_formatted()
3737
self.rfp_log_pro = RFPLogProTable(ref_type=ref_type,
3838
start_time=start_time,

src/wfi_reference_pipeline/utilities/db_handler.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import logging
22

3+
from rtb_db.utilities.login import connect_server
4+
from rtb_db.utilities.table_tools import (
5+
add_to_tables_from_class_list,
6+
ensure_connection_is_engine,
7+
)
8+
39
from wfi_reference_pipeline import constants
410
from wfi_reference_pipeline.database.db_entry import DBEntry
511

@@ -80,8 +86,7 @@ def _connect(self, use_dsn, sql_server_str, sql_database_str, port, dsn_header_s
8086
"""
8187

8288
try:
83-
from rtb_db.utilities.login import connect_server
84-
from rtb_db.utilities.table_tools import ensure_connection_is_engine
89+
8590
if use_dsn:
8691
engine = connect_server(dsn_name=dsn_header_str)
8792
else:
@@ -115,6 +120,5 @@ def new_pipeline_db_entry(self, ref_type, wfi_mode, reef_monitor):
115120
reef_monitor : bool
116121
Expecting external monitoring for this run.
117122
"""
118-
from rtb_db.utilities.table_tools import add_to_tables_from_class_list
119123
self.db_entry.init_rfp_log_pro(ref_type, wfi_mode, reef_monitor)
120124
add_to_tables_from_class_list(self.db_engine, [self.db_entry.rfp_log_pro])

src/wfi_reference_pipeline/utilities/rtbdb_functions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import logging
22

3+
from rtb_db.utilities import login, rfp_tools
4+
35

46
def get_ma_table_from_rtbdb(ma_table_number=None):
57
"""
@@ -15,8 +17,6 @@ def get_ma_table_from_rtbdb(ma_table_number=None):
1517
ma_table_dict: dictionary
1618
A python dictionary of MA Table information. See RTB Database examples for keys and values.
1719
"""
18-
from rtb_db.utilities import login, rfp_tools
19-
2020
eng = login.connect_server(dsn_name='DWRINSDB')
2121
ma_table_dict = rfp_tools.query_ma_table(eng, ma_table_number)
2222
if ma_table_dict:
@@ -67,6 +67,5 @@ def write_metrics_db_dark(dark_file_dict, dark_dq_dict, dark_struc_dict, dark_am
6767
dark_amp_dict: dict, default=None
6868
This is the amplifier dictionary containing various metrics of sections of pixels according to amplifier.
6969
"""
70-
from rtb_db.utilities import login, rfp_tools
7170
eng = login.connect_server(dsn_name='DWRINSDB')
7271
rfp_tools.add_new_dark_file(eng, dark_file_dict, dark_dq_dict,dark_struc_dict, dark_amp_dict)

0 commit comments

Comments
 (0)