Skip to content

Commit

Permalink
filename gymnastic to avoid _ql_ql_flat style names when storing a fi…
Browse files Browse the repository at this point in the history
…le with the _ql already. Comment in the code.
  • Loading branch information
KathleenLabrie committed Jul 6, 2023
1 parent dee4751 commit 4e14291
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion geminidr/core/primitives_calibdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,15 @@ def _markAsCalibration(self, adinputs=None, suffix=None, update_datalab=True,
proc_suffix = f"_{mode}"

if suffix:
proc_suffix += suffix
# the update_filename method, keeps the procmode suffix
# when it strips, if we don't remove it here, it will duplicate
# it, eg _ql_ql_flat. This can happen when storing after the
# fact, eg. the file is already _ql_flat. Here, if the
# proc_suffix is already in the filename use only suffix.
if proc_suffix in ad.filename:
proc_suffix = suffix
else:
proc_suffix += suffix
strip = True
else:
strip = False
Expand Down

0 comments on commit 4e14291

Please sign in to comment.