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

DM-23778: Change qe_curves to qe_curve to match dataset type name #360

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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