Skip to content

Commit

Permalink
Change qe_curves to qe_curve to match dataset type name
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Mar 20, 2020
1 parent 735611d commit fd191a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/lsst/pipe/tasks/read_curated_calibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def read_one_chip(root, chip_name, chip_id):
A dictionary of objects constructed from the appropriate factory class.
The key is the validity start time as a `datetime` object.
"""
factory_map = {'qe_curves': Curve, 'defects': Defects}
factory_map = {'qe_curve': Curve, 'defects': Defects}
files = glob.glob(os.path.join(root, chip_name, '*.ecsv'))
parts = os.path.split(root)
instrument = os.path.split(parts[0])[1] # convention is that these reside at <instrument>/<data_name>
Expand Down
8 changes: 4 additions & 4 deletions tests/test_read_CuratedCalibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ReadQeTestCase(unittest.TestCase):
def setUp(self):
butler = dafPersist.ButlerFactory(mapper=BaseMapper(ROOT)).create()
self.cam = butler.get('camera')
self.qe_path = os.path.join(ROOT, 'trivial_camera', 'qe_curves')
self.qe_path = os.path.join(ROOT, 'trivial_camera', 'qe_curve')
self.tmp_dir_obj = tempfile.TemporaryDirectory()

def tearDown(self):
Expand All @@ -82,15 +82,15 @@ def read_qe_tester(self, per_amp):
path_str = 'per_detector'
files = glob.glob(os.path.join(self.qe_path, 'ccd00', path_str, '*'))
dest_path = os.path.join(self.tmp_dir_obj.name, 'trivial_camera',
'qe_curves', 'ccd00')
'qe_curve', 'ccd00')
os.makedirs(dest_path)
dest_files = [os.path.join(dest_path, os.path.split(f)[1]) for f in files]
for f, df in zip(files, dest_files):
os.symlink(f, df)
curves, data_type = read_all(os.path.join(self.tmp_dir_obj.name, 'trivial_camera', 'qe_curves'),
curves, data_type = read_all(os.path.join(self.tmp_dir_obj.name, 'trivial_camera', 'qe_curve'),
self.cam)
self.assertEqual(len(curves.keys()), 1) # One sensor
self.assertEqual(data_type, 'qe_curves')
self.assertEqual(data_type, 'qe_curve')
for s in curves:
self.assertEqual(len(curves[s].keys()), 2) # Two validity ranges
if per_amp:
Expand Down

0 comments on commit fd191a3

Please sign in to comment.